Merge ~cristiangsp/launchpad:no_edge_tag_for_valid_branches into launchpad:master

Proposed by Cristian Gonzalez
Status: Merged
Approved by: Cristian Gonzalez
Approved revision: 5e3ba7db428055e7149c924593bf88c8e872b494
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cristiangsp/launchpad:no_edge_tag_for_valid_branches
Merge into: launchpad:master
Diff against target: 27 lines (+3/-2)
2 files modified
lib/lp/oci/model/ociregistryclient.py (+2/-1)
lib/lp/oci/tests/test_ociregistryclient.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+400240@code.launchpad.net

Commit message

Do not add the edge tag on branches with valid format

Description of the change

We want to stop adding the 'edge' tag to the OCI Images that are built from branches that follow the pattern 'M.N-XX.YY' on their name. Those images must continue getting the 'M.N-XX.YY_edge' tag.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
2index f1e083b..34a8c1e 100644
3--- a/lib/lp/oci/model/ociregistryclient.py
4+++ b/lib/lp/oci/model/ociregistryclient.py
5@@ -258,7 +258,8 @@ class OCIRegistryClient:
6 tags = []
7 if recipe.is_valid_branch_format:
8 tags.append("{}_{}".format(recipe.git_ref.name, "edge"))
9- tags.append("edge")
10+ else:
11+ tags.append("edge")
12 return tags
13
14 @classmethod
15diff --git a/lib/lp/oci/tests/test_ociregistryclient.py b/lib/lp/oci/tests/test_ociregistryclient.py
16index 3e0d90f..10f3af8 100644
17--- a/lib/lp/oci/tests/test_ociregistryclient.py
18+++ b/lib/lp/oci/tests/test_ociregistryclient.py
19@@ -416,7 +416,7 @@ class TestOCIRegistryClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
20 self.build.recipe.git_ref = git_ref
21 result = self.client._calculateTags(self.build.recipe)
22 self.assertThat(result, MatchesListwise(
23- [Equals("v1.0-20.04_edge"), Equals("edge")]))
24+ [Equals("v1.0-20.04_edge")]))
25
26 def test_build_registry_manifest(self):
27 self._makeFiles()

Subscribers

People subscribed via source and target branches

to status/vote changes: