From cf547f3a3a3d18fb8758e1de7db872e3323b4865 Mon Sep 17 00:00:00 2001 From: j82w Date: Fri, 3 Apr 2020 09:28:52 -0700 Subject: [PATCH] [Internal] PR Requirements: Add PR title requirements to allow changelog generation (#1322) * Updating PR template with PR title as changelog To reduce conflicts and changelog mistakes the PR titles will be used as the changelog in the future. This will make is easier for users looking through the history and avoid merge conflicts on the changelog file. This will require the changelog to get generated for each release, but can be done as part of contract validation. * Updated based on feedback * Fixed grammar * More fixes * Adding pr lint action * Try single quotes to fix parse error * Trying to move it to build yaml * Try including all changes * Updating * Reverting changes * updated based on feedback * updating regex * Removing space * Updated based on user suggestion --- .github/workflows/prlint.yml | 15 +++++++++++++++ PULL_REQUEST_TEMPLATE.md | 16 ++++++++++++++++ azure-pipelines.yml | 5 ++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/prlint.yml diff --git a/.github/workflows/prlint.yml b/.github/workflows/prlint.yml new file mode 100644 index 0000000000..95c2f2071d --- /dev/null +++ b/.github/workflows/prlint.yml @@ -0,0 +1,15 @@ +name: PR Lint + +on: + pull_request: + types: [opened, edited, reopened] + +jobs: + pr-lint: + runs-on: ubuntu-latest + steps: + - uses: morrisoncole/pr-lint-action@v1.0.0 + with: + title-regex: '(\[Internal\] )?.{3}.+: (Add|Fix) .{3}.+' + on-failed-regex-comment: "Please follow the required format. [Internal] Category: (Add|Fix) Description" + repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index fc8637cf6b..734cb82295 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,21 @@ # Pull Request Template +## Pull Request Title +1. Changelog will be generated from PR titles. +2. PR titles will be formatted with the following layout. + 1. Internal is optional and represents changes with no public facing changes such as test only changes + 2. Category represents the area of the change like batch, changefeed, point operation, or query + 3. Add or Fix identifies if a new feature is being added or if a bug is being fixed + 4. Description is a user friendly explanation of the change + +### Format +`[Internal] Category: (Add|Fix) Description` + +### Example +[Added] Diagnostics: GetElapsedClientLatency to CosmosDiagnostics +[Fixed] PartitionKey: null reference when using default(PartitionKey) +[Internal] Added Query: code generator for CosmosNumbers for easy additions in the future. + ## Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9849e470df..fa74ff394f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,8 +8,7 @@ pr: - releases/* paths: include: - - Microsoft.Azure.Cosmos/* - - NuGet.config + - /* variables: DebugArguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional" --verbosity normal ' @@ -22,7 +21,7 @@ jobs: parameters: BuildConfiguration: Release VmImage: $(VmImage) - + #- template: templates/build-test.yml # parameters: