← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:ociproject-git-instructions into launchpad:master

 

Review: Needs Fixing



Diff comments:

> diff --git a/lib/lp/registry/model/ociproject.py b/lib/lp/registry/model/ociproject.py
> index 3b376be..d165572 100644
> --- a/lib/lp/registry/model/ociproject.py
> +++ b/lib/lp/registry/model/ociproject.py
> @@ -222,6 +222,16 @@ class OCIProject(BugTargetBase, StormBase):
>              if recipe is not None:
>                  recipe._official = True
>  
> +    def getDefaultGitRepository(self):
> +        namespace = getUtility(IGitNamespaceSet).get(
> +            self.registrant, oci_project=self)
> +        return namespace.getByName(self.name)
> +
> +    def getDefaultGitRepositoryPath(self):
> +        namespace = getUtility(IGitNamespaceSet).get(
> +            self.registrant, oci_project=self)
> +        return '%s/+git/%s' % (namespace.name, self.name)

Using the registrant here doesn't feel right.  In general registrants in LP should only be used as an audit trail, not to construct paths and similar.

For something that goes on OCIProject:+index, we should also be recommending the target-default alias form of the path, rather than the one that contains a username, even for the initial push: that is, it should end up as something like git+ssh://git.launchpad.net/<pillar-name>/+oci/<project-name>.

> +
>  
>  @implementer(IOCIProjectSet)
>  class OCIProjectSet:
> diff --git a/lib/lp/registry/templates/ociproject-index.pt b/lib/lp/registry/templates/ociproject-index.pt
> index 9a14cb7..c814ce1 100644
> --- a/lib/lp/registry/templates/ociproject-index.pt
> +++ b/lib/lp/registry/templates/ociproject-index.pt
> @@ -26,6 +26,24 @@
>    </metal:heading>
>  
>    <div metal:fill-slot="main">
> +    <div tal:condition="python: view.git_repository is None">
> +      <p>
> +        You can create a git repositories for this OCI project in order to

"a git repository"

> +        build your OCI recipes by using the following commands:
> +        <br />
> +        <pre class="command">
> +          git remote add origin git+ssh://<tal:name replace="context/registrant/name"/>@git.launchpad.net/<tal:name replace="view/git_repository_path"/>
> +          git push --set-upstream origin master
> +        </pre>
> +      </p>
> +    </div>
> +    <div tal:define="repo view/git_repository"
> +         tal:condition="repo">
> +      The default git repository for this project is
> +      <a tal:content="repo/display_name"
> +         tal:attributes="href repo/fmt:url">lp:foo</a>.
> +    </div>
> +
>      <h2>OCI project information</h2>
>      <div class="two-column-list">
>        <dl id="pillar" tal:define="pillar context/pillar">


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/395174
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:oci-project-of-project-git-namespace.


References