google / google/copybara

git.github_pr_destination pr_branch parameter doesn't properly insert labels

Open
#317 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

The PR branch parameter to the Github PR destination currently only supports the `${CONTEXT_REFERENCE}`, and has no support for other labels.

As an example, I tried to use this configuration, to make the branch name clear.

```python
pr_branch = "public/copybara-${GITHUB_PR_USER}-${GITHUB_PR_NUMBER}",
```

However, instead of the intended result, I got `public/copybara-public/copybara-__GITHUB_PR_USER_-public/copybara-__GITHUB_PR_USER_-__GITHUB_PR_NUMBER_-public/copybara-__GITHUB_PR_USER_-__GITHUB_PR_NUMBER_`.

I believe the relevant code is located here:

https://github.com/google/copybara/blob/0a50f539d312d4fa2d9c9ef12eed4d9102c4758b/java/com/google/copybara/git/GitHubPrDestination.java#L401

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.