Open MSch opened 9 years ago
@DavidTanner is this going to be affecting the "Commit Status Context" field? (The one used to distinguish between different "checkboxes" on GitHub)?
@MSch I am going to have it resolve any environment variables, or defaults from the project.
@DavidTanner Awesome. Appreciate it!
Landed in build 1.24
@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)
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.
@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?
I am not sure. @mdelapenya was the one that added the support for build flows, he might be able to provide some info.
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?
@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.
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?
@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.
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
:+1: thanks!
Just mention me in the pull if you want it or if you need help ;)
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="ghprb@1.36.2">
<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.
I am closing this for now. If there is still momentum in need, lets reopen and get it ouf of the door.
@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.
All good! Just trying to cleanup some old issues.
Are you interested in trying to provide the PR like discussed in this issue?
I wish I could. Java and hacking it in the Jenkins environment are not something I have had time to get into yet though.
We're triggering a matrix project using GHPRB and we'd love individual commit statuses for every configuration in the matrix project. Doing just
ci/ios/${ARCHITECTURE}/{$IOS_VERSION}
didn't work :/