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

Update Eng/Common Workflow #899

Merged
merged 2 commits into from
Aug 19, 2020
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
13 changes: 12 additions & 1 deletion eng/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,15 @@ should not contain binary files as they don't play well with git.
Any updates to files in the `eng/common` directory should be made in the [azure-sdk-tools](https://github.com/azure/azure-sdk-tools) repo.
All changes made will cause a PR to created in all subscribed azure-sdk language repos which will blindly replace all contents of
the `eng/common` directory in that repo. For that reason do **NOT** make changes to files in this directory in the individual azure-sdk
languages repos as they will be overwritten the next time an update is taken from the common azure-sdk-tools repo.
languages repos as they will be overwritten the next time an update is taken from the common azure-sdk-tools repo.

### Workflow

The 'Sync eng/common directory' PRs will be created in the language repositories once a pull request that touches the eng/common directory is submitted against the master branch. This will make it easier for changes to be tested in each individual language repo before merging the changes in the azure-sdk-tools repo. The workflow is explained below:

1. Create a PR against Azure/azure-sdk-tools:master. This is the **Tools PR**.
2. `azure-sdk-tools - sync - eng-common` is run automatically. It creates **Sync PRs** in each of the connected language repositories using the format `Sync eng/common directory with azure-sdk-tools for PR {Tools PR Number}`. Each **Sync PR** will contain a link back to the **Tools PR** that triggered it.
3. More changes pushed to the **Tools PR**, will automatically triggered new pipeline runs in the respective **Sync PRs**. The **Sync PRs** are used to make sure the changes would not break any of the connected pipelines.
4. Once satisfied with the changes;
- First merge all the **Sync PRs**. The **Tools PR** contains links to all the **Sync PRs**
weshaggard marked this conversation as resolved.
Show resolved Hide resolved
- Finally merge the **Tools PR**. Each **Sync PR** contains the link to the corresponding **Tools PR**.
weshaggard marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions eng/common/pipelines/templates/steps/create-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parameters:
PushArgs:
WorkingDirectory: $(System.DefaultWorkingDirectory)
PRTitle: not-specified
PRBody: not-specified
ScriptDirectory: eng/common/scripts
GHReviewersVariable: ''
GHTeamReviewersVariable: ''
Expand Down Expand Up @@ -65,6 +66,7 @@ steps:
-PRBranch "${{ parameters.PRBranchName }}"
-AuthToken "$(azuresdk-github-pat)"
-PRTitle "${{ parameters.PRTitle }}"
-PRBody "${{ parameters.PRBody }}"

- task: PowerShell@2
displayName: Tag a Reviewer on PR
Expand Down
3 changes: 2 additions & 1 deletion eng/common/scripts/Submit-PullRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ param(

[Parameter(Mandatory = $true)]
$PRTitle,
$PRBody = $PRTitle

$PRBody=$PRTitle
)

$headers = @{
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/eng-common-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
DirectoryToSync: "eng/common"
PRBranchName: "sync-eng-common-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)"
PRTitle: "Sync eng/common directory with azure-sdk-tools for PR $(System.PullRequest.PullRequestNumber)"
PRBody: >-
Sync eng/common directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber) <br>
See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)
Repos:
- azure-sdk-for-android
- azure-sdk-for-c
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/sync-directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ parameters:
PRBranchName: branch-name-not-set
BaseBranchName: master
PRTitle: pr-title-not-set
PRBody: pr-body-not-set

steps:

Expand All @@ -28,6 +29,7 @@ steps:
BaseBranchName: ${{ parameters.BaseBranchName }}
CommitMsg: ${{ parameters.CommitMessage }}
PRTitle: ${{ parameters.PRTitle }}
PRBody: ${{ parameters.PRBody }}
PushArgs: -f
WorkingDirectory: $(System.DefaultWorkingDirectory)/${{ repo }}
ScriptDirectory: $(System.DefaultWorkingDirectory)/eng/common/scripts