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

Merge destination PR using CHANGE_REQUEST_FROM_SOT #292

Open
rainecp opened this issue Jun 17, 2024 · 0 comments
Open

Merge destination PR using CHANGE_REQUEST_FROM_SOT #292

rainecp opened this issue Jun 17, 2024 · 0 comments

Comments

@rainecp
Copy link

rainecp commented Jun 17, 2024

I have been testing Copybara and it's been working well for the following workflows:

  • importing PR from destination -> source PR using CHANGE_REQUEST
  • copying code from source main -> destination main using ITERATIVE mode and doing a fake merge on the destination PR if the source PR is merged

However, I also want to enable exporting PR from source -> destination workflow using CHANGE_REQUEST_FROM_SOT but I noticed this doesn't do a fake merge because the commits do not contain the label COPYBARA_INTEGRATE_REVIEW. It works if I manually amend the source PR commit to add this label and the link to the destination PR created. I also checked after_migration but can't seem to find a command to support this. I know that amending PR could trigger another workflow so it had to be done right before the source PR is merged. This doesn't seem like a common usage as I have not seen an example Cobybara config on this, is there a way to do this within Copybara?

core.workflow(
    name = "push_pr",
    origin = git.github_pr_origin(
        url = SOURCE_REPO,
        branch = BRANCH,
    ),
    origin_files = glob(SOURCE_INCLUDES, exclude = SOURCE_EXCLUDES),
    destination = git.github_pr_destination(
        url = DESTINATION_REPO,
        destination_ref = BRANCH,
        integrates = [],
        update_description = True,
    ),
    destination_files = glob(DESTINATION_INCLUDES, exclude = DESTINATION_EXCLUDES),
    authoring = AUTHOR,
    mode = "CHANGE_REQUEST_FROM_SOT",
    set_rev_id = False,
    transformations = core.reverse(transforms),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant