Merge ~kzapalowicz/snappy-hwe-snaps/+git/build-scripts:fix/build-for-notexistent-arch into ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Simon Fels
Approved revision: 12f26cc233829a1da8fc3b279db4adb6f7e85549
Merged at revision: da932732f1143e560b451707594355413b6dfa1d
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/build-scripts:fix/build-for-notexistent-arch
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master
Diff against target: 29 lines (+13/-0)
1 file modified
scripts/trigger-lp-build.py (+13/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Simon Fels Approve
Review via email: mp+318625@code.launchpad.net

Description of the change

Workaround building for nonexistent lpia arch by validating the arch fetched from Launchpad against the set of valid architectures.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/trigger-lp-build.py b/scripts/trigger-lp-build.py
2index 2de16e3..cf7fe3e 100755
3--- a/scripts/trigger-lp-build.py
4+++ b/scripts/trigger-lp-build.py
5@@ -109,11 +109,24 @@ print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
6 stamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
7 print("Trying to trigger builds at: {}".format(stamp))
8
9+# sometimes we see error such as "u'Unknown architecture lpia for ubuntu xenial'"
10+# and in order to workaround let's validate the arches agains set of valid
11+# architectures that the snap can choose from
12+
13+
14 # We will now trigger a build for each whitelisted architecture, collect the
15 # build job url and the wait for all builds to finish and collect their results
16 # to vote for a successful or failed build.
17 triggered_builds = []
18+valid_arches = ['armhf', 'i386', 'amd64', 'arm64', 's390x', 'powerpc', 'ppc64el']
19 for build_arch in arches:
20+ # sometimes we see error such as "u'Unknown architecture lpia for
21+ # ubuntu xenial'" and in order to workaround let's validate the arches
22+ # agains set of valid architectures that the snap can choose from
23+ if build_arch not in valid_arches:
24+ print("WARNING: Can't build snap for architecture {} as it is not enabled in the build job".format(args["snap"]))
25+ continue
26+
27 arch = release.getDistroArchSeries(archtag=build_arch)
28 request = snap.requestBuild(archive=primary_archive, distro_arch_series=arch, pocket='Proposed')
29 build_id = str(request).rsplit('/', 1)[-1]

Subscribers

People subscribed via source and target branches