Repository navigation
Derive ReleaseNoteHeader featureName tests from the feature map - #5409
Merged
Merged
Conversation
Two ReleaseNoteHeader tests hard-coded a feature's release stage (serverlessWorkersCloudRun as Pre-release, cloudCli as Public Preview), so they broke whenever a feature changed stage. #5383 moved serverlessWorkersCloudRun to Public Preview and the override test started failing. Both tests now pick a feature from FEATURE_RELEASE_TYPES and read the expected label from RELEASE_NOTE_LABELS, which mdx-to-md.mjs now exports. The override test sets an explicit type that always differs from the mapped one. The self-closing test prefers a feature whose stage differs from the publicPreview default, so a broken lookup can't pass by falling through to the default.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview linksThis PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here. |
The paired-form featureName test used standaloneActivity, which #5290 removed from FEATURE_RELEASE_TYPES at GA. Since then the test has only exercised the publicPreview default, not the featureName lookup. It now shares a pickMappedFeature() helper with the self-closing test, which prefers a feature whose stage differs from the default.
flippedcoder
approved these changes
Oct 5, 2026
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
Review effort: Lite
Findings: 4
Open (4)
The “prefer non-default” logic only excludes the exact string"publicPreview", but the… · NewpickMappedFeature()can returnundefinedwhenFEATURE_RELEASE_TYPESis empty, which will… · NewpickMappedFeature()can returnundefinedwhenFEATURE_RELEASE_TYPESis empty, which will… · New The “prefer non-default” logic only excludes the exact string"publicPreview", but the… · New
What changed in this PR
Updates the MDX→Markdown transformer tests to assert ReleaseNoteHeader availability labels dynamically based on the feature release map, so tests remain valid as release stages evolve.
Changes:
- Exported
RELEASE_NOTE_LABELSfrom the transformer module for reuse in tests. - Updated ReleaseNoteHeader tests to derive
featureName/typeexpectations fromFEATURE_RELEASE_TYPESinstead of hard-coded values. - Added a helper to pick a mapped feature that avoids default release-stage fallthrough.
| File | Description |
|---|---|
| tests/test-mdx-to-md.mjs | Makes ReleaseNoteHeader tests resilient to release-stage mapping changes by deriving expectations from feature/type registries. |
| scripts/mdx-to-md.mjs | Exposes RELEASE_NOTE_LABELS so tests can assert the exact label text produced by the transformer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+754
to
+756
| function pickMappedFeature() { | ||
| const entries = Object.entries(FEATURE_RELEASE_TYPES); | ||
| return entries.find(([, type]) => type !== "publicPreview") ?? entries[0]; |
Comment on lines
+754
to
+760
| function pickMappedFeature() { | ||
| const entries = Object.entries(FEATURE_RELEASE_TYPES); | ||
| return entries.find(([, type]) => type !== "publicPreview") ?? entries[0]; | ||
| } | ||
|
|
||
| test("self-closing ReleaseNoteHeader resolves label from featureName", () => { | ||
| const input = `<ReleaseNoteHeader featureName="cloudCli" />\n\nCommand reference content.`; | ||
| const [featureName, mappedType] = pickMappedFeature(); |
|
|
||
| test("ReleaseNoteHeader resolves label from featureName in paired form", () => { | ||
| const input = `<ReleaseNoteHeader featureName="standaloneActivity">\nAvailable in preview.\n</ReleaseNoteHeader>`; | ||
| const [featureName, mappedType] = pickMappedFeature(); |
| test("ReleaseNoteHeader featureName overrides explicit type when mapped", () => { | ||
| const input = `<ReleaseNoteHeader featureName="serverlessWorkersCloudRun" type="publicPreview">\nBody.\n</ReleaseNoteHeader>`; | ||
| // Derived from the feature map so the test survives release-stage changes. | ||
| const [featureName, mappedType] = Object.entries(FEATURE_RELEASE_TYPES)[0]; |
Duncanma
enabled auto-merge (squash)
October 5, 2026 20:39
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
node tests/test-mdx-to-md.mjswas failing on "ReleaseNoteHeader featureName overrides explicit type when mapped". The test hard-codedserverlessWorkersCloudRunas Pre-release, and #5383 moved that feature to Public Preview.Two other
featureNametests had the same problem:cloudClias Public Preview, so it would break oncecloudCligoes GA.standaloneActivity, which standalone activities ga release #5290 removed from the map at GA. Since then it has only gotten thepublicPreviewdefault label, so it no longer tested the featureName lookup at all.All three tests now read their inputs from
FEATURE_RELEASE_TYPESinstead of naming a feature:typethat always differs from the mapped one, then checks that the mapped label appears and the explicit label doesn't.pickMappedFeature()helper that prefers a feature whose stage differs from thepublicPreviewdefault, so a broken lookup can't pass by falling through to the default.Expected label text comes from
RELEASE_NOTE_LABELS, whichscripts/mdx-to-md.mjsnow exports. The only change to that file is theexportkeyword. The feature map is unchanged.Testing
node tests/run-all.mjs: all suites passnode --test: 170 passed, 0 failedfeatureName: all three tests failed (before this PR, the paired-form test still passed), then restored the converter.