Skip to content

[JENKINS-57516] - Support tag creation on tag push #230

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

Merged
merged 1 commit into from
Sep 26, 2019

Conversation

sheldonrong
Copy link
Contributor

@sheldonrong sheldonrong commented Sep 22, 2019

Able to detect a tag creation from the Bitbucket PushHead Event and automatically create tags in Jenkins. This allows the workflow to build projects when tagging and/or pushing a commit.

This changeset adds a tag detection branch logic in the NativeServerPushHookProcessor.HeadEvent's heads function.

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

@sheldonrong
Copy link
Contributor Author

Setup Bitbucket server and jenkins server using docker container, and is able to verify that the tags can be instantly created once dev ran git push --tags using their git command line inside a repo.

@jetersen
Copy link
Member

@sheldonrong
Copy link
Contributor Author

@Casz Thanks for reminding, updated the commit, and should be good now :)

@sheldonrong
Copy link
Contributor Author

@Casz looks like the continuous-integration/jenkins/pr-merge is stuck :)

@sheldonrong
Copy link
Contributor Author

@Casz any updates on this one?

@mortenkri
Copy link

mortenkri commented Sep 26, 2019

Great if someone could push this forward. This is the only feature missing for us in our current CI/CD pipeline :)

@jetersen jetersen changed the title JENKINS-57516: Support tag creation on tag push only [JENKINS-57516] - Support tag creation on tag push only Sep 26, 2019
@jetersen jetersen changed the title [JENKINS-57516] - Support tag creation on tag push only [JENKINS-57516] - Support tag creation on tag push Sep 26, 2019
@jetersen jetersen merged commit 2379502 into jenkinsci:master Sep 26, 2019
@mortenkri
Copy link

Thx Joseph. Will test it as soon as I can :)

@@ -137,23 +138,29 @@ protected BitbucketServerRepository getRepository() {
return result;
}

private void addBranches(BitbucketSCMSource src, Map<SCMHead, SCMRevision> result) {
private void addBranchesAndTags(BitbucketSCMSource src, Map<SCMHead, SCMRevision> result) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test covering this new logic would be more than welcome.

@mortenkri
Copy link

Thx Joseph. Will test it as soon as I can :)

Verified that this works. Thanks a lot. Hopefully I can provide a PR for tag delete events :)

@sheldonrong sheldonrong deleted the feature/JENKINS-57516 branch September 26, 2019 22:48
@ruhrohraggy
Copy link

Hoping someone can see this and respond -- it seems like this fixed an issue where once the Webhook was setup in Bitbucket to notify on Tag Created events, this was needed to process the event notification... Am I missing something, or is there still not logic to automatically include Tag Created as an option when automatically registering the webhook when the job is created...

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 this pull request may close these issues.

5 participants