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

Suggestions for improving GitHub PR to Gerrit CR workflow? #249

Open
yang opened this issue Aug 31, 2023 · 0 comments
Open

Suggestions for improving GitHub PR to Gerrit CR workflow? #249

yang opened this issue Aug 31, 2023 · 0 comments

Comments

@yang
Copy link

yang commented Aug 31, 2023

Thank you for this wonderful tool!

I have a GitHub PR to Gerrit CR workflow, and am wondering about general advice to improve on this.

Workflow is simple, looks something like the below.

Issues:

  • Each time the PR is updated, this results in a new Change-ID and thus new Gerrit CR. Is there a way to have this update the existing CR rather than create a new one? Basically, to have the change-id be stable per PR number.
  • For the reviewers, how do you use GITHUB_PR_REVIEWER_APPROVER? I guess - is there any documentation available on how to use labels, repeated labels, etc. that the API reference mentions?
  • If user submits PR, copybara runs, and then user sets a reviewer—is there a way to also set the reviewer in Gerrit?
  • Any other suggested improvements or typical things you'd do in this setup?

Thank you!

core.workflow(
    name = "public_pr_to_private_cr",
    origin = git.github_pr_origin(
        url = publicUrl,
        #use_merge = True,
        #baseline_from_branch = True,
    ),
    destination = git.gerrit_destination(
        url = "https://plasmic.app/a/yangcopytest",
        fetch = 'master',
        reviewers = ['${GITHUB_PR_REVIEWER_APPROVER}']
    ),
    origin_files = glob(["studio/**"]),
    destination_files = glob(['**'], exclude = ["copy.bara.sky", "private"]),
    authoring = authoring.pass_thru("Copybara <[email protected]>"),
    mode = 'CHANGE_REQUEST',
    transformations = [
        core.move("studio", ""),
        metadata.replace_message(
                "${GITHUB_PR_TITLE}\n\n" +
                "${GITHUB_PR_BODY}\n\n" +
                "Closes #${GITHUB_PR_NUMBER}\n" +
                "https://github.com/yang/copytest/pull/${GITHUB_PR_NUMBER}",
                ),
    ],
)
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