Bug 1022271

Summary: [deploy] Check for hot_deploy/force_clean_build is potentially using the previous activation's value
Product: OpenShift Online Reporter: Andy Goldstein <agoldste>
Component: ContainersAssignee: Andy Goldstein <agoldste>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers, xtian, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:49:29 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 Andy Goldstein 2013-10-22 21:34:43 UTC
The bash/ruby SDK code that checks if hot_deploy and force_clean_build are enabled uses the latest deployment's metadata.json to determine these values. During a build, when pre-repo-archive is invoked, we haven't created a new deployment directory yet, nor have we written the metadata for the new build. As a result, the methods in the bash/ruby SDK are looking at the previous deployment's values.

We might want to consider creating the new deployment directory before we call pre-repo-archive, write the metadata, and then call pre-repo-archive. If we do this, we should also probably keep the code in build() that is writing the metadata, as jenkins uses this as its initial entry point for building and doesn't use the same post_receive/pre-repo-archive flow.

Comment 1 Andy Goldstein 2013-10-28 13:20:26 UTC
*** Bug 1023902 has been marked as a duplicate of this bug. ***

Comment 3 Dan McPherson 2013-10-28 17:45:17 UTC
The above github-bot comment was supposed to be for 1022271.  Sorry for any confusion.

Comment 4 Dan McPherson 2013-10-28 17:46:12 UTC
Wow can't get that right.  I meant it was for 1022272.

Comment 5 Andy Goldstein 2013-10-28 19:07:07 UTC
https://github.com/openshift/origin-server/pull/4014

Comment 6 openshift-github-bot 2013-10-28 23:59:39 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/85d23839c182246d32abcbf428ed97d112189e40
Bug 1022271

Write hot_deploy, force_clean_build, git_ref, git_sha1 to deployment
metadata file as part of prereceive and use metadata file's values
afterwards in postreceive, build, prepare, distribute, activate.

Comment 7 Qiushui Zhang 2013-10-29 06:31:16 UTC
Tested on devenv_3959.
The code is checked in. 
The option "hot-deploy" and "force-clean-build" works.
The dup bug 1023902 does not occur.

Mark the bug as verified.