← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:oci-upload-prevent-superseded into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/oci/model/ocirecipebuild.py b/lib/lp/oci/model/ocirecipebuild.py
> index eda6fa3..7c003bc 100644
> --- a/lib/lp/oci/model/ocirecipebuild.py
> +++ b/lib/lp/oci/model/ocirecipebuild.py
> @@ -479,6 +481,20 @@ class OCIRecipeBuild(PackageBuildMixin, Storm):
>                  "uploaded.")
>          getUtility(IOCIRegistryUploadJobSource).create(self)
>  
> +    def hasMoreRecentBuild(self):
> +        """See `IOCIRecipeBuild`."""
> +        status = [
> +            BuildStatus.NEEDSBUILD, BuildStatus.FULLYBUILT,
> +            BuildStatus.BUILDING, BuildStatus.UPLOADING

Hm, I'm not sure.  It's still possible to have multiple builds in flight for a single recipe for other reasons (e.g. multiple commits in quicker succession than we can keep up with builds), and in that sort of case it does seem worth making sure that logical ordering is preserved - it's possible for a build that was dispatched later to finish earlier.  But I think only more recent builds in FULLYBUILT should count.

> +        ]
> +        recent_builds = IStore(self).find(
> +            OCIRecipeBuild,
> +            OCIRecipeBuild.recipe == self.recipe,
> +            OCIRecipeBuild.processor == self.processor,
> +            OCIRecipeBuild.status.is_in(status),
> +            OCIRecipeBuild.date_created > self.date_created)
> +        return not recent_builds.is_empty()
> +
>  
>  @implementer(IOCIRecipeBuildSet)
>  class OCIRecipeBuildSet(SpecificBuildFarmJobSourceMixin):


-- 
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.


References