Skip to content

Feature/use git tag as version#875

Open
MarcoSpittka wants to merge 2 commits intoshopware:mainfrom
MarcoSpittka:feature/use-git-tag-as-version
Open

Feature/use git tag as version#875
MarcoSpittka wants to merge 2 commits intoshopware:mainfrom
MarcoSpittka:feature/use-git-tag-as-version

Conversation

@MarcoSpittka
Copy link

Problem

Many Shopware plugins are developed without a version field in composer.json — the version is managed exclusively through git tags. When running extension zip, the detected git tag is already used to name the resulting zip file (e.g. MyPlugin-1.1.0.zip), but it is never written into composer.json or manifest.xml. This means the packaged extension carries no version metadata internally, which can cause issues with version validation and upload workflows.

Solution

A new flag --use-git-tag-as-version is introduced for the extension zip command. When set, the git tag detected during packaging is automatically written as the version into:

  • composer.json for Platform Plugins and Shopware Bundles
  • manifest.xml for Shopware Apps
    The existing BuildModifier infrastructure already handles this write — the flag simply wires the detected tag into it.
    Git tags using the common v-prefix convention (e.g. v1.1.0) are handled correctly: the prefix is stripped before writing,
    resulting in a plain semver string (1.1.0) in the metadata file.

Constraints

The flag is mutually exclusive with:

  • --disable-git — without git, no tag can be detected, so the flag has no meaningful value
  • --overwrite-version — both flags set the version; combining them would be ambiguous

Unchanged behavior

The existing --overwrite-version flag continues to work as before and takes precedence if used directly.

MarcoSpittka and others added 2 commits February 26, 2026 09:18
Allows automatically writing the detected git tag into composer.json
(plugins) or manifest.xml (apps) during zip creation, without requiring
an explicit --overwrite-version value.

The flag is mutually exclusive with --disable-git (no tag available)
and --overwrite-version (conflicting version sources).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ag-as-version

Git tags often use the 'v' prefix convention (e.g. v1.1.0), but
composer.json and manifest.xml expect a plain semver string (1.1.0).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant