Repository navigation
feat(tenancy): open multi-tenant startup only in a kye2e test build - #744
Yoshiofthewire wants to merge 2 commits into
Conversation
config.MultiTenantBuild comes from two build-tagged files: false in every release build, true only under -tags kye2e, the suite end-to-end run (KyCalendar multi-tenant e2e design, KyPost row). CheckEnv refuses multi unless it is set; BootstrapAdmin returns nil in that build (K6: no bootstrap administrator) and the backup commands keep refusing. The test build saves, discovers and loads only an https issuer under .test. scripts/check-test-build-tag.sh keeps the tag in the gate files and build tags out of every release path; scripts/check-release-image.sh fails on -tags=kye2e in the binary's build info or an image that starts in multi mode. Both run in CI, and the release check runs in publish-main.yml and release-image.yml before anything is pushed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process: ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪🧪 PR contains tests⚡ Recommended focus areas for reviewTagged-test failure This release-only assertion also runs with Advisory only: this comment never gates the pull request. |
Security review - clearedDetail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kypost-server-744, where it is readable by the operator and expires seven days after the last post. gpt-6.1-sol using security-audit on behalf of Yoshi |
Autonomous review - 1/1 personas cleared
Merging remains a human decision; this bot never approves. gpt-6.1-sol using security-audit on behalf of Yoshi |
|
Note 🤖 Claude Opus 5.5 responding on behalf of Yoshiofthewire Verification at head 18bdb95: the five packages kjob could not run (files outside |
The Dockerfile builds ./cmd/main.go as a file, so go version -m lists the module as dep; a package build lists it as mod. Accept either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Yoshiofthewire On the Guide's "Build-info mismatch" (#744 (comment)): the check matched the real image, but it now accepts both forms anyway, at 168074f.
|
In one line: Only a binary built with
-tags kye2e(the suite end-to-end run) passes KyPost's multi-tenant startup refusal; every release build and image still refuses, and CI now proves it.What changed
config.MultiTenantBuildis a constant from two build-tagged files:falsein every release build,trueonly under-tags kye2e. No environment value, flag or-ldflags -Xcan set it.CheckEnvrefusesmultiunless that constant is set.BootstrapAdminreturnsnil(writes nothing) formultiin the test build, since K6 has no bootstrap administrator. The backup commands refusemultiin every build.httpsissuer under.test. A stored real issuer reads as unconfigured.scripts/check-test-build-tag.sh(in ci-backend-checks) keeps the tag inside the gate files and keeps-tags/GOFLAGSout of the Dockerfile, Makefiles, compose files and release workflows. It also runs the tagged tests.scripts/check-release-image.shfails on-tags=kye2eingo version -m. It also starts the image twice with a multi-tenant environment (through the entrypoint and as--mode server) and expects the release refusal. It runs in ci-docker, and inpublish-main.ymlandrelease-image.ymlon a local build before the push.release-image.ymlruns it again on the pushed digest.Review this
.testissuer check inloadUnlockedandValidateIssuerURL. KyPost's issuer is runtime config (sso.json), not startup config, so the refusal lives here rather than at startup. That is a deliberate deviation from the design's "refuses to start".--network none, noKYPOST_DATABASE_URL), becausedbbackend.Checkconnects before any command. It matches the gate's own message, so no other refusal can pass for it.Checked
.testsuffix check-tagsin the Dockerfilekye2eimage fails on its tag;--mode server.scripts/check-test-build-tag.sh, gofmt, golangci-lint (untagged and--build-tags kye2e), deadcode, shellcheck andcheck-publish-main.pyare clean.go vet ./...andgo test -race ./...: all pass on the K host except packages needing files outsidebackend/, which kjob does not copy, and api, which hit the 10 m default timeout. Those are rerun in place on Major (see the comment below for the result).Not checked: PostgreSQL. The change touches no store and the constant is
falsein every PostgreSQL run; CI's PostgreSQL legs run it. The publish workflows' new steps run only on a real publish.You need to: nothing. Merge as usual. KyCalendar's e2e design row for KyPost can then say "gate built".
Detail
docs/superpowers/specs/2026-11-24-multi-tenant-e2e-design.md, Mechanism and the KyPost row. Reference PRs: KyCalendar chore(deps): bump pinned Ollama to 0.34.3 #220, KyMessages-Native fix: close seven hostile-review findings, chiefly the bypassable KDF ceiling #52.kye2egate as built (2026-11-25)"; root andscripts/AGENTS.md; CHANGELOG.TestCheckEnvRefusesMulti,TestBootstrapAdminRefusesMulti(new, also asserts nothing is written),TestCheckTestIssuer(new). Tagged:TestE2EBuildOpensMulti,TestE2EBuildBootstrapsNothingAndKeepsBackupsRefused,TestE2EBuildRefusesARealIssuer.kye2eimage with a full multi env, started on Major, got past bootstrap and then failed at the next K2 requirement ("table-mode documents require PostgreSQL"): the tag lifts only the gate.🤖 Generated with Claude Code