fix: make Release.devDependencies optional in upgrade command#3700
Merged
fredericoo merged 1 commit intomainfrom Apr 10, 2026
Merged
fix: make Release.devDependencies optional in upgrade command#3700fredericoo merged 1 commit intomainfrom
fredericoo merged 1 commit intomainfrom
Conversation
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
fredericoo
commented
Apr 10, 2026
docs/changelog.json
Outdated
| "dependencies": { | ||
| "@shopify/hydrogen": "2026.4.0" | ||
| }, | ||
| "devDependencies": {}, |
Contributor
Author
There was a problem hiding this comment.
this is a bit over defensive but it doesnt hurt
The 2026.4.0 changelog entry was added without a devDependencies field,
which caused 2 fetchChangelog tests to fail because the Release type
declared devDependencies as required. The runtime code already handled
this gracefully with ?? {} patterns — the type and tests just didn't
reflect reality.
- Make devDependencies optional in the Release type
- Add ?? {} guards to 3 spread sites for consistency (lines 302, 449, 886)
- Use optional chaining in test assertions for devDependencies access
- Add empty devDependencies to 2026.4.0 changelog entry for data consistency
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fc34d9a to
68a18c8
Compare
Contributor
|
We detected some changes in |
kdaviduik
approved these changes
Apr 10, 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.
Context
CI on main is failing — 2 unit tests in
upgrade.test.tsbreak because when the 2026.4.0 changelog entry was initally added it didn’t have adevDependenciesfield.CI run 24208645030 shows the failures.
Root Cause
The
Releasetype declaresdevDependencies: Record<string, string>(required), but the 2026.4.0 entry indocs/changelog.jsonlegitimately omits it — no dev deps changed in this release. The runtime code already handled this with?? {}patterns; only the type and tests were wrong.Solution
devDependenciesoptional (?) in theReleasetype?? {}guards to 3 bare spread sites for consistency?.) in test assertionsdevDependencies: {}to the 2026.4.0 changelog entry for data consistencyTesting
fetchChangelogtests pass locally (2/2)pnpm tsc --noEmit | grep devDependenciesis empty)Risk Assessment
Low — the runtime code already treated
devDependenciesas optional via?? {}. This just makes the type and tests honest about it.