Bug 1371493

Summary: Changing JenkinsPipeline BC Jenkinsfile will affect finished jenkinsPipeline builds
Product: OKD Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas, pweil, zhezli
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-30 12:48:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Yadan Pei 2016-08-30 10:28:36 UTC
Description of problem:
When editing JenkinsPipeline BC,its finished builds configurations are also changed, this is wrong

Version-Release number of selected component (if applicable):
openshift v1.3.0-alpha.3+d8c9694
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

How reproducible:
Always

Steps to Reproduce:
1. Create JenkinsPipeline BC and trigger builds
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/image-streams/image-streams-centos7.json -n openshift
$ 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 new-app jenkins-ephemeral
$ oc start-build sample-pipeline 
2. When sample-pipeline #1 is finished, access BC edit page at /edit/pipelines/sample-pipeline, change the Jenkinsfile content, such as add stage 'test'
node('maven') {
stage 'build'
.....
stage 'test'
echo "this is test"
.....
}

3. Click "Save' on BC edit page
4. Check BC 'sample-pipeline' page about Jenkinsfile content
5. Check build sample-pipeline #1 page about Jenkinsfile content

Actual results:
4. On BC 'sample-pipeline' page, Jenkinsfile is shown with new changes
node('maven') {
stage 'build'
.....
stage 'test'
echo "this is test"
.....
}
5. For finished sample-pipeline #1 build, Jenkinsfile content is also shown with new changes
node('maven') {
stage 'build'
.....
stage 'test'
echo "this is test"
.....
}

Expected results:
5. Editing BC should not change its finished builds configurations

Additional info:
CLI could show correct Jenkinsfile about build sample-pipeline #1
# oc get builds sample-pipeline #1 -o yaml
node('maven') {
stage 'build'
...
state 'deploy'
..
}

Comment 1 Samuel Padgett 2016-09-16 19:34:21 UTC
We're incorrectly showing the build config Jenkinsfile instead of the build Jenkinsfile.

Comment 3 Yadan Pei 2016-10-14 03:12:12 UTC
Checked against latest origin-web-console(latest commit is b7fa730, manually vendored)

After changing Jenkinsfile of bc/sample-pipeline, Jenkinsfile for completed builds(#1) will not be updated, the changes only apply to new builds(#2...)

Move to VERIFIED

Comment 4 Li Zhe 2016-11-24 08:17:37 UTC
Reproduced on ded-stage-dcp 3.3.1.5
The running builds will also be effected.