Code review comment for lp:~milo/linaro-patchmetrics/bug1012037

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

+++ apps/patchwork/bin/update-committed-patches.py 2012-06-28 08:43:05 +0000
@@ -21,8 +21,12 @@

 from patchwork.models import Project, State
 from patchwork.utils import (
- ensure_source_checkout_for_project, FailedToFetchGitRepo,
- get_diff_for_commit, get_commits_to_parse, get_patches_matching_commit)
+ ensure_source_checkout_for_project,
+ get_commits_to_parse,
+ get_diff_for_commit,
+ get_patches_matching_commit,
+ GitException,
+ )

The comma at the end can be removed.

=== modified file 'apps/patchwork/utils.py'
--- apps/patchwork/utils.py 2012-06-25 15:29:36 +0000
+++ apps/patchwork/utils.py 2012-06-28 08:43:05 +0000
@@ -33,6 +33,25 @@

 # Timeout for git operations.
 GIT_TIMEOUT = 120 * 60
+# XXX This is a temporary solution, a workardound for bug 1017933.
+# Once that bug is fixed or in the process, this should be removed.

FIXME would be more appropriate than XXX

+ # XXX this is a temporary solution, we need to fix bug
+ # https://bugs.launchpad.net/linaro-patchmetrics/+bug/1017933
+ if project.name in REPO_BRANCHES:
+ ensure_on_valid_branch(project, REPO_BRANCHES.get(project.name))
+
Here as well, FIXME would be more appropriate than XXX

The following piece of code repeats in 2 places, it can be made as a function call ?
    wait = 0
    wait_increment = 5

    while wait < timeout:
        proc.poll()
        if proc.returncode is not None:
            break
        wait += wait_increment
        time.sleep(wait_increment)

    if proc.returncode is None:
        kill_git_processes(proc, project)

    stdout, stderr = proc.communicate()

review: Needs Fixing

« Back to merge proposal