Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gerrit #409

Open
nbarbey opened this issue Feb 27, 2024 · 6 comments
Open

Add support for gerrit #409

nbarbey opened this issue Feb 27, 2024 · 6 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@nbarbey
Copy link

nbarbey commented Feb 27, 2024

Would it be possible to add an option to push the temporary branch to a gerrit server ?
This would require to be able to push to gerrit "magic" refs/for/ instead of refs/heads
For now when I try to use mob with a gerrit server I get this error :

ERROR remote: error: branch refs/heads/mob-session:
ERROR remote: Push to refs/for/mob-session to create a review, or get 'Push' rights to update the branch.
ERROR remote: User: nicolas.barbey
ERROR remote: Contact an administrator to fix the permissions
remote: Processing changes: refs: 1, done  
ERROR To ssh://review.***.ci:29418/***
ERROR ! [remote rejected]         mob-session -> mob-session (prohibited by Gerrit: not permitted: update)
ERROR error: impossible de pousser des références vers 'ssh://review.***:29418/**'
ERROR exit status 1

@hollesse
Copy link
Member

Hi @nbarbey could you give me some more information how gerrit works and how your gerrit is configured? I just tried it myself with a gerrit running locally with docker. There I am able to do a mob start and mob next. So are you just allowed to push to refs/for? Would it be ok to push there? As I understood gerrit this creates a code review for someone else. Is that a problem?

@nbarbey
Copy link
Author

nbarbey commented Mar 11, 2024

Hello @hollesse !
Thank you for answering this !
Yes, gerrit is set up at my company in a way that we are only allowed to push to refs/for.
Indeed, it creates a "code review"/"pull request" there. This is a mandatory step before merging the commit anyway.
So that would be ok to have the temporary branch of the session there I think.
Also there is a way to send to refs/for without triggering the CI tests by suffixing the branch name to %wip, putting the code review into a "Work In Progress" state.

@hollesse
Copy link
Member

Okay it seems that we would need an configuration to create a custom git reference and if this is set use this instead of heads. Would you like to contribute and create a pull request for that @nbarbey ?

@nbarbey
Copy link
Author

nbarbey commented Mar 27, 2024

I tried this a bit. I struggled to warp my head into the code with the little time I had. When I stopped it seemed to me that head was implicit in some of the calls to the git command but I could not figure out where.
Perhaps we should mob this out ;-)

@hollesse
Copy link
Member

@nbarbey correct the head is implicit right now. We would need to make it explicit and afterwards configurable.
I like the idea of doing it in a mob, but I need to check if I can find time for that. @gregorriegler Do you know if maybe you could find some time for that?

@hollesse hollesse added the enhancement New feature or request label Mar 27, 2024
@gregorriegler
Copy link
Collaborator

@hollesse I am up for it, but would have to be an evening. Something like 17:00 - 19:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants