← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cristiangsp/launchpad:no_edge_tag_for_valid_branches into launchpad:master

 

Cristian Gonzalez has proposed merging ~cristiangsp/launchpad:no_edge_tag_for_valid_branches into launchpad:master.

Commit message:
Do not add the edge tag on branches with valid format

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cristiangsp/launchpad/+git/launchpad/+merge/400240

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.


-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cristiangsp/launchpad:no_edge_tag_for_valid_branches into launchpad:master.
diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
index f1e083b..34a8c1e 100644
--- a/lib/lp/oci/model/ociregistryclient.py
+++ b/lib/lp/oci/model/ociregistryclient.py
@@ -258,7 +258,8 @@ class OCIRegistryClient:
         tags = []
         if recipe.is_valid_branch_format:
             tags.append("{}_{}".format(recipe.git_ref.name, "edge"))
-        tags.append("edge")
+        else:
+            tags.append("edge")
         return tags
 
     @classmethod
diff --git a/lib/lp/oci/tests/test_ociregistryclient.py b/lib/lp/oci/tests/test_ociregistryclient.py
index 3e0d90f..10f3af8 100644
--- a/lib/lp/oci/tests/test_ociregistryclient.py
+++ b/lib/lp/oci/tests/test_ociregistryclient.py
@@ -416,7 +416,7 @@ class TestOCIRegistryClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
         self.build.recipe.git_ref = git_ref
         result = self.client._calculateTags(self.build.recipe)
         self.assertThat(result, MatchesListwise(
-            [Equals("v1.0-20.04_edge"), Equals("edge")]))
+            [Equals("v1.0-20.04_edge")]))
 
     def test_build_registry_manifest(self):
         self._makeFiles()