Skip to content

address build-info crash on non-ember-source tags#21304

Merged
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:fix-build-info-non-ember-tags
Apr 8, 2026
Merged

address build-info crash on non-ember-source tags#21304
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:fix-build-info-non-ember-tags

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown
Contributor

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent commented Apr 7, 2026

Summary

  • Fix parseTagVersion in broccoli/build-info.js to return null instead of crashing when the git tag isn't a valid ember-source version (e.g. v2.1.1-@glimmer/component)
  • Update buildFromParts to fall through to the channel build path when parseTagVersion returns null, so non-ember-source tags are treated the same as untagged commits
  • Add tests for the @glimmer/component tag pattern in both parseTagVersion and buildFromParts
  • Copy the fixed broccoli/build-info.js into the perf benchmark's control clone so the CI doesn't fail due to the control checkout still having the buggy version from main

Context

The "Perf script still works" CI job fails because origin/main now points at a commit tagged v2.1.1-@glimmer/component. The git-repo-info library returns this tag, and parseTagVersion crashes when semver.parse() returns null for it:

TypeError: Cannot read properties of null (reading 'version')
    at parseTagVersion (broccoli/build-info.js:129)

The perf CI clones origin/main into a control directory and runs build-for-publishing.js there, so even after fixing broccoli/build-info.js in this PR, the control clone still has the buggy version. The second commit fixes this chicken-and-egg problem by copying the fixed build-info.js into the control clone after checkout.

Test plan

  • Existing parseTagVersion tests still pass
  • New test: parseTagVersion returns null for v2.1.1-@glimmer/component
  • New test: parseTagVersion returns null for arbitrary non-semver tags
  • New test: buildFromParts treats a non-ember-source tag as a channel build
  • ESLint passes on changed files
  • Perf CI should now pass since the control clone gets the fixed build-info.js

🤖 Generated with Claude Code

When a commit is tagged for another package (e.g. `v2.1.1-@glimmer/component`),
`parseTagVersion` would crash because `semver.parse()` returns null for tags
that aren't valid semver after stripping the `-ember-source` suffix.

This fixes `parseTagVersion` to return null for unrecognized tags, and updates
`buildFromParts` to fall through to the channel build path when the tag isn't
a recognized ember-source version tag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread broccoli/build-info.js
if (tag) {
let tagVersion = parseTagVersion(tag);
let tagVersion = tag ? parseTagVersion(tag) : null;
if (tag && tagVersion) {
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.

when we publish non-ember-source tags, we'll treat the commit as "main" -- which is fine and low-stakes enough for perf check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we just make build not run at all on non-ember-source tags?

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.

the git-repo-info dependency includes a tag for whatever commit happens to match main / current sha / most recent tag, iirc.

we probably don't need to use git-repo-info tbh. but I'd prefer to swap that out separately

@NullVoxPopuli NullVoxPopuli changed the title Fix build-info crash on non-ember-source tags address build-info crash on non-ember-source tags Apr 7, 2026
Comment thread bin/benchmark/control.mjs
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.

we'll want to revert this commit I think -- but we're just testing things out

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the fix-build-info-non-ember-tags branch from 2140dff to 55a6d2a Compare April 7, 2026 20:51
@NullVoxPopuli
Copy link
Copy Markdown
Contributor

Failure is expected because the code on main doesn't have this fix

@NullVoxPopuli NullVoxPopuli merged commit b6282e9 into emberjs:main Apr 8, 2026
75 of 78 checks passed
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