lindell / multi-gitter

Update multiple repositories in with one command
Apache License 2.0
819 stars 64 forks source link

Add Azure DevOps VersionController #476

Open rerikson opened 2 months ago

rerikson commented 2 months ago

What does this change

This adds a new VersionController implementation for Azure DevOps

For example if it introduces a new flag or modifies a commands output, give an example of you running the command and showing real output here.

Redacted Command

 multi-gitter  run ./examples/general/replace.sh  --conflict-strategy replace --git-type cmd -m "test message" --token <faketoken> -g https://dev.azure.com/<my-org> -p azuredevops -R <ProjectName>/<RepoName> reviewers test@mydomain.com

Redacted Output

INFO[0001] Running on 1 repositories                    
INFO[0001] Cloning and running script                    repo=<MyProject>/<MyRepo>
INFO[0003] Pushing changes to remote                     repo=<MyProject>/<MyRepo>
INFO[0004] Creating pull request                         repo=<MyProject>/<MyRepo>

What issue does it fix

Closes #475

If there is not an existing issue, please make sure we have context on why this change is needed. .

Notes for the reviewer

go is not my main language, but hopefully this is pretty close to what you would be looking for in a new VersionController for AzureDevops. I tried my best to follow existing implementations, but I'm happy to make any changes!

Checklist

lindell commented 2 months ago

Thanks for the PR! I will take a closer look in the coming days.

Just briefly browsing the cmd/ change I noticed the naming of things in Azure Devops seems to colide with the naming of GitLab. Just to make sure I understand the terminology correctly. Is this how things are named?

Github GitLab Azure Devops
Repository Project Repository
Organization Group (hierarchical) Project

So in Azure Devops the only levels are Repositories that can be within one project? There are no stacking projects, and no higher level (organizations etc)?

rerikson commented 2 months ago

Hey thanks for the question! I tried to make the naming in the code match the naming in Azure DevOps and you're right it does collide with GitLab. The chart you made of Github/GitLab/Azure DevOps is correct. Azure DevOps does have the concept of organizations, but each organization would have a different base url and is pretty much a totally separate entity. There are no stacked/sub projects either.

rerikson commented 2 months ago

Hey @lindell, no rush on the rest of the code review, but just wanted to let you know I pushed up a commit to address the comments so far.

lindell commented 1 month ago

Tried to review through vscode, apparently it posts every comment and not together. Sorry if this was spammy to you.

rerikson commented 6 days ago

Thank you very much for the thorough PR and being kind to my go code! Also, sorry it took so long for me to get back to this. I'll try and get any remaining changes fixed much faster. Any changes I pushed up I closed the conversation for and I left open any conversations that seemed like further discussion might be needed.

I think we're getting close on this!