[Launchpad-reviewers] [Merge] ~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master

2021-01-06 Thread noreply
The proposal to merge ~pappacena/launchpad:fix-oci-build-status-transition into 
launchpad:master has been updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395812
-- 
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:fix-oci-build-status-transition.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master

2021-01-06 Thread Thiago F. Pappacena
The proposal to merge ~pappacena/launchpad:fix-oci-build-status-transition into 
launchpad:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395812
-- 
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:fix-oci-build-status-transition.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master

2021-01-06 Thread Colin Watson
Review: Approve


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395812
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:fix-oci-build-status-transition.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master

2021-01-05 Thread Thiago F. Pappacena
The proposal to merge ~pappacena/launchpad:fix-oci-build-status-transition into 
launchpad:master has been updated.

Description changed to:

When OCI registry upload triggers for a recipe that has more then one build 
ready to be uploaded, we should mark the oldest one as superseded and only run 
the upload for the more recent one. This should fix the bug when marking the 
build as superseded.

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395812
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master

2021-01-05 Thread Thiago F. Pappacena
Thiago F. Pappacena has proposed merging 
~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master.

Commit message:
Fixing OCIRecipeBuild status transition bug

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395812
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~pappacena/launchpad:fix-oci-build-status-transition into launchpad:master.
diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
index 8af3a5f..e528281 100644
--- a/lib/lp/oci/model/ociregistryclient.py
+++ b/lib/lp/oci/model/ociregistryclient.py
@@ -462,7 +462,10 @@ class OCIRegistryClient:
 if build.status == BuildStatus.SUPERSEDED:
 return
 if build.hasMoreRecentBuild():
-build.updateStatus(BuildStatus.SUPERSEDED)
+force_transition = (build.status == BuildStatus.FULLYBUILT)
+build.updateStatus(
+BuildStatus.SUPERSEDED,
+force_invalid_transition=force_transition)
 
 @classmethod
 def uploadManifestList(cls, build_request, uploaded_builds):
diff --git a/lib/lp/oci/tests/test_ociregistryclient.py b/lib/lp/oci/tests/test_ociregistryclient.py
index ffed023..ecfaee3 100644
--- a/lib/lp/oci/tests/test_ociregistryclient.py
+++ b/lib/lp/oci/tests/test_ociregistryclient.py
@@ -227,6 +227,7 @@ class TestOCIRegistryClient(OCIConfigHelperMixin, SpyProxyCallsMixin,
 
 @responses.activate
 def test_upload_ignores_superseded_builds(self):
+self.build.updateStatus(BuildStatus.FULLYBUILT)
 recipe = self.build.recipe
 processor = self.build.processor
 distribution = recipe.oci_project.distribution
___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp