Skip to content

Add release_version_file option to save the deployed tag - #4270

Open
adpeyre wants to merge 1 commit into
deployphp:masterfrom
adpeyre:feature/release-version
Open

adpeyre wants to merge 1 commit into
deployphp:masterfrom
adpeyre:feature/release-version

Conversation

@adpeyre

@adpeyre adpeyre commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Add release_version_file option to save the deployed tag

Description :

  • Bug fix #…?
  • New feature?
  • BC breaks?
  • Tests added?
  • Docs added?

Why

REVISION always holds the commit hash. Applications often need a human-readable version (the git tag when one is deployed) to display it or to report it to an error tracker. Doing it from a project recipe is fragile: the recipe has to compute the version itself, usually on the local checkout, which may differ from what deploy:update_code actually deployed (archive and clone strategies use the remote mirror).

What

New option release_version_file (disabled by default). When set, deploy:update_code saves the version of the deployed target in {{release_path}}/{{release_version_file}}, computed where the revision is already computed (remote mirror or local checkout depending on the strategy):

set('release_version_file', 'VERSION');
  • release_version_command computes the version. Default: the tag pointing exactly at {{target}}, or its commit hash if there is none.
  • release_version reads it back, like release_revision.
  • The Sentry recipe uses this file as default release version when it exists, so the release created in Sentry matches the version reported by the application. git_version_command still takes precedence. Commit tracking keeps using REVISION.

REVISION is unchanged, so deploy:check_remote, releases and the Sentry commits range keep working with a commit hash.

@adpeyre
adpeyre force-pushed the feature/release-version branch from d884a60 to 3cb4a4f Compare October 30, 2026 12:33
When set, `deploy:update_code` saves a human-readable version of the
deployed target in this file, computed by `git describe --tags --always`:
the tag pointing at it, the latest tag followed by the number of commits
since and the abbreviated hash, or the abbreviated hash if there is no tag.
`REVISION` still holds the full commit hash.

The Sentry recipe uses this file as default release version.
@adpeyre
adpeyre force-pushed the feature/release-version branch from 3cb4a4f to dacae10 Compare October 30, 2026 13:07

This branch has not been deployed

No deployments
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