Repository navigation
ci: the Lab lane counts Lab samples and a Lab component's spec folder as Lab, runs lab:sync --check, and checks the route lock when a Lab doc changes #13023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ci/lab-sync
Are you sure you want to change the base?
Changes from all commits
37e9b9e
293db3e
887230f
29ea621
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,10 @@ const OFFICIAL_PACKAGES = 'packages/cli/assets/discover/official-packages.json'; | |
| const LAB_STORY = | ||
| /^apps\/storybook\/stories\/([A-Z][A-Za-z0-9]*)\.stories\.tsx$/; | ||
| const LAB_COMPONENT_DIR = /^packages\/lab\/src\/([A-Z][A-Za-z0-9]*)\//; | ||
| // The swizzle proof's Lab samples, which `pnpm lab:sync` writes. | ||
| const LAB_SAMPLES = 'packages/lab/swizzle-samples.mjs'; | ||
| // A Lab component's own spec records. | ||
| const LAB_SPEC_DIR = /^docs\/specs\/components\/([A-Z][A-Za-z0-9]*)\//; | ||
|
|
||
| // The registry's route slug for a component name. It mirrors | ||
| // slugifyRegistryName in apps/docsite/src/lib/shadcnRegistry.mjs (a test pins | ||
|
|
@@ -165,6 +169,9 @@ function isLabEntryChange(change, {names, patches, officialPackagesBase}) { | |
| ) | ||
| return false; | ||
| const slugs = new Set([...names].map(labRouteSlug)); | ||
| if (change.filename === LAB_SAMPLES) return true; | ||
| const spec = LAB_SPEC_DIR.exec(change.filename); | ||
| if (spec) return names.has(spec[1]); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This matches by folder name only. Lab's |
||
| if (change.filename === ROUTES_LOCK) | ||
| return routesLockNamesLabOnly(patch, slugs); | ||
| if (change.filename === OFFICIAL_PACKAGES) | ||
|
|
@@ -576,6 +583,7 @@ if (require.main === module) { | |
|
|
||
| module.exports = { | ||
| LAB_ROOT, | ||
| LAB_SAMPLES, | ||
| OFFICIAL_PACKAGES, | ||
| ROUTES_LOCK, | ||
| NODE_TOOLING_PATHS, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI never reaches this line for the samples file or a record folder. The guard above refuses a file with no patch, and
.github/actions/test-scope/action.ymlpasses patches only for the route lock,official-packages.jsonand stories (LAB_ENTRY), so in CI the new Rating fixture still classifies as mixed with the full suite. Decide these two entries by path before the patch guard (keeping the rename refusal), and add an end-to-end case totest-scope-action.test.mjs.