Merge lp:~matsubara/auto-package-testing/trigger-adt-test-support-ppa into lp:auto-package-testing

Proposed by Diogo Matsubara on 2012-10-25
Status: Merged
Merged at revision: 96
Proposed branch: lp:~matsubara/auto-package-testing/trigger-adt-test-support-ppa
Merge into: lp:auto-package-testing
Diff against target: 86 lines (+20/-5)
1 file modified
jenkins/trigger-adt-test (+20/-5)
To merge this branch: bzr merge lp:~matsubara/auto-package-testing/trigger-adt-test-support-ppa
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve on 2012-11-12
Diogo Matsubara (community) Abstain on 2012-10-26
Martin Pitt 2012-10-25 Disapprove on 2012-10-26
Review via email: mp+131433@code.launchpad.net

Description of the Change

This branch adds support to monitor a list of PPAs for the auto package test header and trigger jenkins jobs for those. Also adds --release option to trigger-adt-test.

To post a comment you must log in.
Diogo Matsubara (matsubara) wrote :

Btw, lines 53..54 are to fix a bug using -f option.

Martin Pitt (pitti) wrote :

Either this has already been merged before, or Jean-Baptiste implemented it independently. The current versions already have a --ppa switch.

review: Disapprove
Diogo Matsubara (matsubara) wrote :

Hi Martin, there's no --ppa option for the trigger-adt-test script and this branch adds it.

review: Resubmit
Martin Pitt (pitti) wrote :

Oh sorry, I misread.

Diogo Matsubara (matsubara) wrote :

I shouldn't have asked a review from myself.

review: Abstain
70. By Diogo Matsubara on 2012-10-26

merge from trunk

71. By Diogo Matsubara on 2012-10-26

another merge from trunk

Diogo Matsubara (matsubara) wrote :

Hi there, could you take another look? Is this good to merge?
Cheers,

Diogo

Martin Pitt (pitti) wrote :

I'd rather have Jean-Baptiste merge this. He's on vacation this week, so if anything blows up this week we'd have a problem. It looks good to me, but I wouldn't quite know how to roll it out anyway.

Jean-Baptiste Lallement (jibel) wrote :

Looks good. Thanks and sorry for the delay!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jenkins/trigger-adt-test'
2--- jenkins/trigger-adt-test 2012-10-26 15:29:00 +0000
3+++ jenkins/trigger-adt-test 2012-10-26 17:24:21 +0000
4@@ -44,6 +44,7 @@
5 import jinja2
6 import jenkins
7 import argparse
8+from softwareproperties.ppa import expand_ppa_line
9
10 # 'all' is used to track the status across all archs.
11 ARCHS = ('i386', 'amd64', 'all')
12@@ -69,7 +70,7 @@
13 is not reached
14
15 '''
16- logging.debug("Instanciating new cache using rootdir '%s'", rootdir)
17+ logging.debug("Instantiating new cache using rootdir '%s'", rootdir)
18 super(AptCache, self).__init__(rootdir=rootdir, memonly=False)
19 self.rootdir = rootdir
20 self.timestampfile = os.path.normpath(
21@@ -199,7 +200,7 @@
22 return (version, pocket, depends)
23
24 def run_required(self):
25- '''Return True is the job must run
26+ '''Return True if the job must run
27
28 Conditions are:
29 - No version for the package (never ran before)
30@@ -430,7 +431,7 @@
31
32
33 def write_sources_list(path, release, arch, use_proposed=False,
34- overwrite=False):
35+ overwrite=False, ppas=None):
36 """ Write sources.list file
37
38 :param path: Path to sources.list
39@@ -438,6 +439,7 @@
40 :param arch: architecture as returned by dpkg --print-architecture
41 :param use_proposed: If True add an entry for proposed
42 :param overwrite: Overwrite existing file if True
43+ :param ppas: List of PPAs to add to sources.list
44 """
45
46 src = """\
47@@ -451,9 +453,16 @@
48 deb-src http://archive.ubuntu.com/ubuntu/ %s-proposed main restricted universe multiverse
49 """ % (release, release)
50
51+ if ppas:
52+ for ppa in ppas:
53+ (ppa_line, ignored) = expand_ppa_line(ppa, release)
54+ ppa_src_line = 'deb-src' + ppa_line[3:]
55+ src += "\n\n%s\n%s\n"% (ppa_line, ppa_src_line)
56+
57 if not os.path.exists(path) or overwrite:
58 logging.debug('Writing sources.list to %s', path)
59- os.makedirs(os.path.dirname(path))
60+ if not os.path.exists(path):
61+ os.makedirs(os.path.dirname(path))
62 with open(path, 'w') as f:
63 f.write(src)
64 else:
65@@ -481,6 +490,10 @@
66 default=False,
67 help='Check if new versions are in -proposed and '
68 'enable -proposed in testbed.')
69+ parser.add_argument('-p', '--ppa', action='append', metavar='PPA',
70+ default=None,
71+ help='Check if new versions are in PPA and ' \
72+ 'enable the PPA in testbed.')
73 parser.add_argument('-U', '--update-jobs', action='store_true',
74 default=False,
75 help='by default only new jobs are added. This '
76@@ -510,7 +523,9 @@
77 logging.debug('aptroot: %s', aptroot)
78
79 sources_path = os.path.join(aptroot, 'etc/apt/sources.list')
80- write_sources_list(sources_path, release, arch, args.use_proposed)
81+ write_sources_list(
82+ sources_path, release, arch, args.use_proposed, args.force_update,
83+ ppas=args.ppa)
84
85 cache = AptCache(rootdir=aptroot, force_update=args.force_update)
86 apt_pkg.Config.Set('Dir', aptroot)

Subscribers

People subscribed via source and target branches