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

Create new command darc vmr resolve-conflict #4353

Open
premun opened this issue Jan 21, 2025 · 0 comments
Open

Create new command darc vmr resolve-conflict #4353

premun opened this issue Jan 21, 2025 · 0 comments

Comments

@premun
Copy link
Member

premun commented Jan 21, 2025

Context

During VMR codeflows, when there are conflict in repo sources, the PR branch and the target branch will require the user to resolve the conflict.
However, since we won't be able to merge target branch into the PR branch automatically, there will also be conflicts in the version files.
This means that the dev will need to resolve these as well.

There is a danger that the dev will resolve the version files incorrectly and might break the code flow. For this reason, the PR will contain a comment which will guide the dev through the conflict resolution.
The instructions will contain steps to use darc to resolve the conflicts properly. Darc will resolve the version files conflict and let the user resolve the source file conflicts.

Goal

We want to add a new darc command darc vmr resolve-conflict. This command will:

  • It will be executed from the cloned repo
  • It will accept following options:
    • --pr [ID]
    • -s|--strategy pr|target|manual - a conflict resolution strategy (see modes below)
  • Work in 2 modes:
    1. Manual resolution - Resolve version files only (and let the user finalize the conflict resolution)
    2. Auto-resolution - Resolve the source code changes (accept the PR branch or the target branch versions)
  • It will do the following:
    • Read remotes from the git repo it runs from
    • Find the PR in the remotes (either AzDO or GitHub)
    • Query PCS to get the updates the PR contains (this is possible already via the new PR endpoint)
    • Checkout the PR branch and start the merge of the target branch
    • Apply the resolution strategy
      • For manual resolution, this will resolve the version files conflicts (just like the service would do it) and then stop - give user the next steps - resolve conflicts, commit, push
      • For auto resolution, resolve the conflicts using the strategy (see https://stackoverflow.com/a/71790279/25077134). Then stage, commit, push the PR branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant