Merge lp:~gz/juju-ci-tools/regogetgate into lp:juju-ci-tools

Proposed by Martin Packman
Status: Merged
Merged at revision: 1121
Proposed branch: lp:~gz/juju-ci-tools/regogetgate
Merge into: lp:juju-ci-tools
Diff against target: 52 lines (+8/-3)
2 files modified
git_gate.py (+4/-1)
tests/test_git_gate.py (+4/-2)
To merge this branch: bzr merge lp:~gz/juju-ci-tools/regogetgate
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+274069@code.launchpad.net

Description of the change

Refetch dependecies after merge in gating script

This was somewhat intentionally left out of the initial version of the script, to make accidental dependency changes less likely. However, doing updates to dependencies is just too annoying without the gating job handling it without needing editing.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)
lp:~gz/juju-ci-tools/regogetgate updated
1122. By Martin Packman

Avoid calling go get twice in the common case

Revision history for this message
Martin Packman (gz) wrote :

I pushed up a new rev which adds a caveat that saves a go get in the common case.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'git_gate.py'
2--- git_gate.py 2015-09-11 23:46:53 +0000
3+++ git_gate.py 2015-10-14 17:25:27 +0000
4@@ -58,7 +58,7 @@
5 if args.project_url:
6 print_now("Cloning {} from {}".format(args.project, args.project_url))
7 git("clone", args.project_url, directory)
8- if args.go_get_all:
9+ if args.go_get_all and not (args.project_url and args.merge_url):
10 print_now("Getting {} and dependencies using go".format(args.project))
11 go("get", "-v", "-d", "-t", project_ellipsis)
12 os.chdir(directory)
13@@ -69,6 +69,9 @@
14 print_now("Merging {} ref {}".format(args.merge_url, args.merge_ref))
15 git("fetch", args.merge_url, args.merge_ref)
16 git("merge", "--no-ff", "-m", "Merged " + args.merge_ref, "FETCH_HEAD")
17+ if args.go_get_all:
18+ print_now("Updating {} dependencies using go".format(args.project))
19+ go("get", "-v", "-d", "-t", project_ellipsis)
20 if args.dependencies:
21 for dep in args.dependencies:
22 print_now("Getting {} and dependencies using go".format(dep))
23
24=== modified file 'tests/test_git_gate.py'
25--- tests/test_git_gate.py 2015-09-16 23:30:23 +0000
26+++ tests/test_git_gate.py 2015-10-14 17:25:27 +0000
27@@ -161,6 +161,8 @@
28 ('print', 'Merging https://git.testing/proposed ref HEAD'),
29 ('git', 'fetch', 'https://git.testing/proposed', 'HEAD'),
30 ('git', 'merge', '--no-ff', '-m', 'Merged HEAD', 'FETCH_HEAD'),
31+ ('print', 'Updating git.testing/project dependencies using go'),
32+ ('go', 'get', '-v', '-d', '-t', 'git.testing/project/...'),
33 ('go', 'build', 'git.testing/project/...'),
34 ('go', 'test', 'git.testing/project/...')
35 ])
36@@ -177,14 +179,14 @@
37 ' https://git.testing/project'),
38 ('git', 'clone', 'https://git.testing/project',
39 '/tmp/fake/src/git.testing/project'),
40- ('print', 'Getting git.testing/project and dependencies using go'),
41- ('go', 'get', '-v', '-d', '-t', 'git.testing/project/...'),
42 ('chdir', '/tmp/fake/src/git.testing/project'),
43 ('print', 'Switching repository to v1'),
44 ('git', 'checkout', 'v1'),
45 ('print', 'Merging https://git.testing/proposed ref feature'),
46 ('git', 'fetch', 'https://git.testing/proposed', 'feature'),
47 ('git', 'merge', '--no-ff', '-m', 'Merged feature', 'FETCH_HEAD'),
48+ ('print', 'Updating git.testing/project dependencies using go'),
49+ ('go', 'get', '-v', '-d', '-t', 'git.testing/project/...'),
50 ('go', 'build', 'git.testing/project/...'),
51 ('go', 'test', 'git.testing/project/...')
52 ])

Subscribers

People subscribed via source and target branches