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

[Bug] Don't inherit semver on an Azure DevOps PullRequest #3180

Closed
enriqueraso opened this issue Aug 29, 2022 · 2 comments · Fixed by #3181
Closed

[Bug] Don't inherit semver on an Azure DevOps PullRequest #3180

enriqueraso opened this issue Aug 29, 2022 · 2 comments · Fixed by #3181
Labels
Milestone

Comments

@enriqueraso
Copy link
Contributor

enriqueraso commented Aug 29, 2022

Describe the bug
When creating a PullRequest on an Azure DevOps repository, no matter you autoincrement minor or patch based on your gitversion.xml configuration, it doesn't inherit from source branch on PullRequest completion.

Expected Behavior

It should works as in local, it inherits semver when you merge source branch to target branch configured to inherit. Although it doesn't work on local when you tried to simulate Azure DevOps environment.

Actual Behavior

When you merge source branch to target branch configured to inherit, it works on a merge but not in a PullRequest in Azure DevOps. Also it doesn't work reproducing an Azure DevOps environment locally.

Possible Fix

After debugged it, it only requires to detect PullRequest properly on a ReferenceName class.

Steps to Reproduce

GitVersion.Tool 5.10.3 installed on Azure DevOps.

image

Content of gitversion.xml

assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: '{InformationalVersion}'
mode: ContinuousDelivery
branches: 
  main:
    regex: ^main$
    tag: rc
    increment: None
    is-source-branch-for:
    - bug
    - feature
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: true
    pre-release-weight: 55000
  release:
    regex: ^releases[/-]
    tag: ''
    increment: Inherit
    source-branches:
    - main
    is-source-branch-for:
    - retrofit-bug
    - retrofit-feature
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: true
    is-mainline: true
    pre-release-weight: 55000
  pull-request:
    regex: ^pull[/-]
    tag: 'beta.{BranchName}'
    increment: Inherit
    source-branches:
    - retrofit-bug
    - retrofit-feature
    - bug
    - feature
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  retrofit-bug:
    regex: ^retrofit/bugs[/-]
    tag: beta.{BranchName}
    increment: Patch
    source-branches: 
    - release
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  retrofit-feature:
    regex: ^retrofit[/-]
    tag: beta.{BranchName}
    increment: Minor
    source-branches:
    - release
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  bug:
    regex: ^bugs[/-]
    tag: beta.{BranchName}
    increment: None
    source-branches:
    - main
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  feature:
    regex: ^(?!.*main)(?!.*releases)(?!.*pull)(?!.*retrofit)(?!.*bugs).*
    tag: beta.{BranchName}
    increment: None
    source-branches:
    - main
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
ignore:
  sha: []
merge-message-formats: {}

Results of a PullRequest completion that doesn't inherit incremented Patch.

image

Results of a PullRequest with the fix.

image

Context

Without this fix, we can not use GitVersion in Azure DevOps.

@arturcic arturcic modified the milestones: 6.x, 5.x Aug 29, 2022
@asbjornu
Copy link
Member

asbjornu commented Sep 2, 2022

Resolved in #3181.

@asbjornu asbjornu closed this as completed Sep 2, 2022
@arturcic arturcic modified the milestones: 5.x, 5.11.0 Nov 7, 2022
@arturcic
Copy link
Member

arturcic commented Nov 7, 2022

🎉 This issue has been resolved in version 5.11.0 🎉
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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants