Bug 8195

Summary: [autobuilder] Fetch of specific branch means possible required commit isn't present
Product: [Infrastructure] AutoBuilder Reporter: Ross Burton <ross.burton>
Component: autobuilderAssignee: Beth Flanagan <elizabeth.flanagan>
Status: VERIFIED FIXED QA Contact: Mihail Stanciu <stanciux.mihail>
Severity: major    
Priority: Medium+ CC: bogdanx.a.voiculescu, infras.ab.watcher, Infras.watcher, richard.purdie, sgw
Version: unspecified   
Target Milestone: 1.9 M3   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 8249    

Description Ross Burton 2015-08-21 10:38:54 UTC
Scenario:

1) I push a branch to ross/mut
2) Start autobuilder nightly on ross/mut
3) Autobuilder master fetches ross/mut, resolves name to SHA 1234.
4) Time passes.  I discover a problem with the branch, remove a commit, force-push to ross/mut *mid build*.
5) New builder starts, fetches just ross/mut and resets to 1234.  However, in the new ross/mut 1234 doesn't exist anymore so the reset fails

At this point the autobuilder then claims to be building ross/mut but is simply building whatever was in the previous clone.  In the case of https://autobuilder.yoctoproject.org/main/builders/nightly-deb/builds/436/ it was a previous MUT which we noticed because of the particular way the sanity tests failed later... but if it were master we'd think that ross/mut built fine when it actually build master.

Instead of fetching just ross/mut the fetch should grab all of the poky-contrib repo so unless there's been a garbage collect, even force-pushed branches will still work as the old SHA will still be present.

(git 2.5 with specific server side flags enabled will let you fetch a specific SHA, but that's a big ask: easier to just grab everything)
Comment 1 Ross Burton 2015-08-21 11:03:09 UTC
Okay, so my plan doesn't quite work.  From a clean repo fetching all won't fetch the now unreachable reference.  Assuming it existed at some point in the past it will work.

Unless someone has a better idea we can't get now-unreachable commits so we just need to error out asap (bug 8196).
Comment 2 Saul Wold 2015-08-27 14:40:35 UTC
Richard has already added some code, please verify and close these based on those changes
Comment 4 Mihail Stanciu 2015-09-21 09:23:21 UTC
Verified.