Pushed the last refactoring. This should be good to go now. Diff comments:
> diff --git a/lib/lp/oci/model/ociregistryclient.py > b/lib/lp/oci/model/ociregistryclient.py > index b7d41c6..a949140 100644 > --- a/lib/lp/oci/model/ociregistryclient.py > +++ b/lib/lp/oci/model/ociregistryclient.py > @@ -449,10 +452,30 @@ class OCIRegistryClient: > return current_manifest > > @classmethod > + def updateSupersededBuilds(cls, build): > + """Checks if the given build was superseded by another build, > + updating its status in case it should have been superseded. > + > + :return: True if the build was superseded. > + """ > + if build.status == BuildStatus.SUPERSEDED: > + return True > + if build.hasMoreRecentBuild(): > + build.updateStatus(BuildStatus.SUPERSEDED) > + return True > + return False > + > + @classmethod > def uploadManifestList(cls, build_request, uploaded_builds): > """Uploads to all build_request.recipe.push_rules the manifest list > for the builds in the given build_request. > """ > + # First, double check that the builds that will be updated in the > + # manifest files were not superseded by newer builds. > + uploaded_builds = [build for build in uploaded_builds > + if not cls.updateSupersededBuilds(build)] Ok! Refactoring. > + if not uploaded_builds: > + return > for push_rule in build_request.recipe.push_rules: > http_client = RegistryHTTPClient.getInstance(push_rule) > multi_manifest_content = cls.makeMultiArchManifest( -- https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/394269 Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:oci-upload-manifest-upsert. _______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp

