Skip to content

Test the bucket header's beta gate - #5246

Open
QuiltSimon wants to merge 2 commits into
masterfrom
test/bucket-gate-and-collector
Open

Test the bucket header's beta gate#5246
QuiltSimon wants to merge 2 commits into
masterfrom
test/bucket-gate-and-collector

Conversation

@QuiltSimon

@QuiltSimon QuiltSimon commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The catalog shell moved the bucket name into a header card gated behind settings?.beta, so on a default stack the Packages and Workflows tabs name the bucket nowhere. #5235 fixes that — but every test in it exercises Header directly. None exercises BucketLayout's gate, which is the line that actually regressed.

This adds that test. There is no Bucket.spec.tsx; the template followed is Overview/index.spec.tsx, which mocks utils/CatalogSettings with a mutable settings object and asserts the beta/non-beta/null branches.

Written against master's shape, not #5235's

#5235 is still open, so this branches off master and targets the gate master actually has (the whole header card behind beta). Consequence: "beta off → bucket name present" is false today — that is the bug — so those two assertions are written as it.fails, following the Routes.spec.ts precedent already in this repo.

When #5235 lands, those two flip to plain it. The spec says so in a comment, and the transition was verified in both directions:

The four stats-gate assertions (beta on → stats present; beta off and null → stats absent) stay green under both shapes, so they pin the surviving half of the gate under either spelling.

If you'd rather this land only after #5235, it rebases to a two-line change.

Harness notes

BucketLayout is not exported, so the spec renders the default Bucket export inside MemoryRouter + a Route path="/b/:bucket" (what feeds useBucketStrict). Two things keep it fast: components/Layout is mocked down to its pre slot, and every route path in the NamedRoutes stub is set to an unreachable /never/* so the Switch lands on the catch-all and no RT.mkLazy chunk is ever imported. useBucketExistence is mocked to its tagged-union shape.

  • TZ=UTC npx vitest run app/containers/Bucket — 350 passed / 49 files (was 344 / 48)
  • Bucket.spec.tsx alone: 39ms, well inside the 5s budget
  • npx tsc --noEmit -p . and npx oxfmt --check — clean

Also verified the it.fails cases fail on the assertion rather than a broken harness: flipping one to plain it gives AssertionError: expected null to be truthy, so the harness mounts and queryByText genuinely returns null.

🤖 Generated with Claude Code

Greptile Summary

This PR adds coverage for the bucket header’s beta and missing-settings branches, including expected-failure assertions that document the existing bucket-name regression.

  • Adds a routed Bucket test harness with focused mocks for layout, settings, preferences, stats, and lazy routes.
  • Covers bucket-name and stats visibility with beta enabled, disabled, and settings absent.
  • Adds a Catalog changelog entry for the new coverage.

Confidence Score: 4/5

The PR appears safe to merge after replacing the malformed changelog pull-request placeholder.

The test harness matches the currently exercised Bucket and Header contracts, while the only accepted issue is a broken changelog label and link.

Files Needing Attention: catalog/CHANGELOG.md

Important Files Changed

Filename Overview
catalog/app/containers/Bucket/Bucket.spec.tsx Adds focused coverage of the Bucket-level beta gate; the expected-failure cases intentionally record the known non-beta bucket-name defect.
catalog/CHANGELOG.md Documents the added coverage, but leaves the pull-request number and URL as unresolved placeholders.

Reviews (1): Last reviewed commit: "Test the bucket header card's beta gate ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Header.spec covers the Header component; nothing covered BucketLayout's
`settings?.beta` gate, which is the line that drops the bucket name from
the Packages and Workflows tabs on a default stack.

The two bucket-name-when-beta-off cases are `it.fails`: they assert the
desired behavior against the current gate, so they flip red once the gate
narrows to stats only (#5235).
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.05%. Comparing base (fe9bda5) to head (526834c).

❗ There is a different number of reports uploaded between BASE (fe9bda5) and HEAD (526834c). Click for more details.

HEAD has 25 uploads less than BASE
Flag BASE (fe9bda5) HEAD (526834c)
lambda 14 0
py-shared 1 0
api-python 10 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5246       +/-   ##
===========================================
- Coverage   55.20%   35.05%   -20.16%     
===========================================
  Files         872      741      -131     
  Lines       36766    23803    -12963     
  Branches     6429     6429               
===========================================
- Hits        20298     8344    -11954     
+ Misses      14724    13715     -1009     
  Partials     1744     1744               
Flag Coverage Δ
api-python ?
catalog 35.05% <ø> (+0.12%) ⬆️
lambda ?
py-shared ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread catalog/CHANGELOG.md Outdated

## Changes

- [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#PRNUM](https://github.com/quiltdata/quilt/pull/PRNUM))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unresolved PR placeholder

The new entry displays #PRNUM and links to /pull/PRNUM, leaving readers with a broken changelog link instead of PR #5246.

Suggested change
- [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#PRNUM](https://github.com/quiltdata/quilt/pull/PRNUM))
- [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#5246](https://github.com/quiltdata/quilt/pull/5246))

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

2 participants