← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:gitrepo-status into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/code/enums.py b/lib/lp/code/enums.py
> index c472c6a..8a09a72 100644
> --- a/lib/lp/code/enums.py
> +++ b/lib/lp/code/enums.py
> @@ -148,6 +149,25 @@ class GitRepositoryType(DBEnumeratedType):
>          """)
>  
>  
> +class GitRepositoryStatus(DBEnumeratedType):
> +    """Git Repository Status
> +
> +    The current situation of this Git Repository.
> +    """
> +
> +    AVAILABLE = DBItem(1, """
> +        Available
> +
> +        This repository is available to be used.
> +        """)
> +
> +    CREATING = DBItem(2, """
> +        Creating
> +
> +        This repository is being created on git hosting system.
> +        """)

I would be inclined to have these progress roughly chronologically, so CREATING would have a smaller number than AVAILABLE.

> +
> +
>  class GitObjectType(DBEnumeratedType):
>      """Git Object Type
>  
> diff --git a/lib/lp/code/model/gitrepository.py b/lib/lp/code/model/gitrepository.py
> index 2e9080f..0421884 100644
> --- a/lib/lp/code/model/gitrepository.py
> +++ b/lib/lp/code/model/gitrepository.py
> @@ -351,6 +355,8 @@ class GitRepository(StormBase, WebhookTargetMixin, GitIdentityMixin):
>              assert IDistribution.providedBy(target.pillar)
>              self.ociprojectname = target.ociprojectname
>              self.distribution = target.pillar
> +        self.status = (status if status is not None
> +                       else GitRepositoryStatus.AVAILABLE)

XXX comment to indicate that this should be simplified once the column's backfilled.  Probably also similar on the column declaration above.

>          self.owner_default = False
>          self.target_default = False
>  


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/385208
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:gitrepo-status into launchpad:master.


References