address build-info crash on non-ember-source tags#21304
Merged
NullVoxPopuli merged 1 commit intoemberjs:mainfrom Apr 8, 2026
Merged
address build-info crash on non-ember-source tags#21304NullVoxPopuli merged 1 commit intoemberjs:mainfrom
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
Conversation
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>
| if (tag) { | ||
| let tagVersion = parseTagVersion(tag); | ||
| let tagVersion = tag ? parseTagVersion(tag) : null; | ||
| if (tag && tagVersion) { |
Contributor
There was a problem hiding this comment.
when we publish non-ember-source tags, we'll treat the commit as "main" -- which is fine and low-stakes enough for perf check
Member
There was a problem hiding this comment.
Can we just make build not run at all on non-ember-source tags?
Contributor
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
we'll want to revert this commit I think -- but we're just testing things out
2140dff to
55a6d2a
Compare
Contributor
|
Failure is expected because the code on main doesn't have this fix |
kategengler
approved these changes
Apr 8, 2026
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
parseTagVersioninbroccoli/build-info.jsto returnnullinstead of crashing when the git tag isn't a valid ember-source version (e.g.v2.1.1-@glimmer/component)buildFromPartsto fall through to the channel build path whenparseTagVersionreturnsnull, so non-ember-source tags are treated the same as untagged commits@glimmer/componenttag pattern in bothparseTagVersionandbuildFromPartsbroccoli/build-info.jsinto the perf benchmark's control clone so the CI doesn't fail due to the control checkout still having the buggy version from mainContext
The "Perf script still works" CI job fails because
origin/mainnow points at a commit taggedv2.1.1-@glimmer/component. Thegit-repo-infolibrary returns this tag, andparseTagVersioncrashes whensemver.parse()returnsnullfor it:The perf CI clones origin/main into a control directory and runs
build-for-publishing.jsthere, so even after fixingbroccoli/build-info.jsin 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
parseTagVersiontests still passparseTagVersionreturnsnullforv2.1.1-@glimmer/componentparseTagVersionreturnsnullfor arbitrary non-semver tagsbuildFromPartstreats a non-ember-source tag as a channel build🤖 Generated with Claude Code