Bug 26666 - bugzilla-tool continues execution even if subcommands fail
Summary: bugzilla-tool continues execution even if subcommands fail
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-23 17:24 PDT by Eric Seidel (no email)
Modified: 2009-06-23 18:31 PDT (History)
0 users

See Also:


Attachments
Make SCM.run_command smarter and use it more (8.48 KB, patch)
2009-06-23 17:25 PDT, Eric Seidel (no email)
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-06-23 17:24:34 PDT
bugzilla-tool continues execution even if subcommands fail

I've noticed in a couple places that bugzilla-tool will continue executing even if the underlying "git svn rebase" command fails (due to a conflict for instance).

This is bad, and we should make bugzilla-tool more robust against this kind of failure by throwing ScriptExceptions (that's what there designed for).

That will allow the eventual land-everything-in-the-commit-queue mode to work and recover from build/update failures, while still allowing normal usage to error out correctly.
Comment 1 Eric Seidel (no email) 2009-06-23 17:25:26 PDT
Created attachment 31760 [details]
Make SCM.run_command smarter and use it more


---
 2 files changed, 47 insertions(+), 49 deletions(-)
Comment 2 Dimitri Glazkov (Google) 2009-06-23 17:32:38 PDT
What the heck kind of bug number is that?
Comment 3 Eric Seidel (no email) 2009-06-23 17:58:27 PDT
Clearly bugzilla-tool ate from the tree of knowledge and must now be banished from the garden of goodness.
Comment 4 David Levin 2009-06-23 18:11:08 PDT
Comment on attachment 31760 [details]
Make SCM.run_command smarter and use it more

Only one comment:

> diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py
> +    def run_command(command, cwd=None, input=None, raise_on_failure=True, return_exit_code=False):
> +        stdin = subprocess.PIPE if input else None
> +        process = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=stdin, shell=True, cwd=cwd)
> +        output = process.communicate(input)[0].rstrip()
> +        exit_code = process.wait()
> +        if raise_on_failure and exit_code != 0:

Use:
        if raise_on_failure and exit_code:
Comment 5 Eric Seidel (no email) 2009-06-23 18:31:59 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebKitTools/ChangeLog
	M	WebKitTools/Scripts/bugzilla-tool
	M	WebKitTools/Scripts/modules/scm.py
Committed r45026
http://trac.webkit.org/changeset/45026