Closed Bug 1007259 Opened 11 years ago Closed 11 years ago

Manage repo checkout directly from b2g_build.py

Categories

(Release Engineering :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: catlee, Assigned: catlee)

References

Details

Attachments

(3 files, 1 obsolete file)

b2g_build.py should be able to directly manage the repo tool, so we can control which repository it comes from, and which revision of it we use.
'repo sync' will try and sync the local checkout of 'repo', which will fail if we clone it right now with gittool since the 'origin' remote doesn't get set. this patch makes sure we have the 'origin' remote set for our cloned repos.
Attachment #8418894 - Flags: review?(rail)
Attached patch use gittool to checkout repo (obsolete) — Splinter Review
Attachment #8418900 - Flags: review?(aki)
Comment on attachment 8418900 [details] [diff] [review] use gittool to checkout repo This will work, but: a) do you want a cleanup method in case the clone goes south, or do you want to error out purple and have the next job clobber? self.retry(self.checkout_repotool, cleanup=self.clobber_repotool, args=(repo_dir,)) b) There's no error checking here; do you want to error out on either the retry or the ./repo --version if unsuccessful? Ideally we exit 3 (infrastructure) on failure; looks like we might not yet have support for retry() to set the self.return_code on failure.
Attachment #8418900 - Flags: review?(aki) → review+
Comment on attachment 8418894 [details] [diff] [review] set origin remote when cloning Review of attachment 8418894 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/python/util/git.py @@ +152,5 @@ > + cmd = ['git', 'remote', '-v'] > + proc = subprocess.Popen(cmd, cwd=repo, stdout=subprocess.PIPE) > + proc.wait() > + for line in proc.stdout.readlines(): > + m = re.match("%s\s+(\S+) \(fetch\)$" % re.escape(remote_name), line) It'd be better to use "raw" string (r"%s....") here.
Attachment #8418894 - Flags: review?(rail) → review+
Attachment #8418894 - Flags: checked-in+
update dependency-free version of gittool in puppet
Attachment #8419616 - Flags: review?(rail)
Comment on attachment 8419616 [details] [diff] [review] gittool-puppet.patch O.K.! :D
Attachment #8419616 - Flags: review?(rail) → review+
Attachment #8419616 - Flags: checked-in+
(In reply to Chris AtLee [:catlee] from comment #5) > Created attachment 8419616 [details] [diff] [review] > gittool-puppet.patch > > update dependency-free version of gittool in puppet merged to production in https://hg.mozilla.org/build/puppet/rev/c702366a2164
Attachment #8418900 - Attachment is obsolete: true
Attachment #8422390 - Flags: review?(aki)
Comment on attachment 8422390 [details] [diff] [review] use gittool to checkout repo >+ # self.vcs_checkout already retries, so no need to wrap it in >+ # self.retry. We set the error_level to ERROR to prevent it going fatal >+ # so we can do our own handling here. >+ retval = self.vcs_checkout_repos(repos, error_level=ERROR) >+ if not retval: >+ self.rmtree(repo_dir) >+ self.fatal("Automation Error: couldn't clone repo", exit_code=5) I would have thought 3, here: http://hg.mozilla.org/build/mozharness/file/e3fb9a135242/mozharness/mozilla/buildbot.py#l40 What's 5? >+ cmd = ['./repo', '--version'] >+ if not self.run_command(cmd, cwd=dirs['work_dir']) == 0: >+ # Set return code to RETRY >+ self.fatal("repo is broken", exit_code=5) Here too. I guess makeMHFactory doesn't have a log_eval_func, so any non-zero is red, but we may want to match the standard at some point.
Attachment #8422390 - Flags: review?(aki) → review+
Comment on attachment 8422390 [details] [diff] [review] use gittool to checkout repo checked-in with s/5/4/
Attachment #8422390 - Flags: checked-in+
Blocks: 934890
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: