Giter VIP home page Giter VIP logo

bbprb's People

Contributors

atsushi-ageet avatar b-studios avatar dahlgren avatar damovsky avatar elifarley avatar exi avatar fonsecas72 avatar frodeaa avatar gazal-k avatar ip1981 avatar jf-unsilo avatar limonte avatar maxvodo avatar mgrebenets-fairfax avatar michaeljb avatar nblair avatar nfalco79 avatar nishio-dens avatar nwoolls avatar page- avatar rojepp avatar technocoreai avatar tkelley-eg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bbprb's Issues

does not work well with forks

I am trying to use this with the following setup:

  • teamOwner/repository-foobar
  • user/repository-foobar (fork of teamOwner/repository-foobar)
  • PR is created from a branch on user against teamOwner/repository-foobar

This does work with the "cron bitbucket jenkins plugin". However with bbprb, it only works if I set the repository url within jenkins to the following:

[email protected]:${bbprbSourceRepository}.git

however, internally the plugin will still try to use dest* for the build-status, which will not work because the dest does not have the commit-hash of the src.

E.g. builds work, but build-status api does not work.

Travis integration

would be nice if this had travis integration for reliability reasons...

trigger on comments

it would be great if it could support the PR-comment trigger as well, that way a manual trigger can be done when posting a comment "please build" (configurable) in the PR.

NPE in abortRunningJobsThatMatch

Hi, love the plugin, it's awesome. Thank you.

I am running BBPRB v.0.3.0 on Jenkins v.2.121.2.

I recently converted a job from a normal build to a pipeline workflow - it allows easier access to doing programmatic search for ambiguously defined dependencies (sigh). Ie I can search other builds to find products of a similarly named branch in a separate repo.

Unfortunately now when I do this I now get stack traces in my jenkins backend when the job should be triggered:

WARNING: Error while serving https://jenkins.protmv.com/bbprb-hook/
java.lang.reflect.InvocationTargetException
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:347)
[...]
Caused by: java.lang.NullPointerException
	at org.jenkinsci.plugins.bbprb.BitbucketBuildTrigger.abortRunningJobsThatMatch(BitbucketBuildTrigger.java:214)
	at org.jenkinsci.plugins.bbprb.BitbucketBuildTrigger.startJob(BitbucketBuildTrigger.java:156)
	at org.jenkinsci.plugins.bbprb.BitbucketBuildTrigger.handlePR(BitbucketBuildTrigger.java:282)
	at org.jenkinsci.plugins.bbprb.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:108)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
[...]

Looking at the code there (Note, I've added the WARNING logging):

  private void
  abortRunningJobsThatMatch(@Nonnull BitbucketCause bitbucketCause) {
    logger.log(Level.FINE, "Looking for running jobs that match PR #{0}",
               bitbucketCause.getPullRequestId());
\\    logger.log(Level.WARNING, "job: " + (job != null? job.toString() : "null - no job"));
\\    logger.log(Level.WARNING, "job-builds: " + (job.getBuilds() != null? job.getBuilds().toString() : "null - no jobbuilds"));
    for (Object o : job.getBuilds()) {
      if (o instanceof Run) {
        Run build = (Run)o;
        if (build.isBuilding() &&
            hasCauseFromTheSamePullRequest(build.getCauses(), bitbucketCause)) {

the logging shows the this.job is null.

It looks like WorkflowJob does not have AbstractProject as an ancestor, and maybe this explains this behaviour in some weird way. A quick search shows this seems to be on "purpose".

I looked at quickly adding something that would work but realized that my first thought of checking types in startJob for ParameterizedJob would fail as scheduleBuild2 there lacks the necessary signature.

I don't understand why this.jobs is null in that later method so I'm pretty sure I don't understand what's going on.

Am I missing something?

Make builds implicitly parameterized

Make builds implicitly parameterized, so that rebuilding a PR really works with the same hash. Refer to the ghprb plugin: it uses an implicit parameter named sha1 .

compilation error

$ mvn install
...

[INFO] Fork Value is true
     [java] Warnings generated: 3
[INFO] Done FindBugs Analysis....
[INFO]
[INFO] <<< findbugs-maven-plugin:3.0.3:check (findbugs) < :findbugs @ bbprb <<<
[INFO]
[INFO]
[INFO] --- findbugs-maven-plugin:3.0.3:check (findbugs) @ bbprb ---
[INFO] BugInstance size is 3
[INFO] Error size is 0
[INFO] Total bugs: 3
[INFO] instanceof will always return true for all non-null values in org.jenkinsci.plugins.bbprb.BitbucketBuildListener.extractTrigger(AbstractBuild), since all org.jenkinsci.plugins.bbprb.BitbucketBuildTrigger are instances of org.jenkinsci.plugins.bbprb.BitbucketBuildTrigger [org.jenkinsci.plugins.bbprb.BitbucketBuildListener] At BitbucketBuildListener.java:[line 60] BC_VACUOUS_INSTANCEOF
[INFO] Possible null pointer dereference in org.jenkinsci.plugins.bbprb.BitbucketBuildListener.onStarted(AbstractBuild, TaskListener) due to return value of called method [org.jenkinsci.plugins.bbprb.BitbucketBuildListener, org.jenkinsci.plugins.bbprb.BitbucketBuildListener] Dereferenced at BitbucketBuildListener.java:[line 35]Known null at BitbucketBuildListener.java:[line 35] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
[INFO] Possible null pointer dereference in org.jenkinsci.plugins.bbprb.BitbucketHookReceiver.getBitbucketTriggers() due to return value of called method [org.jenkinsci.plugins.bbprb.BitbucketHookReceiver, org.jenkinsci.plugins.bbprb.BitbucketHookReceiver] Dereferenced at BitbucketHookReceiver.java:[line 106]Known null at BitbucketHookReceiver.java:[line 106] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
[INFO]


To see bug detail using the Findbugs GUI, use the following command "mvn findbugs:gui"



[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24:50 min
[INFO] Finished at: 2018-01-18T10:59:34+02:00
[INFO] Final Memory: 65M/329M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:3.0.3:check (findbugs) on project bbprb: failed with 3 bugs and 0 errors  -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The username field is not longer supported by bitbucket cloud.

Starting tomorrow, the username field will be completely removed from the author field for the pr json coming from bitbucket cloud. I think you can likely replace it with display_name to fix the issue. Currently the code is breaking for some user prs when it queries the username field from json because it is missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.