Skip to content

Derive ReleaseNoteHeader featureName tests from the feature map - #5409

Merged
Duncanma merged 3 commits into
mainfrom
duncan/recursing-lehmann-90a309
Oct 5, 2026
Merged

Duncanma merged 3 commits into
mainfrom
duncan/recursing-lehmann-90a309

Conversation

@Duncanma

@Duncanma Duncanma commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

node tests/test-mdx-to-md.mjs was failing on "ReleaseNoteHeader featureName overrides explicit type when mapped". The test hard-coded serverlessWorkersCloudRun as Pre-release, and #5383 moved that feature to Public Preview.

Two other featureName tests had the same problem:

  • The self-closing test hard-coded cloudCli as Public Preview, so it would break once cloudCli goes GA.
  • The paired-form test used standaloneActivity, which standalone activities ga release #5290 removed from the map at GA. Since then it has only gotten the publicPreview default label, so it no longer tested the featureName lookup at all.

All three tests now read their inputs from FEATURE_RELEASE_TYPES instead of naming a feature:

  • Override test: takes a mapped feature and sets an explicit type that always differs from the mapped one, then checks that the mapped label appears and the explicit label doesn't.
  • Self-closing and paired-form tests: share a pickMappedFeature() helper that prefers a feature whose stage differs from the publicPreview default, so a broken lookup can't pass by falling through to the default.

Expected label text comes from RELEASE_NOTE_LABELS, which scripts/mdx-to-md.mjs now exports. The only change to that file is the export keyword. The feature map is unchanged.

Testing

  • node tests/run-all.mjs: all suites pass
  • node --test: 170 passed, 0 failed
  • Changed the converter temporarily so it ignored featureName: all three tests failed (before this PR, the paired-form test still passed), then restored the converter.

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.
@Duncanma
Duncanma requested a review from a team as a code owner October 5, 2026 18:55
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Oct 5, 2026 8:40pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

This 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.

Copilot AI left a comment

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.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

Review effort: Lite
Findings: 4 Medium severity

Open (4)
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_LABELS from the transformer module for reuse in tests.
  • Updated ReleaseNoteHeader tests to derive featureName/type expectations from FEATURE_RELEASE_TYPES instead 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 thread tests/test-mdx-to-md.mjs
Comment on lines +754 to +756
function pickMappedFeature() {
const entries = Object.entries(FEATURE_RELEASE_TYPES);
return entries.find(([, type]) => type !== "publicPreview") ?? entries[0];
Comment thread tests/test-mdx-to-md.mjs
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();
Comment thread tests/test-mdx-to-md.mjs

test("ReleaseNoteHeader resolves label from featureName in paired form", () => {
const input = `<ReleaseNoteHeader featureName="standaloneActivity">\nAvailable in preview.\n</ReleaseNoteHeader>`;
const [featureName, mappedType] = pickMappedFeature();
Comment thread tests/test-mdx-to-md.mjs
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
Duncanma enabled auto-merge (squash) October 5, 2026 20:39
@Duncanma
Duncanma merged commit 7c1742c into main Oct 5, 2026
9 of 10 checks passed
@Duncanma
Duncanma deleted the duncan/recursing-lehmann-90a309 branch October 5, 2026 20:40

This branch was successfully deployed

1 active deployment
Preview — 0b99ea52 Deployed Oct 5, 2026 by vercel[bot]
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.

3 participants