devops.release.version
Resolve the release version from the release branch or hotfix PR title.
Functions
|
Fail unless the version is |
|
Return the release tag for a release or hotfix pull request. |
- devops.release.version.check_version_format(version, config)[source]
Fail unless the version is
<prefix>X.Y.Z.- Parameters:
- Raises:
ReleaseError – If the version does not use the configured format.
- Return type:
None
- devops.release.version.resolve_version(head_ref, title, *, prepare, config)[source]
Return the release tag for a release or hotfix pull request.
A release branch is
release/<prefix>X.Y.Zand its PR title must beRelease-X.Y.Z. A hotfix branch ishotfix/<name>and its PR title must start withHotfix-X.Y.Z.- Parameters:
head_ref (str) – The source branch of the pull request.
title (str | None) – The pull request title. None skips the release title check.
prepare (bool) – Also check that the tag is new and that a hotfix follows the latest tag. Use it before the release; leave it off after the merge.
config (GitConfig) – The Git configuration with the tag prefix.
- Returns:
str – The release tag, for example
v1.2.3.- Raises:
ReleaseError – If the branch, title or version is not valid for a release.
- Return type: