Merge ~racb/git-ubuntu:nacc-breakdown/run-quilt-gbp-correctly into git-ubuntu:master

Proposed by Robie Basak
Status: Rejected
Rejected by: Nish Aravamudan
Proposed branch: ~racb/git-ubuntu:nacc-breakdown/run-quilt-gbp-correctly
Merge into: git-ubuntu:master
Prerequisite: ~racb/git-ubuntu:nacc-breakdown/gbp-pbuilder-qemubuilder
Diff against target: 188 lines (+51/-25)
3 files modified
gitubuntu/git_repository.py (+19/-14)
gitubuntu/importer.py (+17/-11)
gitubuntu/run.py (+15/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
Robie Basak Needs Information
Nish Aravamudan Pending
Review via email: mp+336308@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

Why are --git-nopbuilder and --git-no-qemubuilder being removed from the gbp call?

Why are env=self.env parameters being added?

review: Needs Information
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:ca2210f7a778bc0a0aac7df37d7db7874eca2633
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~racb/usd-importer/+git/usd-importer/+merge/336308/+edit-commit-message

https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/249/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Style Check
    SUCCESS: Unit Tests
    FAILED: Integration Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/249/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Nish Aravamudan (nacc) wrote :

Superseded with my merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
2index a42063e..b6ee2f2 100644
3--- a/gitubuntu/git_repository.py
4+++ b/gitubuntu/git_repository.py
5@@ -21,7 +21,13 @@ import gitubuntu.lint
6 from gitubuntu.__main__ import top_level_defaults
7 import gitubuntu.build
8 from gitubuntu.dsc import component_tarball_matches
9-from gitubuntu.run import run, runq, decode_binary
10+from gitubuntu.run import (
11+ decode_binary,
12+ run,
13+ runq,
14+ run_gbp,
15+ run_quilt,
16+)
17 try:
18 pkg = 'python3-debian'
19 import debian.changelog
20@@ -918,8 +924,7 @@ class GitUbuntuRepository:
21 tarballs.append(
22 os.path.join(os.path.pardir, potential_main_tarballs[0])
23 )
24- cmd = ['gbp', 'buildpackage', '--git-no-pbuilder',
25- '--git-no-qemubuilder', '--git-builder=/bin/true',
26+ args = ['buildpackage', '--git-builder=/bin/true',
27 '--git-pristine-tar', '--git-ignore-branch',
28 '--git-upstream-tag=%s/upstream/%s/%%(version)s%s' %
29 (namespace, dist, ext)]
30@@ -936,11 +941,11 @@ class GitUbuntuRepository:
31 tarballs.extend(map(lambda x : os.path.join(os.path.pardir, x),
32 list(potential_component_tarballs.values()))
33 )
34- cmd.extend(map(lambda x : '--git-component=%s' % x,
35+ args.extend(map(lambda x : '--git-component=%s' % x,
36 list(potential_component_tarballs.keys()))
37 )
38 with self.pristine_tar_branches(dist, namespace):
39- run(cmd)
40+ run_gbp(args, env=self.env)
41 return tarballs
42
43 raise PristineTarNotFoundError(
44@@ -1973,8 +1978,8 @@ class GitUbuntuRepository:
45 # differentiate between applied an unapplied
46 with self.temporary_worktree(commit_hash):
47 try:
48- run(
49- ['quilt', 'push', '-a'],
50+ run_quilt(
51+ ['push', '-a'],
52 env=self.quilt_env_from_treeish_str(commit_hash),
53 )
54 # False if in an unapplied state, which is signified by
55@@ -1999,8 +2004,8 @@ class GitUbuntuRepository:
56 raise e
57
58 try:
59- run(
60- ['quilt', 'push', '-a'],
61+ run_quilt(
62+ ['push', '-a'],
63 env=self.quilt_env_from_treeish_str(commit_hash),
64 )
65 # False if in an unapplied state
66@@ -2095,8 +2100,8 @@ class GitUbuntuRepository:
67 )
68
69 # generate the equivalent .pc directory
70- run(
71- ['quilt', 'push', '-a'],
72+ run_quilt(
73+ ['push', '-a'],
74 env=self.quilt_env_from_treeish_str(commit_hash),
75 rcs=[2],
76 )
77@@ -2279,14 +2284,14 @@ with other relevant fields (see below for details).
78 'debian/changelog',
79 ):
80 with self.temporary_worktree(commit_hash):
81- run(
82+ run_gbp(
83 [
84- 'gbp',
85 'dch',
86 '--snapshot',
87 '--ignore-branch',
88 '--since=%s' % str(parent_ref),
89- ]
90+ ],
91+ env=self.env,
92 )
93 return self.dir_to_tree('.')
94
95diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
96index e8fb4f8..2eef775 100644
97--- a/gitubuntu/importer.py
98+++ b/gitubuntu/importer.py
99@@ -53,7 +53,13 @@ from gitubuntu.git_repository import (
100 PristineTarError,
101 is_dir_3_0_quilt,
102 )
103-from gitubuntu.run import decode_binary, run, runq
104+from gitubuntu.run import (
105+ decode_binary,
106+ run,
107+ runq,
108+ run_gbp,
109+ run_quilt,
110+)
111 from gitubuntu.source_information import (
112 GitUbuntuSourceInformation,
113 NoPublicationHistoryException,
114@@ -686,17 +692,17 @@ def import_orig(repo, dsc, namespace, version, dist):
115 ext = os.path.splitext(dsc.orig_tarball_path)[1]
116
117 # make this non-fatal if upstream already exist as tagged?
118- cmd = ['gbp', 'import-orig', '--no-merge',
119+ args = ['import-orig', '--no-merge',
120 '--upstream-branch', 'do-not-push',
121 '--pristine-tar', '--no-interactive',
122 '--no-symlink-orig',
123 '--upstream-tag=%s/upstream/%s/%%(version)s%s' %
124 (namespace, dist, ext)]
125- cmd.extend(map(lambda x: '--component=%s' % x,
126+ args.extend(map(lambda x: '--component=%s' % x,
127 list(orig_component_paths.keys()))
128 )
129- cmd.extend([orig_tarball_path,])
130- run(cmd, env=repo.env)
131+ args.extend([orig_tarball_path,])
132+ run_gbp(args, env=repo.env)
133 except CalledProcessError as e:
134 raise GitUbuntuImportOrigError(
135 'Unable to import tarballs: %s' % orig_paths
136@@ -783,18 +789,18 @@ def import_patches_applied_tree(repo, dsc_pathname):
137 while True:
138 try:
139 os.chdir(extracted_dir)
140- run(
141- ['quilt', 'push'],
142+ run_quilt(
143+ ['push'],
144 env=repo.quilt_env_from_treeish_str(import_tree_hash),
145 verbose_on_failure=False,
146 )
147- patch_name, _ = run(
148- ['quilt', 'top'],
149+ patch_name, _ = run_quilt(
150+ ['top'],
151 env=repo.quilt_env_from_treeish_str(import_tree_hash),
152 )
153 patch_name = patch_name.strip()
154- header, _ = run(
155- ['quilt', 'header'],
156+ header, _ = run_quilt(
157+ ['header'],
158 env=repo.quilt_env_from_treeish_str(import_tree_hash),
159 )
160 header = header.strip()
161diff --git a/gitubuntu/run.py b/gitubuntu/run.py
162index 4b1a86c..1fdcd6d 100644
163--- a/gitubuntu/run.py
164+++ b/gitubuntu/run.py
165@@ -1,4 +1,5 @@
166 import logging
167+import os
168 import subprocess
169
170
171@@ -102,3 +103,17 @@ def decode_binary(binary, verbose=True):
172 logging.warning("Failed to decode blob: %s", e)
173 logging.warning("blob=%s", binary.decode(errors='replace'))
174 return binary.decode('utf-8', errors='replace')
175+
176+def run_quilt(args, env=None, **kwargs):
177+ cmd = ['quilt', '--quiltrc', '-'] + args
178+ return run(cmd, env=env, **kwargs)
179+
180+def run_gbp(args, env=None, **kwargs):
181+ cmd = ['gbp'] + args
182+ if env:
183+ env_no_gbp_conf = env.copy()
184+ else:
185+ env_no_gbp_conf = os.environ.copy()
186+ env_no_gbp_conf['GBP_CONF_FILES'] = '/dev/null'
187+
188+ return run(cmd, env=env_no_gbp_conf, **kwargs)

Subscribers

People subscribed via source and target branches