Merge lp:~pwlars/ci-core-jenkins/set-version-description into lp:ci-core-jenkins

Proposed by Paul Larson
Status: Merged
Approved by: Paul Larson
Approved revision: 13
Merged at revision: 11
Proposed branch: lp:~pwlars/ci-core-jenkins/set-version-description
Merge into: lp:ci-core-jenkins
Diff against target: 90 lines (+23/-6)
3 files modified
jenkins/templates/core-result-fetcher.xml.jinja2 (+8/-1)
workers/get_latest_image_version/__init__.py (+8/-1)
workers/tests/test_get_image_version.py (+7/-4)
To merge this branch: bzr merge lp:~pwlars/ci-core-jenkins/set-version-description
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Francis Ginther Approve
Paul Larson Needs Resubmitting
Review via email: mp+255714@code.launchpad.net

Commit message

Set the build description to the full version ID, including device tarball and rootfs version

Description of the change

This should get us to a full image ID that can be used by the dashboard. I suspect some other places are going to have to change too though, or else the image id won't match. We should probably not be testing against channels with the release name in the name, but rather the alias "ubuntu-core/devel-proposed" for example. This matches what we were asked to do on the touch image testing, because it ensures continuous results for a channel. The downside (for us) is that the revision numbers are not guaranteed to be sequential. So when the "w" release opens, they will start over at 1.

We need the full image version for other reasons too though, as the image_id itself does not give the complete picture of the component versions that went into it.

To post a comment you must log in.
Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the description setting. I've just commented on the image_id that's being passed to the result fetcher job.

review: Needs Information
Revision history for this message
Paul Larson (pwlars) wrote :

Right, that's what I meant by needing to change the image id in other places. I think that either 1. we need to separate out the short version id from the full description, or 2. (if 1 is not enough) use the full version spec everywhere.

Revision history for this message
Paul Larson (pwlars) wrote :

This extracts just the short id before calling fetch-latest-result

review: Needs Resubmitting
Revision history for this message
Para Siva (psivaa) wrote :

An inline comment about extracting SHORT_IMAGE_ID

review: Needs Fixing
Revision history for this message
Francis Ginther (fginther) wrote :

Piling on with another comment.

Otherwise looks good.

review: Needs Fixing
Revision history for this message
Paul Larson (pwlars) wrote :

Good catch, thanks for the review. Fixed in r12

review: Needs Resubmitting
Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the work and the fixes, Paul. +1

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

Approve

review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (4.9 KiB)

The attempt to merge lp:~pwlars/ci-core-jenkins/set-version-description into lp:ci-core-jenkins failed. Below is the output from the failed tests.

