Skip to content

fix(staging): preserve platform ownership of the ingress hold - #5411

Merged
devantler merged 3 commits into
mainfrom
codex/staging-hold-owner-5247-01a1783e
Nov 2, 2026
Merged

devantler merged 3 commits into
mainfrom
codex/staging-hold-owner-5247-01a1783e

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

The public staging application's traffic hold must remain under platform control when the application is enabled. Tenant updates must not silently remove that protection.

What

Reserve the staging hold for the trusted platform controllers while retaining ordinary tenant changes elsewhere. Also prevent an existing reserved policy from being treated as permission for a later tenant update.

Part of #5247

devantler commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Source evaluation for f47505761dc583b3c69332aa32bf835361d5d43e.

This extends the existing reserved-policy owner rule to the exact staging-hold name in the business namespace for CREATE/UPDATE/DELETE. It keeps both existing trusted platform-controller carve-outs, rejects a controller name in a tenant namespace, and does not reserve that name in other namespaces. The source-only tenant settings and installed hold specification are unchanged.

The real pinned Kyverno 1.19.1 CLI first admitted the tenant CREATE/UPDATE/DELETE controls under the previous policy. The new CREATE test was RED. The first correction then exposed the existing-violation UPDATE exception (skip instead of denial); disabling that exception for the reserved-owner rule made the full actor/operation controls pass. The same rule now explicitly refuses untrusted updates to all three generated floor names while their trusted generator remains allowed. All earlier boundary, scaffold and controller controls remain.

Validation: the complete 882-test Kyverno suite passed, the complete tenant-network script and its new controls passed, policy CI routing/result controls passed, ShellCheck and diff checks passed. Both local and production KSail validation returned 0. The local tool still reports unrelated Helm expansion skips because its configured credential helper is unavailable, and some unrelated namespace-selector evaluations lack offline labels; these outputs are not complete chart or live admission coverage. No cluster was started.

Normal CI/review/queue and post-merge admission/convergence checks are still required. No application, private projection, route, customer identity or portal activation is added. #5247 keeps the remaining staging acceptance.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 476fd5c and 400ef9c.

Files selected for processing: 3
  • docs/tenant-abstraction.md
  • k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml
  • scripts/tests/test-restrict-tenant-network-policies.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 1
  • GitHub Check: CodeRabbit
Additional context used
Code guidelines: 1
AGENTS.md — auto-discovered
Path-based instructions: 2
Source excerpt: Resources under `k8s/bases/infrastructure/` are **component-folder-first**: a component's HelmRelease/HelmRepository and its own CRs live together in a folder named after the component — `controllers//` in the con...

CodeRabbit inference engine (AGENTS.md)

Files:

  • k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml
Source excerpt: **Directories are kebab-case**, named after the **application/component** *or* a **CR Kind in plural**.

CodeRabbit inference engine (AGENTS.md)

Files:

  • k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml
Additional comments: 3
docs/tenant-abstraction.md: 1

194-208: LGTM!

k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml: 1

125-130: LGTM!

Also applies to: 518-528, 544-547, 552-553

scripts/tests/test-restrict-tenant-network-policies.sh: 1

8-10: LGTM!

Also applies to: 18-18, 23-23, 119-173

Walkthrough

The admission policy reserves business-site-staging-hold in the business-site namespace for trusted platform controllers. Tenant CREATE, UPDATE, and DELETE requests for that policy are denied, including updates to an already noncompliant object. The tests check these outcomes, trusted-author exceptions, and requests using other names or namespaces. The documentation distinguishes this ownership rule from traffic effects and live staging acceptance.

Possibly related issues

Possibly related PRs

  • devantler-tech/platform#5344 — That PR changes the namespace scope and controller ownership model used by the admission policy that this PR extends.

Priority: Normal

Merge Risk: Minimal · up to 400ef

The change reserves the staging hold for platform controllers. No concrete merge-blocking risk was established.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description directly explains the staging hold ownership change and the prevention of unauthorized tenant updates.
Title check Passed The title is concise and clearly identifies the staging fix that preserves platform ownership of the ingress hold.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Readiness evaluation for 400ef9cfd84dc7eecc8e7e7d8cadb6c6728088bc against current main a56a2cf3b4a10ce5352f19e9a8e9da106373b00f.

The exact-head CI run 40430265537 and all six associated native workflow runs succeeded. The complete policy tests exercise tenant CREATE/UPDATE/DELETE refusal for the committed staging hold, the two existing trusted controller exceptions, wrong-namespace identities and ordinary policy names. Local pinned Kyverno 1.19.1 evaluation at this head passed the complete 883-test suite and retained earlier controls. This is actual admission-engine behavior; post-merge cluster convergence and the later traffic acceptance remain separate.

CodeRabbit's authenticated summary 6431378150 reviews this exact head with no actionable findings. All review objects, conversation/body/ancillary findings, inline comments and threads were read: no unresolved finding or thread. Current head signature is valid, the base has no overlapping change, and GitHub reports CLEAN. Native code_quality analysis remains UNVERIFIED; no waiver or complete-analysis claim is made. Normal protected promotion/queue checks remain mandatory.

The unrelated retired database is still unhealthy and its retirement has a separate live maintainer holder. This change touches no database, private input, application or route and does not take over that cleanup. The portal stays inactive. The prior-turn API handoff uses the maintainer's standing authorization; no foreign checkout is edited and no local ownership marker is impersonated.

@devantler
devantler marked this pull request as ready for review October 27, 2026 01:35
@devantler
devantler added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 27, 2026
@devantler

devantler commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Blocker: #5412 | upstream | last-verified 2026-10-29: Protected-main verification has recovered: Validate Main 40918750242 succeeded with production convergence and authorization. Actual administration availability is still failing: a fresh browser visit followed the existing Homepage Email/Stalwart tile and received an upstream connection-termination response before login. This supersedes the older successful availability sample; it is not authenticated administration or sustained-readiness proof. Keep this staging repair parked until that exact availability condition is verified. Active #5547 remains separate work; no takeover, duplicate recovery or production mutation was performed.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T11:13:45.198799Z ff1ee4a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: ff1ee4a14d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Unparked and evaluated at ff1ee4a14d3ede302fce493faa6ee0ed14bb2b42. The availability condition this PR waited on is now met: the Email entry stayed reachable through to its sign-in page. That read did not sign in. The older record comment above is out of date, and this PR no longer carries the blocked label.

The branch was brought up to date with main (216 commits), which added no change of its own to the three files.

Check Expected Actual
Tenant writes to the staging hold Create, update and delete denied Exercised by the policy regression, run in CI at this head
Platform controllers Permitted Same regression
A controller name inside the tenant's namespace Denied, with no borrowed carve-out Same regression
Same name elsewhere, or another name here Ordinary rules apply Same regression
Reviews Clean at this head Codex clean, 0 open threads

Not proven until it deploys: real admission behaviour. This changes who may write the hold, not the hold's traffic effect, and #5247 keeps that acceptance.

@devantler
devantler added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 09d4eb4 Nov 2, 2026
51 checks passed
@devantler
devantler deleted the codex/staging-hold-owner-5247-01a1783e branch November 2, 2026 15:09
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant