Skip to content

feat(deploy): project the platform's runtime Secret into the WebApp - #594

Merged
devantler merged 2 commits into
mainfrom
claude/portal-runtime-projection-302
Nov 15, 2026
Merged

devantler merged 2 commits into
mainfrom
claude/portal-runtime-projection-302

Conversation

@devantler

@devantler devantler commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Merge precondition: the business-site-runtime Secret must exist in namespace business-site in production, with the keys company-disclosure, portal-settings, portal-client-secret and portal-database-ca. The platform creates it with an ExternalSecret (the follow-up to devantler-tech/platform#6313). Without it the WebApp's Pods cannot start and the public site goes down. Keep this PR a draft until then.

Summary

The tenant package now projects the one Secret the platform composes, business-site-runtime, instead of the disclosure-only Secret. Portal sign-in stays off.

  • deploy/webapp.yaml: the single projection becomes business-site-runtime with four items: company-disclosure as disclosure, plus portal-settings, portal-client-secret and portal-database-ca at their own names. The arguments gain --portal-settings-projection /run/webapp-inputs/portal-settings; all existing arguments stay. While sign-in is off, portal-settings contains only a # comment line, so the portal reads none of the other items.
  • Validator (scripts/check-tenant-package.mjs): admits exactly that Secret, those four items in that order and the appended argument pair. The package tests add refusals for:
    • the old or a foreign Secret name;
    • a missing settings, client-secret or database-CA item;
    • a migration-credential item;
    • a renamed or swapped path;
    • a missing, relocated or repeated settings argument;
    • an invitation argument.
  • Docker smoke (scripts/tenant-runtime-smoke.test.mjs):
    • Mounts fictional files for all four items. The settings file holds only a comment line.
    • Shows that the exact package arguments fail closed without the disclosure, and without the settings item.
    • Serves both hosts with the portal closed.
    • The public receipt check (--check-serving-public) runs without the settings argument, because it refuses portal settings by design.
  • Projection fixture: it now verifies the ownership of every copied item. On macOS it drops provenance extended attributes, which the Linux Docker daemon cannot set.
  • deploy/external-secret-disclosure.yaml stays declared but is no longer projected; removing it is a later cleanup. deploy/README.md and the deploy rule in AGENTS.md are updated to match.

Validation

  • kubectl kustomize deploy | node scripts/check-tenant-package.mjs accepts the package.
  • node --test scripts/tenant-package.test.mjs passes 105/105.
  • node --test scripts/container-contract.test.mjs passes 15/15.
  • bash scripts/runtime-verification.test.sh passes.
  • node --test scripts/runtime-stages.test.mjs passes 43/43.
  • Docker runtime smoke (Colima):
    • Against the committed baseline image it cannot pass. That image was built from ee69fc5 (2026-10-22), before both the --public-host and --portal-settings-projection arguments existed, so it exits with runtime arguments are invalid; main's own no-argument smoke has the same limitation. CI runs the smoke against its newly built production image.
    • As local evidence, I built a Linux binary from this branch and copied it onto the committed image, which provides the distroless base and public snapshot. node scripts/tenant-runtime-smoke.test.mjs against that image passes 3/3.
  • Spelling and credential scans of the changed files show no new findings.

Refs #302

Update (2026-11-15)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.64s
✅ CSS stylelint 1 0 0 0 1.67s
✅ GO golangci-lint yes yes no no 144.85s
✅ GO revive 168 0 0 1.0s
✅ HTML djlint 5 0 0 1.95s
✅ HTML htmlhint 5 0 0 0.63s
✅ JSON jsonlint 2 0 0 0.21s
✅ JSON prettier 2 0 0 0 0.89s
✅ JSON v8r 2 0 0 1.26s
✅ MARKDOWN markdownlint 17 0 0 0 1.82s
✅ MARKDOWN markdown-table-formatter 17 0 0 0 0.41s
✅ REPOSITORY betterleaks yes no no 1.05s
✅ REPOSITORY checkov yes no no 19.84s
✅ REPOSITORY git_diff yes no no 0.17s
✅ REPOSITORY grype yes no no 201.98s
✅ REPOSITORY osv-scanner yes no no 175.04s
✅ REPOSITORY secretlint yes no no 1.3s
✅ REPOSITORY syft yes no no 3.24s
✅ REPOSITORY trivy yes no no 17.95s
✅ REPOSITORY trivy-sbom yes no no 0.24s
✅ REPOSITORY trufflehog yes no no 2.29s
✅ SPELL cspell 195 0 0 6.27s
✅ SPELL lychee 24 0 0 148.75s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters COPYPASTE_JSCPD,CSS_STYLELINT,GO_GOLANGCI_LINT,GO_REVIVE,HTML_DJLINT,HTML_HTMLHINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

devantler and others added 2 commits November 15, 2026 18:38
The WebApp now projects the platform-composed `business-site-runtime` Secret
with exactly four items (company-disclosure as disclosure, portal-settings,
portal-client-secret, portal-database-ca) and passes
`--portal-settings-projection /run/webapp-inputs/portal-settings`. While
sign-in is off the settings item holds only a comment line, so the portal
reads none of the other portal items and stays closed.

The package validator admits exactly that Secret, those items and the
appended argument pair, and the package tests refuse missing, renamed,
extra or relocated inputs. The Docker smoke mounts fictional files for all
four items, proves serving fails closed without the disclosure or the
settings item, and keeps the portal closed with a comment-only settings
file. The public receipt check omits the settings argument, which it
refuses by design. The projection fixture now verifies every copied item
and drops macOS tar metadata that a Linux daemon cannot set.

The retained disclosure ExternalSecret is no longer projected; removing it
is a later cleanup. Merge only after `business-site-runtime` exists in
production: without it the Pods cannot start.

Refs #302

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#598's billing test pinned the WebApp's one projection to
business-site-disclosure and forbade a portal-settings argument. This PR
projects the platform's business-site-runtime instead, with the portal
settings file. The test keeps its point: one Secret, never optional, and no
Numina or Stripe Secret in it.

Refs #302

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-runtime-projection-302 branch from 0deec24 to bb6c29d Compare November 15, 2026 17:42
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
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 Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The WebApp now receives a portal-settings projection argument and projects disclosure, portal settings, a client secret, and database CA material from business-site-runtime. The package checker and rendered-package tests enforce this input shape. Runtime fixtures and smoke tests cover missing disclosure and settings files, and test the serving image with the projected inputs. Documentation describes the Secret projection and its boundaries.

Possibly related issues

  • Issue 102 covers publishing the reviewed tenant deployment package. This PR changes the package’s projected Secret and input contract.

Possibly related PRs

Merge Risk: Low · up to bb6c2

This change switches the web app to read its portal inputs from a platform-managed Secret. If that Secret, with all four keys, is missing from the production namespace when this is applied, the web app pods cannot start and the public site goes down. Confirm the Secret is in place before merging; the code and tests otherwise look sound.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the tenant package now projects the platform-composed business-site-runtime Secret into the WebApp, which matches the deploy/webapp.yaml, validator, and test changes …
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.
Description check Passed The description is specific and related to the changeset. It states that the tenant package now projects the platform-composed business-site-runtime Secret instead of the disclosure-only Secret, with …
Full details: Title check

Explanation

The title states the main change: the tenant package now projects the platform-composed business-site-runtime Secret into the WebApp, which matches the deploy/webapp.yaml, validator, and test changes described in the summary and objectives.

Full details: Description check

Explanation

The description is specific and related to the changeset. It states that the tenant package now projects the platform-composed business-site-runtime Secret instead of the disclosure-only Secret, with four items and a new --portal-settings-projection argument. It also covers the validator, the Docker smoke test, the projection fixture, the deploy README and AGENTS.md updates, and the validation performed. It includes a merge precondition about the Secret existing in production and a rebase update.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 965c065c-dea2-4127-9f9a-4fb75c3c3942
Commits

Reviewing files that changed from the base of the PR and between 065f8db and bb6c29d.

Files selected for processing: 7

  • AGENTS.md
  • deploy/README.md
  • deploy/webapp.yaml
  • scripts/check-tenant-package.mjs
  • scripts/runtime-disclosure-fixture.mjs
  • scripts/tenant-package.test.mjs
  • scripts/tenant-runtime-smoke.test.mjs

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: 5

  • GitHub Check: build-docs
  • GitHub Check: test-portal-identity
  • GitHub Check: test-portal-quality
  • GitHub Check: CodeRabbit
  • GitHub Check: 🧹 Lint - mega-linter
Additional context used

Code guidelines: 1

deploy/README.md — auto-discovered
Path-based instructions: 1

Applicability reference: AGENTS.md: # AGENTS.md — business-site `deploy/` is the Kustomize package for the namespace-bound Platform WebApp contract; read `deploy/README.md` before changing it.

CodeRabbit inference engine (deploy/README.md)

Files:

  • deploy/README.md
  • deploy/webapp.yaml
Learnings: 1

Common learnings

Learnt from: CR
Repo: devantler-tech/business-site

Timestamp: 2026-11-15T17:44:02.850Z
Learning: Applicability reference:
docs/AGENTS.md: # AGENTS.md — contributor documentation
This directory contains contributor documentation, not the web application.
The root [`AGENTS.md`](../AGENTS.md) governs the application, build and publication.
[`README.md`](README.md) carries the editorial standard and feature-flag how-to.

Source excerpt:
# AGENTS.md — business-site

## Layout and ownership

- `deploy/` is the Kustomize package for the namespace-bound Platform WebApp contract;
  read `deploy/README.md` before changing it. One runtime serves `devantler.tech` (public pages)
  and `portal.devantler.tech` (the portal), routing by host so nothing appears twice, and it
  grants no portal activation. Platform hostname approval and registration remain separate.
  The source-owned runtime release/publisher callers are default-off behind the
  explicit `RUNTIME_PUBLICATION_ENABLED` repository variable. Original main-CI
  archive admission, the accepted original-image verifier and independent pair...
Additional comments: 2

deploy/webapp.yaml: 2

34-34: Stability & Availability

The comment does not identify a defect in the diff. It asks whether an external cluster prerequisite is in place. The repository already documents that prerequisite, and the PR states that merge depends on it. The static evidence does not show a missing item, an incorrect path, or a changed contract in deploy/webapp.yaml. The Secret's live state is outside the repository and is not a review finding.

31-32: Stability & Availability

The concern claims that applying this manifest with the baseline image can leave replacement Pods unable to start. The verified publication path replaces .spec.image with the admitted digest before the package is applied. The committed baseline is intentionally kept in source. The documented baseline-image smoke gap is a known state that the publication path closes, so this finding does not identify a defect in the diff.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Ready at bb6c29d19b122076e669948d5cab1a07c67d334f.

  • Review: the CodeRabbit summary verdict is GREEN for this head. No review threads are open.
  • CI: the CI run at this head (43742692254) succeeded, including CI - Required Checks. The cancelled run (43742635596) was superseded by it.
  • Effect: the tenant package projects only business-site-runtime, and scripts/tenant-package.test.mjs pins that. Nothing reaches visitors until a runtime release and the platform's re-pin. Portal sign-in stays off until monorepo#3939's checks pass.

@devantler
devantler marked this pull request as ready for review November 15, 2026 18:09
@devantler
devantler requested a review from a team as a code owner November 15, 2026 18:09
@devantler
devantler merged commit 37718cb into main Nov 15, 2026
46 of 53 checks passed
@devantler
devantler deleted the claude/portal-runtime-projection-302 branch November 15, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant