Skip to content

fix: make Release.devDependencies optional in upgrade command#3700

Merged
fredericoo merged 1 commit intomainfrom
fix/upgrade-test-devdeps
Apr 10, 2026
Merged

fix: make Release.devDependencies optional in upgrade command#3700
fredericoo merged 1 commit intomainfrom
fix/upgrade-test-devdeps

Conversation

@fredericoo
Copy link
Copy Markdown
Contributor

@fredericoo fredericoo commented Apr 10, 2026

Context

CI on main is failing — 2 unit tests in upgrade.test.ts break because when the 2026.4.0 changelog entry was initally added it didn’t have a devDependencies field.

CI run 24208645030 shows the failures.

Root Cause

The Release type declares devDependencies: Record<string, string> (required), but the 2026.4.0 entry in docs/changelog.json legitimately 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

  • Make devDependencies optional (?) in the Release type
  • Add ?? {} guards to 3 bare spread sites for consistency
  • Use optional chaining (?.) in test assertions
  • Add empty devDependencies: {} to the 2026.4.0 changelog entry for data consistency

Testing

  • fetchChangelog tests pass locally (2/2)
  • Zero new TypeScript errors (pnpm tsc --noEmit | grep devDependencies is empty)
  • CI unit tests pass

Risk Assessment

Low — the runtime code already treated devDependencies as optional via ?? {}. This just makes the type and tests honest about it.

@shopify
Copy link
Copy Markdown
Contributor

shopify bot commented Apr 10, 2026

Oxygen deployed a preview of your fix/upgrade-test-devdeps branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment April 10, 2026 3:09 PM

Learn more about Hydrogen's GitHub integration.

"dependencies": {
"@shopify/hydrogen": "2026.4.0"
},
"devDependencies": {},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is a bit over defensive but it doesnt hurt

@fredericoo fredericoo marked this pull request as ready for review April 10, 2026 15:05
@fredericoo fredericoo requested a review from a team as a code owner April 10, 2026 15:05
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>
@fredericoo fredericoo force-pushed the fix/upgrade-test-devdeps branch from fc34d9a to 68a18c8 Compare April 10, 2026 15:07
@github-actions
Copy link
Copy Markdown
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run pnpm run changeset add to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

@fredericoo fredericoo merged commit 43cdd3a into main Apr 10, 2026
22 of 23 checks passed
@fredericoo fredericoo deleted the fix/upgrade-test-devdeps branch April 10, 2026 16:01
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.

2 participants