Skip to content

fix(composer): set version in composer.json and keep it in sync on release - #589

Merged
cblanc merged 1 commit into
mainfrom
devin/1788515958-composer-version
Sep 4, 2026
Merged

cblanc merged 1 commit into
mainfrom
devin/1788515958-composer-version

Conversation

@mfilip

@mfilip mfilip commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Magento Marketplace upload fails with "The required fields: version are not set or empty in the composer.json file" — composer.json has had no version field since it was removed years ago, and although @semantic-release/git already lists composer.json as a release asset, nothing ever wrote a version into it.

  • composer.json: "version": "2.7.1" (current release).
  • package.json release config: add @semantic-release/exec with a prepareCmd that rewrites composer.json with version: ${nextRelease.version} (placed right after name), so each chore(release) commit now updates composer.json alongside CHANGELOG.md.

Merging this as a fix commit will trigger release 2.7.2, which is also the first real run of the new prepare step — worth checking that the release commit bumps composer.json to 2.7.2.

Verified locally: prepare command produces valid JSON with the version injected; semantic-release --dry-run loads the exec plugin without errors.

Link to Devin session: https://app.devin.ai/sessions/9a154894a27f4ac3852af2991b45d8d9
Open in Devin Desktop: https://app.devin.ai/desktop/session/9a154894a27f4ac3852af2991b45d8d9?variant=devin
Requested by: @mfilip


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…lease

Magento Marketplace rejects the archive because composer.json has no
"version" field. Set it to the current release and have semantic-release
write the next version into composer.json (via @semantic-release/exec)
before @semantic-release/git commits it alongside CHANGELOG.md.

Co-Authored-By: Marcin Filip <marcin.filip@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@mfilip
mfilip requested a review from cblanc September 4, 2026 12:27
@cblanc
cblanc merged commit f4eb964 into main Sep 4, 2026
4 checks passed
@idealbot

idealbot commented Sep 4, 2026

Copy link
Copy Markdown
Member

🎉 This PR is included in version 2.7.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants