Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracks-release-branches won't track remote release branches without regex mod #3337

Closed
jjdenhup opened this issue Jan 9, 2023 · 3 comments · Fixed by #3415
Closed

tracks-release-branches won't track remote release branches without regex mod #3337

jjdenhup opened this issue Jan 9, 2023 · 3 comments · Fixed by #3415

Comments

@jjdenhup
Copy link

jjdenhup commented Jan 9, 2023

This may be working as intended, but does not seem to be desirable behavior to me.

With a release regex of regex: ^release-:
If I clone my repo, am on a branch that tracks-release-branches (develop below), and do not have my release branches local then the wrong version is reported until/unless I either I pull the latest release branch local or change my regex.

I can work around it with a regex of
regex: release-
but this feels wrong, as then release is valid anywhere in the branch name.

I am currently using this as my workaround, which is acceptable
regex: ^(origin/)?release-
and I can understand why this might be needed from a regex perspective, but it does not feel logical to me that it is from a usage perspective.

Is this workaround the correct fix, should this be fixed in the code, or am I missing something else?
Thanks!

GitVersion.yml:

develop:
    mode: ContinuousDeployment
    tag: aDevelop
    increment: None
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    regex: ^develop$
    source-branches:
    - develop
    - release
    tracks-release-branches: true
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 0
release:
    mode: ContinuousDeployment
    tag: bRelease
    increment: None
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: ^release-
    source-branches:
    - develop
    - release
    tracks-release-branches: false
    is-release-branch: true
    is-mainline: false
    pre-release-weight: 30000
@HHobeck
Copy link
Contributor

HHobeck commented Feb 21, 2023

If I see the following cod snippet I would say it is something the user should not be considering:

image

@asbjornu
Copy link
Member

Indeed, the fact that a branch exists only under the remote origin should be invisible to the user. GitVersion should treat origin branches as if they were local.

@arturcic
Copy link
Member

arturcic commented Mar 2, 2023

🎉 This issue has been resolved in version 6.0.0-beta.1 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants