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

Add parameters for making PRs back to GitHub from OneLocBuild #7479

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Documentation/OneLocBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ Onboarding to OneLocBuild is a simple process:
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-YOURREPO'
```
7. Merge the changes to your main branch and then open a
7. If using a mirrored repository (your code is mirrored to a trusted repository which your official build uses),
add the following parameter to your YAML (subbing e.g. `sdk` for the value):
```yaml
MirrorRepo: {{name of your GitHub repository}}
jonfortescue marked this conversation as resolved.
Show resolved Hide resolved
```
8. Merge the changes to your main branch and then open a
[repo modification ticket](https://ceapex.visualstudio.com/CEINTL/_workitems/create/Loc%20Request?templateId=415a0569-35ed-45c3-9321-8b1affff1f52&ownerId=c2e38d3d-0e9e-429f-955d-6e39fc6f0457)
with the loc team to let them know to retarget the branch.

As of 12 May 2021, if your repository is mirrored to internal with Maestro, you will also need to keep
`CreatePr: false` in your YAML. Currently, OneLocBuild does not support our scenario. The step to create a PR back to
GitHub expects a GitHub repository with the same name as the internal repo, so the step to create PRs fails,
breaking the build. Thus, we turn off automated PR creation to skip this step and we are creating PRs manually prior to
releases as a workaround. Please [get a hold of Engineering Services](https://github.com/dotnet/core-eng/wiki/How-to-get-a-hold-of-Engineering-Servicing)
so that you can be updated when automated PR creation is supported.


## Releasing with OneLocBuild Using Arcade

Expand Down Expand Up @@ -134,6 +134,9 @@ The parameters that can be passed to the template are as follows:
| `CreatePr` | `true` | When set to `true`, instructs the OneLocBuild task to make a PR back to the source repository containing the localized files. |
| `AutoCompletePr` | `false` | When set to `true`, instructs the OneLocBuild task to autocomplete the created PR. Requires permissions to bypass any checks on the main branch. |
| `UseLfLineEndings` | `true` | When set to `true`, instructs the OneLocBuild task to use LF line endings during check-in rather than CRLF. |
| `GitHubOrg` | `'dotnet'` | The GitHub org to be used when making a PR from a mirrored repository. |
jonfortescue marked this conversation as resolved.
Show resolved Hide resolved
jonfortescue marked this conversation as resolved.
Show resolved Hide resolved
| `MirrorRepo` | `''` | The name of the GitHub repository to make a PR to (when using a mirrored repository). |
| `MirrorBranch` | `'main'` | The branch on GitHub to make a PR to (when using a mirrored repository). |
| `UseCheckedInLocProjectJson` | `false` | When set to `true`, instructs the LocProject.json generation script to use build-time validation rather than build-time generation, as described above. |
| `LanguageSet` | `VS_Main_Languages` | This defines the `LanguageSet` of the LocProject.json as described in the [OneLocBuild task documentation](https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task?anchor=languageset%2C-languages-(required)). |
| `LclSource` | `LclFilesInRepo` | This passes the `LclSource` input to the OneLocBuild task as described in [its documentation](https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task?anchor=languageset%2C-languages-(required)). For most repos, this should be set to `LclFilesfromPackage`. |
Expand Down
8 changes: 8 additions & 0 deletions eng/common/templates/job/onelocbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ parameters:
LclSource: lclFilesInRepo
LclPackageId: ''
RepoType: gitHub
GitHubOrg: dotnet
MirrorRepo: ''
MirrorBranch: main
condition: ''

jobs:
Expand Down Expand Up @@ -66,6 +69,11 @@ jobs:
${{ if eq(parameters.RepoType, 'gitHub') }}:
repoType: ${{ parameters.RepoType }}
gitHubPatVariable: "${{ parameters.GithubPat }}"
${{ if ne(parameters.MirrorRepo, '') }}:
isMirrorRepoSelected: true
gitHubOrganization: ${{ parameters.GitHubOrg }}
mirrorRepo: ${{ parameters.MirrorRepo }}
mirrorBranch: ${{ parameters.MirrorBranch }}
condition: ${{ parameters.condition }}

- task: PublishBuildArtifacts@1
Expand Down