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

Unmerged commits

ca2210f... by Nish Aravamudan

gitubuntu: add API to call quilt and gbp

LP: #1734137

0200711... by Nish Aravamudan

gbp: do not use pbuilder or qemubuilder

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
index a42063e..b6ee2f2 100644
--- a/gitubuntu/git_repository.py
+++ b/gitubuntu/git_repository.py
@@ -21,7 +21,13 @@ import gitubuntu.lint
21from gitubuntu.__main__ import top_level_defaults21from gitubuntu.__main__ import top_level_defaults
22import gitubuntu.build22import gitubuntu.build
23from gitubuntu.dsc import component_tarball_matches23from gitubuntu.dsc import component_tarball_matches
24from gitubuntu.run import run, runq, decode_binary24from gitubuntu.run import (
25 decode_binary,
26 run,
27 runq,
28 run_gbp,
29 run_quilt,
30)
25try:31try:
26 pkg = 'python3-debian'32 pkg = 'python3-debian'
27 import debian.changelog33 import debian.changelog
@@ -918,8 +924,7 @@ class GitUbuntuRepository:
918 tarballs.append(924 tarballs.append(
919 os.path.join(os.path.pardir, potential_main_tarballs[0])925 os.path.join(os.path.pardir, potential_main_tarballs[0])
920 )926 )
921 cmd = ['gbp', 'buildpackage', '--git-no-pbuilder',927 args = ['buildpackage', '--git-builder=/bin/true',
922 '--git-no-qemubuilder', '--git-builder=/bin/true',
923 '--git-pristine-tar', '--git-ignore-branch',928 '--git-pristine-tar', '--git-ignore-branch',
924 '--git-upstream-tag=%s/upstream/%s/%%(version)s%s' %929 '--git-upstream-tag=%s/upstream/%s/%%(version)s%s' %
925 (namespace, dist, ext)]930 (namespace, dist, ext)]
@@ -936,11 +941,11 @@ class GitUbuntuRepository:
936 tarballs.extend(map(lambda x : os.path.join(os.path.pardir, x),941 tarballs.extend(map(lambda x : os.path.join(os.path.pardir, x),
937 list(potential_component_tarballs.values()))942 list(potential_component_tarballs.values()))
938 )943 )
939 cmd.extend(map(lambda x : '--git-component=%s' % x,944 args.extend(map(lambda x : '--git-component=%s' % x,
940 list(potential_component_tarballs.keys()))945 list(potential_component_tarballs.keys()))
941 )946 )
942 with self.pristine_tar_branches(dist, namespace):947 with self.pristine_tar_branches(dist, namespace):
943 run(cmd)948 run_gbp(args, env=self.env)
944 return tarballs949 return tarballs
945950
946 raise PristineTarNotFoundError(951 raise PristineTarNotFoundError(
@@ -1973,8 +1978,8 @@ class GitUbuntuRepository:
1973 # differentiate between applied an unapplied1978 # differentiate between applied an unapplied
1974 with self.temporary_worktree(commit_hash):1979 with self.temporary_worktree(commit_hash):
1975 try:1980 try:
1976 run(1981 run_quilt(
1977 ['quilt', 'push', '-a'],1982 ['push', '-a'],
1978 env=self.quilt_env_from_treeish_str(commit_hash),1983 env=self.quilt_env_from_treeish_str(commit_hash),
1979 )1984 )
1980 # False if in an unapplied state, which is signified by1985 # False if in an unapplied state, which is signified by
@@ -1999,8 +2004,8 @@ class GitUbuntuRepository:
1999 raise e2004 raise e
20002005
2001 try:2006 try:
2002 run(2007 run_quilt(
2003 ['quilt', 'push', '-a'],2008 ['push', '-a'],
2004 env=self.quilt_env_from_treeish_str(commit_hash),2009 env=self.quilt_env_from_treeish_str(commit_hash),
2005 )2010 )
2006 # False if in an unapplied state2011 # False if in an unapplied state
@@ -2095,8 +2100,8 @@ class GitUbuntuRepository:
2095 )2100 )
20962101
2097 # generate the equivalent .pc directory2102 # generate the equivalent .pc directory
2098 run(2103 run_quilt(
2099 ['quilt', 'push', '-a'],2104 ['push', '-a'],
2100 env=self.quilt_env_from_treeish_str(commit_hash),2105 env=self.quilt_env_from_treeish_str(commit_hash),
2101 rcs=[2],2106 rcs=[2],
2102 )2107 )
@@ -2279,14 +2284,14 @@ with other relevant fields (see below for details).
2279 'debian/changelog',2284 'debian/changelog',
2280 ):2285 ):
2281 with self.temporary_worktree(commit_hash):2286 with self.temporary_worktree(commit_hash):
2282 run(2287 run_gbp(
2283 [2288 [
2284 'gbp',
2285 'dch',2289 'dch',
2286 '--snapshot',2290 '--snapshot',
2287 '--ignore-branch',2291 '--ignore-branch',
2288 '--since=%s' % str(parent_ref),2292 '--since=%s' % str(parent_ref),
2289 ]2293 ],
2294 env=self.env,
2290 )2295 )
2291 return self.dir_to_tree('.')2296 return self.dir_to_tree('.')
22922297
diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
index e8fb4f8..2eef775 100644
--- a/gitubuntu/importer.py
+++ b/gitubuntu/importer.py
@@ -53,7 +53,13 @@ from gitubuntu.git_repository import (
53 PristineTarError,53 PristineTarError,
54 is_dir_3_0_quilt,54 is_dir_3_0_quilt,
55)55)
56from gitubuntu.run import decode_binary, run, runq56from gitubuntu.run import (
57 decode_binary,
58 run,
59 runq,
60 run_gbp,
61 run_quilt,
62)
57from gitubuntu.source_information import (63from gitubuntu.source_information import (
58 GitUbuntuSourceInformation,64 GitUbuntuSourceInformation,
59 NoPublicationHistoryException,65 NoPublicationHistoryException,
@@ -686,17 +692,17 @@ def import_orig(repo, dsc, namespace, version, dist):
686 ext = os.path.splitext(dsc.orig_tarball_path)[1]692 ext = os.path.splitext(dsc.orig_tarball_path)[1]
687693
688 # make this non-fatal if upstream already exist as tagged?694 # make this non-fatal if upstream already exist as tagged?
689 cmd = ['gbp', 'import-orig', '--no-merge',695 args = ['import-orig', '--no-merge',
690 '--upstream-branch', 'do-not-push',696 '--upstream-branch', 'do-not-push',
691 '--pristine-tar', '--no-interactive',697 '--pristine-tar', '--no-interactive',
692 '--no-symlink-orig',698 '--no-symlink-orig',
693 '--upstream-tag=%s/upstream/%s/%%(version)s%s' %699 '--upstream-tag=%s/upstream/%s/%%(version)s%s' %
694 (namespace, dist, ext)]700 (namespace, dist, ext)]
695 cmd.extend(map(lambda x: '--component=%s' % x,701 args.extend(map(lambda x: '--component=%s' % x,
696 list(orig_component_paths.keys()))702 list(orig_component_paths.keys()))
697 )703 )
698 cmd.extend([orig_tarball_path,])704 args.extend([orig_tarball_path,])
699 run(cmd, env=repo.env)705 run_gbp(args, env=repo.env)
700 except CalledProcessError as e:706 except CalledProcessError as e:
701 raise GitUbuntuImportOrigError(707 raise GitUbuntuImportOrigError(
702 'Unable to import tarballs: %s' % orig_paths708 'Unable to import tarballs: %s' % orig_paths
@@ -783,18 +789,18 @@ def import_patches_applied_tree(repo, dsc_pathname):
783 while True:789 while True:
784 try:790 try:
785 os.chdir(extracted_dir)791 os.chdir(extracted_dir)
786 run(792 run_quilt(
787 ['quilt', 'push'],793 ['push'],
788 env=repo.quilt_env_from_treeish_str(import_tree_hash),794 env=repo.quilt_env_from_treeish_str(import_tree_hash),
789 verbose_on_failure=False,795 verbose_on_failure=False,
790 )796 )
791 patch_name, _ = run(797 patch_name, _ = run_quilt(
792 ['quilt', 'top'],798 ['top'],
793 env=repo.quilt_env_from_treeish_str(import_tree_hash),799 env=repo.quilt_env_from_treeish_str(import_tree_hash),
794 )800 )
795 patch_name = patch_name.strip()801 patch_name = patch_name.strip()
796 header, _ = run(802 header, _ = run_quilt(
797 ['quilt', 'header'],803 ['header'],
798 env=repo.quilt_env_from_treeish_str(import_tree_hash),804 env=repo.quilt_env_from_treeish_str(import_tree_hash),
799 )805 )
800 header = header.strip()806 header = header.strip()
diff --git a/gitubuntu/run.py b/gitubuntu/run.py
index 4b1a86c..1fdcd6d 100644
--- a/gitubuntu/run.py
+++ b/gitubuntu/run.py
@@ -1,4 +1,5 @@
1import logging1import logging
2import os
2import subprocess3import subprocess
34
45
@@ -102,3 +103,17 @@ def decode_binary(binary, verbose=True):
102 logging.warning("Failed to decode blob: %s", e)103 logging.warning("Failed to decode blob: %s", e)
103 logging.warning("blob=%s", binary.decode(errors='replace'))104 logging.warning("blob=%s", binary.decode(errors='replace'))
104 return binary.decode('utf-8', errors='replace')105 return binary.decode('utf-8', errors='replace')
106
107def run_quilt(args, env=None, **kwargs):
108 cmd = ['quilt', '--quiltrc', '-'] + args
109 return run(cmd, env=env, **kwargs)
110
111def run_gbp(args, env=None, **kwargs):
112 cmd = ['gbp'] + args
113 if env:
114 env_no_gbp_conf = env.copy()
115 else:
116 env_no_gbp_conf = os.environ.copy()
117 env_no_gbp_conf['GBP_CONF_FILES'] = '/dev/null'
118
119 return run(cmd, env=env_no_gbp_conf, **kwargs)

Subscribers

People subscribed via source and target branches