Pushing to refs/for/meta/config for review (branch meta/config not found)

242 views
Skip to first unread message

motorhe...@gmail.com

unread,
Jan 12, 2024, 10:50:16 AM1/12/24
to Repo and Gerrit Discussion
I am working on a lightweight smoke test script for a Gerrit 3.6 POC installation. At a high level I would like for it to work like this:
  1. git init
    git remote add origin blah # for some server/project supplied as parameter
    git fetch +refs/meta/config:refs/meta/config
    1. also tried +refs/meta/config:refs/remotes/origin/meta/config
  2. scp -p -P 29418 server:hooks/commit-msg .git/hooks/
  3. git checkout meta/config # succeeds up to this point in all cases so far
  4. date >date.txt; git add date.txt # or something equally trivial
  5. git commit -m "some message" # still OK so far
  6. git push origin HEAD:refs/for/meta/config
    1. Expected: change is pushed successfully and new code review is generated
    2. Actual:   ! [remote rejected] HEAD -> refs/for/meta/config (branch meta/config not found)
    3. Also tried git push origin HEAD:refs/for/refs/heads/meta/config
    4. This is my current point of failure (discussed below)
  7. (never get this far) use ssh -p 29418 server gerrit review commands to progress the review, then abandon and delete the review
This is based on constraints as follows:
  • I want to be able to introduce code reviews into any project and observe the replication behaviour (partly because I am trying to troubleshoot some high replication latency issues and looking for roadblocks).
  • I want to introduce the code review in meta/config since it is lightweight and all projects have this branch.
  • I want to use ssh for simplest authentication (public keys).
  • I want to be able to abandon and delete the review so that it does not clutter up the code history (but I haven't got that far yet) anyway that is why I want to push for review on meta/config
    • pushing directly to refs/meta/config works as expected, but I would prefer not to actually push the change to the branch (ie pollute the history with a trivial test)
    • Is there some special permission that is required to push to meta/config for code review?
Is there a method to push a change to meta/config for code review using ssh that I have not properly considered? Or maybe I am off my rocker and this is simply not supported?

I hope someone can let me know.

Regards,
Robert Gregory

Matthias Sohn

unread,
Jan 12, 2024, 11:28:17 AM1/12/24
to motorhe...@gmail.com, Repo and Gerrit Discussion
On Fri, Jan 12, 2024 at 4:50 PM motorhe...@gmail.com <motorhe...@gmail.com> wrote:
I am working on a lightweight smoke test script for a Gerrit 3.6 POC installation. At a high level I would like for it to work like this:
  1. git init
    git remote add origin blah # for some server/project supplied as parameter
    git fetch +refs/meta/config:refs/meta/config
    1. also tried +refs/meta/config:refs/remotes/origin/meta/config
  2. scp -p -P 29418 server:hooks/commit-msg .git/hooks/
  3. git checkout meta/config # succeeds up to this point in all cases so far
for non-standard refs (other than branches and tags) I'd recommend to use the full ref name "refs/meta/config" 
  1. date >date.txt; git add date.txt # or something equally trivial
  2. git commit -m "some message" # still OK so far
  3. git push origin HEAD:refs/for/meta/config
    1. Expected: change is pushed successfully and new code review is generated
    2. Actual:   ! [remote rejected] HEAD -> refs/for/meta/config (branch meta/config not found)
this command is wrong, try this one:

git push origin HEAD:refs/for/refs/meta/config
 

    1. Also tried git push origin HEAD:refs/for/refs/heads/meta/config
    2. This is my current point of failure (discussed below)
  1. (never get this far) use ssh -p 29418 server gerrit review commands to progress the review, then abandon and delete the review
This is based on constraints as follows:
  • I want to be able to introduce code reviews into any project and observe the replication behaviour (partly because I am trying to troubleshoot some high replication latency issues and looking for roadblocks).
  • I want to introduce the code review in meta/config since it is lightweight and all projects have this branch.
  • I want to use ssh for simplest authentication (public keys).
  • I want to be able to abandon and delete the review so that it does not clutter up the code history (but I haven't got that far yet) anyway that is why I want to push for review on meta/config
    • pushing directly to refs/meta/config works as expected, but I would prefer not to actually push the change to the branch (ie pollute the history with a trivial test)
    • Is there some special permission that is required to push to meta/config for code review?
Is there a method to push a change to meta/config for code review using ssh that I have not properly considered? Or maybe I am off my rocker and this is simply not supported?

I hope someone can let me know.

-Matthias 

motorhe...@gmail.com

unread,
Jan 12, 2024, 1:27:44 PM1/12/24
to Repo and Gerrit Discussion
THAT WAS IT! Thank you Matthias you da best!
Reply all
Reply to author
Forward
0 new messages