Git Product home page Git Product logo

Comments (21)

DavidTanner avatar DavidTanner commented on June 23, 2024

#103 will give more options for updating the status. I am going to make a couple changes real quick, then publish it.

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@DavidTanner is this going to be affecting the "Commit Status Context" field? (The one used to distinguish between different "checkboxes" on GitHub)?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on June 23, 2024

@MSch I am going to have it resolve any environment variables, or defaults from the project.

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@DavidTanner Awesome. Appreciate it!

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on June 23, 2024

Landed in build 1.24

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@DavidTanner Thanks for the quick turnaround, but I just tried it and unfortunately it doesn't fix the issue.

We have a matrix project that gets triggered by the GH PR, so this matrix project then sets the commit status context, but the individual configurations that are run by it do not set a context.

So with the latest version I can configure a commit status context of ci/ios/${MY_VARIABLE_FROM_THE_MATRIX_PROJECT}, but this does not resolve the variable, since it only sets the commit status context on the "top-level" matrix project, not on each configuration in the matrix project.

When I actually want is a separate commit status context for every configuration in the matrix project (and ideally I could skip the commit status context for the matrix project itself, since that's not interesting for people looking at the PR)

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on June 23, 2024

I see what you mean. In that case you want the status updated by the build manager as each completes. Currently there are only three points that interact with GitHub, trigger job, job started, and job finished.

I haven't done any work in the BuildManager code, but if you know your way around java you are welcome to add to the code in a pull request.

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@DavidTanner Thanks for the info. I haven't done any development on Jenkins ever, how much work do you think it is to add this?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on June 23, 2024

I am not sure. @mdelapenya was the one that added the support for build flows, he might be able to provide some info.

from ghprb-plugin.

mdelapenya avatar mdelapenya commented on June 23, 2024

HI everybody, just to clarify: @MSch, you want to have as many commit statuses as matrix configurations in the job, so you could eventually print all statuses in the comment. Something like this:

Android 2.x -> OK
Android 3.x -> FAILED
Android 4.x -> OK
Android 5.x -> OK

Where each Android version is a value on the axis

Is that correct?

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@mdelapenya I think so :)

I want to have as many commit status contexts as matrix configurations in the job, so that Android 2.x, Android 3.x, etc show up separately in the GitHub PR, just as clahub, continuous-integration/travis and codeclimate do here:

so you could eventually print all statuses in the comment

Just to clarify: I want to print the statuses as "commit status context" (see image above), not in a comment on the PR or the description field of the commit status.

from ghprb-plugin.

mdelapenya avatar mdelapenya commented on June 23, 2024

I took a quick look onto the code, and there is a method to write a commit status in a context

repo.createCommitStatus(sha1, state, url, message, context);

I guess calling it on each matrix configuration value will work.

Would it be enough?

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

@mdelapenya if that resolves variables in the context string than that would be perfect, I would just set the context to android/${ANDROID_VERSION} in the project configuration and that'd be it.

from ghprb-plugin.

mdelapenya avatar mdelapenya commented on June 23, 2024

The AbstractBuild object has a getVariables method.

So if you iterate through the matrix builds, then you'll have the variables on each one.

Take into account that you should move the createCommitStatus call in the onBuildComplete(...) method to the build manager, so that there could be more that one commit status, each on the context provided by the build

from ghprb-plugin.

MSch avatar MSch commented on June 23, 2024

👍 thanks!

from ghprb-plugin.

mdelapenya avatar mdelapenya commented on June 23, 2024

Just mention me in the pull if you want it or if you need help ;)

from ghprb-plugin.

brianjmurrell avatar brianjmurrell commented on June 23, 2024

Any progress here? We too would like the individual child jobs (the intersections of the axes) to post their own status to GitHub.

Actually, it looks like it might be somewhat working. With the config set to:

    <org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatus plugin="[email protected]">
      <showMatrixStatus>false</showMatrixStatus>
      <commitStatusContext>ci/jenkins/ssi/${arch}</commitStatusContext>
      <triggeredStatus></triggeredStatus>
      <startedStatus></startedStatus>
      <statusUrl></statusUrl>
      <addTestResults>false</addTestResults>
    </org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatus>

I get status for:

ci/jenkins/ssi/${arch}

and

ci/jenkins/ssi/x86_64

With the former showing a Details link to the parent job and the latter showing a Details link to the child job. So, really, just need the variable substitution in the parent to substitute an empty value (and suppress the final /) for an empty variable instead of the variable name.

from ghprb-plugin.

bjoernhaeuser avatar bjoernhaeuser commented on June 23, 2024

I am closing this for now. If there is still momentum in need, lets reopen and get it ouf of the door.

from ghprb-plugin.

brianjmurrell avatar brianjmurrell commented on June 23, 2024

@bjoernhaeuser I'm not sure I understand why you are closing this. This is still a very real issue for us. We have commit status' being overwritten because of this lack of being able to add which axis in the matrix it is updating for.

from ghprb-plugin.

bjoernhaeuser avatar bjoernhaeuser commented on June 23, 2024

All good! Just trying to cleanup some old issues.

Are you interested in trying to provide the PR like discussed in this issue?

from ghprb-plugin.

brianjmurrell avatar brianjmurrell commented on June 23, 2024

I wish I could. Java and hacking it in the Jenkins environment are not something I have had time to get into yet though.

from ghprb-plugin.

Related Issues (20)

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.