Build trigger on tag creation on specific branch does not always trigger (OD-2259)
jbauer opened 12 months ago

I have a release build defined that executes on branches release/* once a tag has been created. It generally works but there is a little quirk in OneDev that I sometimes run into. I use semantic versioning and thus new branches will be created whenever the minor or major version number changes. So the branches are named release/1.1.x for example.

Whenever I create a new release that requires a new branch I usually create that branch locally and add a tag. Then I have two choices:

  1. Push the new branch and the new tag in the same git operation
  2. First push the branch without tag and then push the tag in two separate git operations

The release build only triggers if I do the second approach but sometimes I forget about this quirk and use the first approach and then wondering why no build has occurred.

Maybe there is a way to detect the first approach and execute the build if trigger When create tags on branches 'release/*' is used.

  • Robin Shen commented 12 months ago

    I am pushing branch and tag in a single operation and build is fired as expected:

    git checkout -b release/1.1.x
    touch newfile
    git add newfile
    git commit -m "new commit"
    git tag v1.1.0
    git push origin v1.1.0:v1.1.0 release/1.1.x:release/1.1.x
    
  • jbauer commented 12 months ago

    Ok sorry. I checked the workflow again and I missed some critical detail. I sometimes push the tag without the release branch being pushed first.

    I use a UI app, either SourceTree or Fork (both macOS), and when you create a tag the dialog window has a checkbox to push the tag. So the order is

    1. create branch release/1.0.x
    2. create tag 1.0.0 but forgot to uncheck the "push tag" checkbox. OneDev will receive the tag but doesn't know the branch yet
    3. push the release/1.0.x branch. The UI app has a dialog window with a checkbox "push all tags" which is always checked. So in this step OneDev will receive the new release branch and the already known tag 1.0.0

    So in step 2 OneDev doesn't know the release branch and in step 3 the tag 1.0.0 isn't new/created. Thus no build is triggered. Logical but unfortunate.

    Maybe OneDev can recognize step 3? E.g. if the branch is new and the tag isn't new but the tag is on that newly created branch, then trigger the build as well?

  • Robin Shen changed state to 'Closed' 12 months ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 12 months ago

    For the second push of the tag, since the tag already exists, and associated commit is not changing, git hooks will not be triggered and hence build will not be triggered.

issue 1/1
Type
Bug
Priority
Minor
Assignee
Affected Versions
11.6.3
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2259
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover