From 050a0fe013a6f6772f4ba3b1900817545b5e6155 Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 14 Jun 2021 13:45:07 -0700 Subject: [PATCH 1/5] Incorporate feedback on OneLocBuild doc --- Documentation/OneLocBuild.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index 9a5b7b4f890..95c703fe615 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -37,8 +37,13 @@ Onboarding to OneLocBuild is a simple process: 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}} + MirrorRepo: {{name of your GitHub repository, e.g. 'sdk'}} ``` +This naming might be confusing for repositories using code mirroring through Maestro, as typically the "mirror repository" +refers to the trusted Azure DevOps repository our GitHub repositories mirror to. In this case, however, it refers to the GitHub repository which is a _mirror of_ the Azure DevOps repository that the official build is based on. + +As a further note, the template by default assumes that your mirror repository is located in the dotnet GitHub organization. If that is not the case, you will need to specify `GitHubOrg` as well. + 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. From 77cfe6ff02bd1dd25c7ab39a6064fffa7224e9e1 Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 14 Jun 2021 13:48:22 -0700 Subject: [PATCH 2/5] Line breaks --- Documentation/OneLocBuild.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index 95c703fe615..b3895d73cfd 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -39,10 +39,13 @@ Onboarding to OneLocBuild is a simple process: ```yaml MirrorRepo: {{name of your GitHub repository, e.g. 'sdk'}} ``` -This naming might be confusing for repositories using code mirroring through Maestro, as typically the "mirror repository" -refers to the trusted Azure DevOps repository our GitHub repositories mirror to. In this case, however, it refers to the GitHub repository which is a _mirror of_ the Azure DevOps repository that the official build is based on. +This naming might be confusing for repositories using code mirroring through Maestro, as typically the +"mirror repository" refers to the trusted Azure DevOps repository our GitHub repositories mirror to. +In this case, however, it refers to the GitHub repository which is a _mirror of_ the Azure DevOps repository +that the official build is based on. -As a further note, the template by default assumes that your mirror repository is located in the dotnet GitHub organization. If that is not the case, you will need to specify `GitHubOrg` as well. +As a further note, the template by default assumes that your mirror repository is located in the dotnet GitHub +organization. If that is not the case, you will need to specify `GitHubOrg` as well. 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) From f28e07c823ca796b575ec909b554ae7b2fc6edca Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 14 Jun 2021 13:54:26 -0700 Subject: [PATCH 3/5] Update Documentation/OneLocBuild.md Co-authored-by: Ben Villalobos <4691428+BenVillalobos@users.noreply.github.com> --- Documentation/OneLocBuild.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index b3895d73cfd..6161648e7e8 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -41,7 +41,7 @@ Onboarding to OneLocBuild is a simple process: ``` This naming might be confusing for repositories using code mirroring through Maestro, as typically the "mirror repository" refers to the trusted Azure DevOps repository our GitHub repositories mirror to. -In this case, however, it refers to the GitHub repository which is a _mirror of_ the Azure DevOps repository +In this case, however, it refers to the repository that _mirrors to_ the Azure DevOps repository that the official build is based on. As a further note, the template by default assumes that your mirror repository is located in the dotnet GitHub From a7b8d7edeea38277291f628ccf4d8f97dde8346e Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 14 Jun 2021 15:14:53 -0700 Subject: [PATCH 4/5] Change up a bit --- Documentation/OneLocBuild.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index b3895d73cfd..b5b7078c9cd 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -34,10 +34,11 @@ Onboarding to OneLocBuild is a simple process: LclSource: lclFilesfromPackage LclPackageId: 'LCL-JUNO-PROD-YOURREPO' ``` +Make sure to remove the `CreatePr: false` line from step 2. 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, e.g. 'sdk'}} + MirrorRepo: name of your GitHub repository, e.g. 'sdk' ``` This naming might be confusing for repositories using code mirroring through Maestro, as typically the "mirror repository" refers to the trusted Azure DevOps repository our GitHub repositories mirror to. From 3687145a23a4b938604b025f1d417df478b8f957 Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 14 Jun 2021 15:26:16 -0700 Subject: [PATCH 5/5] Add additional clarification --- Documentation/OneLocBuild.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index 531db261068..edcd824c5dc 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -20,6 +20,12 @@ Onboarding to OneLocBuild is a simple process: parameters: CreatePr: false ``` +Note: If you are running your PR builds and official builds off of the same definition and are on dnceng, +you will want to conditionalize this step with the following: +```yaml +- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: +``` +To prevent OneLocBuild from running in the public project where it will fail. 3. Run the pipeline you want to use OneLocBuild on your test branch. 4. Open a ticket with the localization team using [this template](https://ceapex.visualstudio.com/CEINTL/_workitems/create/Loc%20Request?templateId=60b0dcf9-9892-4910-934e-d5becddd1bc1&ownerId=c2e38d3d-0e9e-429f-955d-6e39fc6f0457). @@ -28,13 +34,18 @@ Onboarding to OneLocBuild is a simple process: `LCL-JUNO-PROD-YOURREPO`. 6. Change your YAML (subbing `'LCL-JUNO-PROD-YOURREPO'` for the package ID given to you) to: ```yaml -- {{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: +- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: - template: /eng/common/templates/job/onelocbuild.yml parameters: LclSource: lclFilesfromPackage LclPackageId: 'LCL-JUNO-PROD-YOURREPO' ``` -Make sure to remove the `CreatePr: false` line from step 2. +Make sure to remove the `CreatePr: false` line from step 2. Additionally, if you added the YAML condition from step +2, make sure that your new YAML condition now looks like: +```yaml +- ${{ if and(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}: +``` + 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