Using base prefix '/usr'
New python executable in /tmp/venv-ci-core-jenkins_rt0y8it/bin/python3
Also creating executable in /tmp/venv-ci-core-jenkins_rt0y8it/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python3
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking requests==2.5.3 (from -r requirements.txt (line 1))
Installing collected packages: requests
Successfully installed requests
Cleaning up...
Downloading/unpacking testtools==1.7.1 (from -r test_requirements.txt (line 1))
Downloading/unpacking extras (from testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading extras-0.0.3.tar.gz
  Running setup.py (path:/tmp/venv-ci-core-jenkins_rt0y8it/build/extras/setup.py) egg_info for package extras

Downloading/unpacking python-mimeparse (from testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading python-mimeparse-0.1.4.tar.gz
  Running setup.py (path:/tmp/venv-ci-core-jenkins_rt0y8it/build/python-mimeparse/setup.py) egg_info for package python-mimeparse

Downloading/unpacking unittest2>=1.0.0 (from testtools==1.7.1->-r test_requirements.txt (line 1))
Downloading/unpacking traceback2 (from testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading traceback2-1.4.0-py2.py3-none-any.whl
Downloading/unpacking six>=1.4 (from unittest2>=1.0.0->testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading six-1.9.0-py2.py3-none-any.whl
Downloading/unpacking argparse (from unittest2>=1.0.0->testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading argparse-1.3.0-py2.py3-none-any.whl
Downloading/unpacking linecache2 (from traceback2->testtools==1.7.1->-r test_requirements.txt (line 1))
  Downloading linecache2-1.0.0-py2.py3-none-any.whl
Installing collected packages: testtools, extras, python-mimeparse, unittest2, traceback2, six, argparse, linecache2
*** Error compiling '/tmp/venv-ci-core-jenkins_rt0y8it/build/testtools/testtools/_compat2x.py'...
  File "/tmp/venv-ci-core-jenkins_rt0y8it/build/testtools/testtools/_compat2x.py", line 16
    raise exc_class, exc_obj, exc_tb
                   ^
SyntaxError: invalid syntax

  Running setup.py install for extras

  Running setup.py install for python-mimeparse

Successfully installed testtools extras python-mimeparse unittest2 traceback2 six argparse linecache2
Cleaning up...
running test
running egg_info
creating workers.egg-info
writing top-level names to workers.egg-info/top_level.txt
writing dependency_links to workers.egg-info/dependency_links.txt
writing workers.egg-info/PKG-INFO
writing manifest file 'workers.egg-info/SOURCES.txt'
reading manifest file 'workers.egg-info/SOURCES.txt'
writing manifest file 'workers.egg-info/SOURCES.txt'
running build_ext
INFO: Executing: bzr branch lp:~canonical-ci-engineering/ci-core-jenkins/pip-cache /tmp/tmp_kmk768mpip-cache-/cache
INFO: Executing: virtualenv -p python3 /tmp/venv-ci-core-jenkins_rt0y8it
INFO: Executing: /tmp/venv-ci-core-jenkins_rt0y8it/bin/pip install --no-index --find-links=/tmp...

Read more...

13. By Paul Larson

fix tests

Revision history for this message
Paul Larson (pwlars) wrote :

Testcase fixed

review: Needs Resubmitting
Revision history for this message
Francis Ginther (fginther) wrote :

Tests pass now, approve.

review: Approve
Revision history for this message
Para Siva (psivaa) wrote :

approving again.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jenkins/templates/core-result-fetcher.xml.jinja2'
2--- jenkins/templates/core-result-fetcher.xml.jinja2 2015-04-10 10:19:24 +0000
3+++ jenkins/templates/core-result-fetcher.xml.jinja2 2015-04-10 14:00:57 +0000
4@@ -38,7 +38,8 @@
5
6 set -e
7
8-python3 workers/fetch-latest-result.py -i $IMAGE_ID --channel {{channel}} -d {{device}}
9+SHORT_IMAGE_ID=`echo $IMAGE_ID |sed 's/:.*//'`
10+python3 workers/fetch-latest-result.py -i $SHORT_IMAGE_ID --channel {{channel}} -d {{device}}
11
12 echo "=== Converting the adt results to UTAH format ==="
13 rm -rf adt_utah_converter
14@@ -60,6 +61,12 @@
15 <publishFailedBuilds>true</publishFailedBuilds>
16 <postActions class="vector"/>
17 </hudson.plugins.build__publisher.BuildPublisher>
18+ <hudson.plugins.descriptionsetter.DescriptionSetterPublisher>
19+ <regexp/>
20+ <regexpForFailed/>
21+ <description>$IMAGE_ID</description>
22+ <setForMatrix>false</setForMatrix>
23+ </hudson.plugins.descriptionsetter.DescriptionSetterPublisher>
24 </publishers>
25 <buildWrappers/>
26 </project>
27
28=== modified file 'workers/get_latest_image_version/__init__.py'
29--- workers/get_latest_image_version/__init__.py 2015-03-31 18:21:53 +0000
30+++ workers/get_latest_image_version/__init__.py 2015-04-10 14:00:57 +0000
31@@ -18,12 +18,19 @@
32
33 import argparse
34 import configparser
35+import re
36 import requests
37
38
39 def _read_index_json_file(url, response=requests.get):
40 r = response(url)
41- return r.json()['images'][-1]['version']
42+ detail = r.json()['images'][-1]['version_detail']
43+ pattern = 'ubuntu=([0-9\.]+),raw-device=([0-9\.]+),version=([0-9\.]+)'
44+ versions = re.search(pattern, detail).groups()
45+ return "{version_id}:{device_version}:{rootfs_version}".format(
46+ version_id=versions[2],
47+ device_version=versions[1],
48+ rootfs_version=versions[0])
49
50
51 def main():
52
53=== modified file 'workers/tests/test_get_image_version.py'
54--- workers/tests/test_get_image_version.py 2015-04-01 19:04:45 +0000
55+++ workers/tests/test_get_image_version.py 2015-04-10 14:00:57 +0000
56@@ -36,14 +36,16 @@
57 "files": [],
58 "type": "full",
59 "version": 303,
60- "version_detail": "fake 1"
61+ "version_detail":
62+ "ubuntu=20150331.1,raw-device=20150331.1,version=303"
63 },
64 {
65 "description": "fake 2",
66 "files": [],
67 "type": "full",
68 "version": 304,
69- "version_detail": "fake 2"
70+ "version_detail":
71+ "ubuntu=20150331.2,raw-device=20150331.1,version=304"
72 },
73 {
74 "base": 306,
75@@ -51,7 +53,8 @@
76 "files": [],
77 "type": "delta",
78 "version": 306,
79- "version_detail": "fake 3"
80+ "version_detail":
81+ "ubuntu=20150401.1,raw-device=20150401.1,version=306"
82 },
83 ]
84 }
85@@ -65,4 +68,4 @@
86 return fakeResponse()
87
88 ret = _read_index_json_file(url, get_response)
89- self.assertEqual(ret, 306)
90+ self.assertEqual(ret, "306:20150401.1:20150401.1")

Subscribers

People subscribed via source and target branches