Merge ~sergiodj/ubuntu-docker-images/+git/utils:golang-manifest-no-error into ~ubuntu-docker-images/ubuntu-docker-images/+git/utils:main

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: be5022b9002c99279a2cc665a4773ff801cdcf6e
Proposed branch: ~sergiodj/ubuntu-docker-images/+git/utils:golang-manifest-no-error
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/utils:main
Diff against target: 30 lines (+12/-0)
1 file modified
golang-manifest-builder.py (+12/-0)
Reviewer Review Type Date Requested Status
Athos Ribeiro Approve
Bryce Harrington Pending
Canonical Server Pending
Review via email: mp+419515@code.launchpad.net

Description of the change

Although rare, it is possible for modules not to be listed in the pkg.go.dev website. The website is our main source of information regarding modules, specifically when trying to determine their canonical repositories. When a module is not listed there, we should skip the querying part and write its info directly to stdout.

This MP fixes a build failure that is currently affecting telegraf.

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Sergio! LGTM

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Monday, April 18 2022, Athos Ribeiro wrote:

> Thanks, Sergio! LGTM

Thanks, Athos. Merged.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/golang-manifest-builder.py b/golang-manifest-builder.py
2index 2709096..2764794 100755
3--- a/golang-manifest-builder.py
4+++ b/golang-manifest-builder.py
5@@ -69,6 +69,11 @@ TAG_PREFIX = {
6 "go.elastic.co/apm/module/apmot" : "module/apmot/",
7 }
8
9+# A list of modules that are not present in the pkg.go.dev website.
10+NON_PKG_GO_DEV_MODULES = [
11+ "golang.zx2c4.com/wintun",
12+ ]
13+
14 with open(sys.argv[1], 'r') as f:
15 for line in f.readlines ():
16 # Grab the name and version of each module.
17@@ -76,6 +81,13 @@ with open(sys.argv[1], 'r') as f:
18 modinfo[0] = modinfo[0].strip ().replace ('\n', '')
19 modinfo[1] = modinfo[1].strip ().replace ('\n', '')
20
21+ if modinfo[0] in NON_PKG_GO_DEV_MODULES:
22+ # If the module is not in the pkg.go.dev website, there is
23+ # no point in continuing the query. Let's just print its
24+ # name as is and continue iterating.
25+ print ("{},{}".format (modinfo[0], modinfo[1]))
26+ continue
27+
28 # Grab the page. We offer a retry mechanism in case of
29 # failure.
30 attempts = 0

Subscribers

People subscribed via source and target branches