Merge lp:~nskaggs/phablet-tools/fix-1371241 into lp:phablet-tools

Proposed by Nicholas Skaggs
Status: Superseded
Proposed branch: lp:~nskaggs/phablet-tools/fix-1371241
Merge into: lp:phablet-tools
Diff against target: 52 lines (+35/-0) (has conflicts)
1 file modified
phablet-click-test-setup (+35/-0)
Text conflict in phablet-click-test-setup
To merge this branch: bzr merge lp:~nskaggs/phablet-tools/fix-1371241
Reviewer Review Type Date Requested Status
Colin Watson Needs Fixing
PS Jenkins bot continuous-integration Approve
Review via email:

This proposal has been superseded by a proposal from 2014-09-29.

Commit message

allow source from outside release pocket, bug 1371241

Description of the change

allow source from outside release pocket, bug 1371241

To post a comment you must log in.
313. By Nicholas Skaggs

don't require release pocket or published for --depends either

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Colin Watson (cjwatson) wrote :

Removing those filters entirely usually isn't a good idea. This looks as though it's potentially going to have some bad consequences, including:

 * fetching packages from -proposed that have not yet been promoted to release
 * fetching deleted packages

Judging from the bug report, you just need to make sure that you get status="Pending" publications as well. Have a look at the find_newest_publication function in - that might be a better approach.

review: Needs Fixing
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Colin, the rationale was if it's in the image you want the source no matter it's status. Thanks for the link to find_newest_publication, that looks handy.

I'm concerned however that we would also need to pull superseded packages. The archive might have moved on, but the image I have on my device still runs an older version of the package. Are we still covered in this scenario?

On fetching -proposed or deleted packages, I agree this change will nab those. And we're saying we want them if they are in the image. A deleted package though is really iffy. Is there any danger in version collision with a deleted package (aka, there is a published version 20140119ubuntu1, and a deleted version 20140119ubuntu1. We don't want to pull the deleted version in this scenario) ?

I'm happy to tweak the MP so long as we can cover the superseded scenario. The other statuses aren't likely to come into play.

Revision history for this message
Colin Watson (cjwatson) wrote :

It's not totally clear to me why you care about a package already on your image. Perhaps I'm misunderstanding something here. That said, when you're selecting a specific version (as is the case in get_source_package_tests here, although *not* in get_python_binary_package) it seems reasonable to remove the status and pocket restrictions; they don't seem likely to help matters when you already know the version you want.

Version collisions with deleted packages within a single archive are disallowed by Launchpad, so you don't need to worry about that.

Revision history for this message
Colin Watson (cjwatson) wrote :

17:14 <brendand> cjwatson, i *think* you approve?
17:14 <cjwatson> brendand: no, the second half makes sense now but I remain unconvinced by the first half
17:14 <cjwatson> see the bit where I say "*not*"
17:15 <brendand> cjwatson, so why do we care about a package already in the image?
17:15 <cjwatson> that's the question I asked
17:15 <brendand> cjwatson, we want to get the tarball of autopilot tests which match that version
17:16 <cjwatson> brendand: That makes sense for get_source_package_tests. What about get_python_binary_package?
17:16 <cjwatson> There are two quite different functions being changed here.
17:16 <cjwatson> get_python_binary_package does not nominate a specific version, so there is clearly no version-matching going on.
17:17 <cjwatson> It looks to me as though get_python_binary_package just wants basically the latest published thing that apt would give you. If that's correct then removing these restrictions is wrong.
17:19 <brendand> cjwatson, i wasn't expecting get_python_binary_package to be changed so i overlooked that
17:19 <cjwatson> (Because it's possible for a newer version to be removed and then deleted; or for a version to be in -proposed that hasn't yet made it to the release pocket because it fails autopkgtests or something; or ...)
17:19 <brendand> cjwatson, perhaps balloons_ can comment on that
17:19 <cjwatson> I'll copy and paste this into the MP to clarify

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

@cjwatson, thanks for the comments. You are correct. We want the latest dependency that apt would give for the get_python_binary_package call.

314. By Nicholas Skaggs

do check for --depends

Unmerged revisions

314. By Nicholas Skaggs

do check for --depends

313. By Nicholas Skaggs

don't require release pocket or published for --depends either

312. By Nicholas Skaggs

allow source from outside release pocket, bug 1371241

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-click-test-setup'
2--- phablet-click-test-setup 2014-09-17 17:06:39 +0000
3+++ phablet-click-test-setup 2014-09-29 16:25:51 +0000
4@@ -156,6 +156,7 @@
5 tmp_dir = tempfile.mkdtemp()
6 atexit.register(cleanup, tmp_dir)
7 print('Fetching %s - into %s' % (package, tmp_dir))
8+<<<<<<< TREE
9 try:
10 sp = lp.archive.getPublishedSources(
11 source_name=package,
12@@ -202,6 +203,40 @@
15 def get_bzr_tests(branch, revision, autopilot_dir, target_dir):
17+ sp = lp.archive.getPublishedSources(
18+ source_name=package,
19+ version=version,
20+ distro_series=lp.series,
21+ exact_match=True)
22+ # TODO needs filtering
23+ source_url = sp[0].sourceFileUrls()[0]
24+ print('Downloading %s version %s from %s' % (package, version, source_url))
25+ url = urllib2.urlopen(source_url)
26+ data =
28+ target = path.join(tmp_dir, 'source_file')
30+ with open(target, "wb") as p:
31+ p.write(data)
32+ check_call(['tar', '-xf', target], cwd=tmp_dir)
34+ print('Keeping tests from obtained package')
35+ package_source = filter((lambda x: x.startswith(package)),
36+ os.listdir(tmp_dir))
37+ # Just let an exception be thrown if more than one match which means
38+ # there's a problem somewhere
39+ test_base_dir = path.join(tmp_dir, package_source[0], 'tests', 'autopilot')
40+ test_dirs = filter((lambda x: path.isdir(path.join(test_base_dir, x))),
41+ os.listdir(test_base_dir))
42+ for test_dir in test_dirs:
43+ test_dir = path.join(test_base_dir, test_dir)
44+ print('Moving %s to %s' % (test_dir, target_dir))
45+ shutil.move(test_dir, target_dir)
48+def get_bzr_tests(branch, revision, autopilot_dir, target_dir, sub_dir):
49+>>>>>>> MERGE-SOURCE
50 tmp_dir = tempfile.mkdtemp()
51 atexit.register(cleanup, tmp_dir)
52 print('Checking out %s to %s' % (branch, path.join(tmp_dir, 'work')))


People subscribed via source and target branches