Missing tags when pulling from Gerrit

600 views
Skip to first unread message

Eric

unread,
Aug 22, 2012, 3:12:59 PM8/22/12
to repo-d...@googlegroups.com
Hello All,

I have a scenario (described) below where not all tags are being cloned from Gerrit when exclusive -1 READ access controls are set to any branch in that repo or parent project. I have experienced this on both v2.1.8 and v2.4.2. Is this expected behavior or a possible bug?


- Create an empty Gerrit manifest project, grant required read and push permissions to read, clone & push. For this test you can use l
ocal permission or a parent project (I used a parent project)
- Clone the manifest project && add a (simple) default.xml with a few projects, push it to the manifest Gerrit project
- Create some tags (eg. v1-regular_tag & v1-annotated_tag), regular and annotated - push them to the manifest project
- Test your manifest project using repo init/sync
- Make a change to the default.xml
- Commit the change
- Create an annotated tag for this change (eg. v2-annotated_tag)
- Push back the tag only to the manifest project (eg. git push origin tag v2-annotated_tag)
- Remove or create a new workspace && repo init your manifest file using the latest tag created previously (eg. repo init --manifest-url=ssh://example.com:29418/test/manifest.git --manifest-branch=refs/tags/v2-annotated_tag)
- The repo init works as expected

- Add the following access controls to the parent project (or local manifest project) "Exclusive" READ -1 Registered Users refs/heads/branch1, this can be any branch name and the branch does NOT have to exist in the manifest project. The group can be and group name and your account can be in that group or not.
- Remove or create a new workspace && repo init your manifest file using the latest tag created previously (eg. repo init --manifest-url=ssh://example.com:29418/test/manifest.git --manifest-branch=refs/tags/v2-annotated_tag)
- The repo init will not work, it will return an error like this:
   error: revision refs/tags/v2-annotated_tag in manifests not found

- Similiar behaviors can be seen using git clone and cloning the manifest file then looking at the list of tags, the latest tag that you created by pushing the tag only (along with any other tags created/pushed in this same manner) will not be seen in the cloned repo.
- Take Gerrit out of the mix and clone or repo init from a Gerrit mirror (non Gerrit Slave) and this issue is not seen. The v2-annotated_tag tag can be seen.

Regards,
Eric

Magnus Bäck

unread,
Aug 22, 2012, 3:28:49 PM8/22/12
to repo-d...@googlegroups.com
On Wednesday, August 22, 2012 at 15:12 EDT,
Eric <eric.wi...@gmail.com> wrote:

> I have a scenario (described) below where not all tags are being
> cloned from Gerrit when exclusive -1 READ access controls are set to
> any branch in that repo or parent project. I have experienced this on
> both v2.1.8 and v2.4.2. Is this expected behavior or a possible bug?

Tags are only visible if there's at least one branch pointing to it.
The fact that you can see the tag if there are no read restrictions
is probably just a consequence of an optimization in the access rule
evaluation.

https://groups.google.com/d/topic/repo-discuss/icmnEGGXXMQ/discussion
https://groups.google.com/d/topic/repo-discuss/b6Kgz2VFSMY/discussion

[...]

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages