Skip to content

fix(cli): add feature multitenancy keeps the app's own smoke test passing - #261

Open
omercelikdev wants to merge 1 commit into
mainfrom
fix/add-feature-multitenancy-smoke
Open

omercelikdev wants to merge 1 commit into
mainfrom
fix/add-feature-multitenancy-smoke

Conversation

@omercelikdev

Copy link
Copy Markdown
Collaborator

What broke

With #258#260 in, the nightly GmGrownRest shape builds and passes spec-lint — and fails its container smoke:

Assert.Equal() Failure: Values differ
Expected: Unauthorized
Actual:   BadRequest

Tenancy is fail-closed: UseGoldpathMultiTenancy refuses a request without X-Goldpath-Tenant with 400, and it runs before auth. The template's smoke sends the header under UseMultiTenancy; goldpath add feature multitenancy never touched the smoke, so a grown app's own smoke test failed. GmGrownRest is the only shape that grows multitenancy through the CLI, and it had never reached its smoke before (restore, then GP1001, stopped it first). The published preview.8 CLI has the same gap.

The fix

Same principle as #260 — the recipe does to template-owned code exactly what the template does:

  • the template's line after app.CreateHttpClient("api"); (a parity test reads it from the template),
  • using Goldpath; in the smoke and Goldpath.Abstractions in the smoke project,
  • a smoke that already sends the header is left alone; an app without the smoke is unaffected; an engine refusal restores both files.

Proof

  • Test-first: 2 of 5 new tests red before the fix (the other three are guards). 423/423 CLI tests green after, format clean, all five repo gates green.
  • The container smoke cannot run on the maintainer's machine today (Docker is down), so the proof is the nightly dispatched on this branch, which carries all four fixes.

Stacking

On top of #260 (which is on #258 + #259). Merge order: #258, #259, #260, this. None merges until the GM matrix is green with all four (ADR-0008).

Docs: docs/upgrades/0.1.0-preview.9.md (new section with the preview.8 hand fix), docs/guide/cli-reference.md.

🤖 Generated with Claude Code

@omercelikdev
omercelikdev force-pushed the fix/add-feature-multitenancy-smoke branch from e433ea0 to 601e70b Compare September 15, 2026 06:26
…sing

Tenancy is fail-closed: a request without the tenant header is refused with
400 before authentication runs. The template's smoke sends the header under
UseMultiTenancy; the recipe left the smoke alone, so an app grown with the
verb failed its own smoke (an authed shape expecting 401 got 400). Found by
the nightly GmGrownRest shape the first time it reached its smoke.

The recipe now adds the template's line after the smoke's client, with
`using Goldpath;` and a Goldpath.Abstractions reference in the smoke
project. A smoke that already sends the header is left alone; an engine
refusal restores both files.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@omercelikdev
omercelikdev force-pushed the fix/add-feature-multitenancy-smoke branch from 601e70b to 4ccf62f Compare September 15, 2026 06:39
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