Hide Forgot
Description of problem: Trigger a pipeline build from jenkins console, then check the pipeline build, there is no trigger info shown for it. Version-Release number of selected component (if applicable): # openshift version openshift v1.5.0-alpha.0+cb9f8d6-116 kubernetes v1.4.0+776c994 etcd 3.1.0-rc.0 How reproducible: Always Steps to Reproduce: 1.Create Jenkins Pipeline BC $ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-ephemeral-template.json $ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.json $ oc start-build sample-pipeline 2.Check the pipeline build info. 3.Trigger a new pipeline build from jenkins console. 4.Check the new pipeline build info. Actual results: 2.There is trigger info: Triggered By: Manual build 4.There is no trigger info for the build: type: JenkinsPipeline triggeredBy: [] Expected results: 4. Should have such info: "Triggered By: Jenkins" Additional info:
The builds that will get "triggered by jenkins" added are builds that are explicitly launched by the build step from the openshift jenkins plugin. There's probably an argument that builds created through the flow you've described (which really means builds created by the sync plugin) could/should have that indication as well, but it's not part of the currently expected behavior. I'm going to assign this to Jimmi but marking upcoming release as it's definitely not a blocker for 3.4.
@bparees Do you think this requires a new `BuildTriggerCause` field or enough to just add a cause with message of `Manually triggered by user in Jenkins` or something?
@jimmi there is a TriggeredBy field on build objects today, here's how we populate it for builds that were triggered by a step in a jenkins job: triggeredBy: - message: 'Jenkins job URI: https://jenkins-myproject.10.13.137.191.xip.io/job/asdf/1/' Now that's a bit different from this scenario which is the case where the sync plugin is creating the build because the user requested to run a pipeline job in jenkins (or perhaps because the job definition in jenkins was triggered by something else), it probably makes sense for it to just say something like: triggeredBy: - message: 'Corresponding Jenkins job was run' And if you want to know exactly why the correspodning jenkins job was run, you'd have to go look at the job URI (which is already annotated on the build object, as i recall) and see who/what started the job. Does that seem reasonable?
Fixed in sync plugin v0.1.6. @bparees Shall I assign to @tdawson when it's synced? Assume you're OK to get this in to 3.4 as it's such a tiny update?
Honestly i'd rather just wait for 3.4.1 to produce a new image since QE just finished regression testing on the jenkins image and i don't want to rock the boat. So it should still get assigned to Troy but the message to Troy is to not worry about packaging this plugin+rebuilding the image for 3.4.
@tdawson Over to you for packaging - no hurry as @bparees explained above, this is for 3.4.1.
rpm updated: jenkins-plugin-openshift-sync-0.1.7-1.el7 images made: openshift3/jenkins-1-rhel7:1.651.2-47 openshift3/jenkins-2-rhel7:2.19-14 rpm is in the 3.4 testing repos images are in the testing registries.
Troy, when you build the new 3.4 jenkins image, what changes did you pick up? I'm hoping you only changed the sync plugin...
Checked on OCP 3.4.1.0: jenkins-plugin-openshift-sync-0.1.7-1.el7.x86_64 registry.ops.openshift.com/openshift3/jenkins-2-rhel7 <none> 5119d00f1c73 12 hours ago 678.8 MB Now there is trigger info when pipeline is triggered by jenkins: Triggered By: Triggered by Jenkins job at https://jenkins-prozyp.0120-5mz.qe.rhcloud.com/job/prozyp-sample-pipeline/ The bug has been fixed, so move it to Verified.