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

New Branch: Scan multibranch pipeline log #68

Merged
merged 3 commits into from
Aug 31, 2020

Conversation

ca-stefan-cordes
Copy link
Contributor

@ca-stefan-cordes ca-stefan-cordes commented Dec 6, 2019

The

 triggers{
    bitbucketPush()
  }

is useful for standalone jenkinsfile projects and single branches of a multibranch project,
but when having a

  • Multibranch Project

and pushing a new branch, the BitBucket WebTrigger is sending a push, but the
BitbucketJobProbe is checking for the update of "Job.class" only.

The "Scan Multibranch Pipeline Log" is not triggered (to find the new branch).
Workaround is to klick on "Scan Multibranch Pipeline Now" each time a new branch in created.

As this happens often when using git flow on that project I fixed the detection to search for all
"SCMSourceOwner.class" als well (which includes MultiBranchProject.class) where the URL is matching the configured one and then invoke "onSCMSourceUpdated".

As "SCMTriggerItem" has an SCM directly inside and the SCMSourceOwner just has a SCMSource I refactored the 2 "match" blocks to a method detecting the match based on the URIish.
(that's why it looks like to be more changes, but the block itself is unchanged)

ca-stefan-cordes added a commit to c-a-services/bitbucket-plugin that referenced this pull request Dec 6, 2019
@ghost
Copy link

ghost commented Apr 29, 2020

Hi @fbelzunc, you you look at this PR? Seems to be fixing current issues with new branch detection.

@miikeat
Copy link

miikeat commented May 25, 2020

In the meantime just use this Jenkins Plugin in addition: https://plugins.jenkins.io/multibranch-scan-webhook-trigger/

@tzachs
Copy link
Collaborator

tzachs commented Aug 8, 2020

@ca-stefan-cordes I'm sorry but the code base has changed due to update to version 2.204.1.
Is this PR still needed? If so, any chance to fork from the new code base and write the code there?

@ca-stefan-cordes
Copy link
Contributor Author

Yes, still needed.
I resetted to master and picked my "checking SCMSourceOwners/multiBranchProjects" change.

(scmSourceOwner.onSCMSourceUpdated is deprecated in the meanwhile but it is not clear for me whats the best way to trigger
jenkins.plugins.git.GitSCMSource.ListenerImpl and/or hudson.plugins.mercurial.MercurialStatus - looks like several matching methods can be removed from BitbucketJobProbe. And so I took the deprecated method)

@tzachs
Copy link
Collaborator

tzachs commented Aug 29, 2020

@ca-stefan-cordes I see there are failures on windows agent. Can you please check it?

@ca-stefan-cordes
Copy link
Contributor Author

[2020-08-30T17:33:26.147Z] [INFO] BUILD SUCCESS

[2020-08-30T17:33:26.147Z] [INFO] ------------------------------------------------------------------------

[2020-08-30T17:33:26.147Z] [INFO] Total time:  03:07 min

[2020-08-30T17:33:26.147Z] [INFO] Finished at: 2020-08-30T17:33:25Z

[2020-08-30T17:33:26.147Z] [INFO] ------------------------------------------------------------------------

But Sonar failed:
[2020-08-30T17:42:57.823Z] EC2 (aws) - Windows 2019 (i-02af6be8a34858876) was marked offline: Connection was broken: java.io.EOFException

@ca-stefan-cordes
Copy link
Contributor Author

I merged the master which triggered a new build an now all checks have passed.

@tzachs
Copy link
Collaborator

tzachs commented Aug 31, 2020

Thanks @ca-stefan-cordes , I'll try to merge it ASAP 😃

@tzachs tzachs merged commit 3990d45 into jenkinsci:master Aug 31, 2020
@tzachs
Copy link
Collaborator

tzachs commented Aug 31, 2020

@ca-stefan-cordes merged and should be available in v1.1.24

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

Successfully merging this pull request may close these issues.

3 participants