Repository navigation
fix(composer): set version in composer.json and keep it in sync on release - #589
Merged
Merged
Conversation
…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>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
cblanc
approved these changes
Sep 4, 2026
Member
|
🎉 This PR is included in version 2.7.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Magento Marketplace upload fails with "The required fields: version are not set or empty in the composer.json file" —
composer.jsonhas had noversionfield since it was removed years ago, and although@semantic-release/gitalready listscomposer.jsonas a release asset, nothing ever wrote a version into it.composer.json:"version": "2.7.1"(current release).package.jsonrelease config: add@semantic-release/execwith aprepareCmdthat rewritescomposer.jsonwithversion: ${nextRelease.version}(placed right aftername), so eachchore(release)commit now updatescomposer.jsonalongsideCHANGELOG.md.Merging this as a
fixcommit will trigger release2.7.2, which is also the first real run of the new prepare step — worth checking that the release commit bumpscomposer.jsonto2.7.2.Verified locally: prepare command produces valid JSON with the version injected;
semantic-release --dry-runloads 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
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.