From 89d38a869aff35451b4c4023de07a001e0f96756 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Fri, 14 Oct 2022 16:58:03 +0000 Subject: [PATCH 1/2] Add changelog and changelog verifier Signed-off-by: Harsha Vamsi Kalluri --- .github/pull_request_template.md | 16 ++++++++++++++++ .github/workflows/changelog_verifier.yml | 18 ++++++++++++++++++ CHANGELOG.md | 19 +++++++++++++++++++ CONTRIBUTING.md | 18 ++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/changelog_verifier.yml create mode 100644 CHANGELOG.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..387312dc1 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,16 @@ +### Description +[Describe what this change achieves] + +### Issues Resolved +[List any issues this PR will resolve] + +### Check List +- [ ] New functionality includes testing. + - [ ] All tests pass. +- [ ] New functionality has been documented. + - [ ] New functionality has comments added. +- [ ] Commits are signed per the DCO using --signoff. +- [ ] [CHANGELOG](https://github.com/opensearch-project/opensearch-js/blob/main/CONTRIBUTING.md#changelog) has been updated. + +By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. +For more information on following the Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/opensearch-js/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). \ No newline at end of file diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml new file mode 100644 index 000000000..96f99f17b --- /dev/null +++ b/.github/workflows/changelog_verifier.yml @@ -0,0 +1,18 @@ +name: "Changelog Verifier" +on: + pull_request: + types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled] + +jobs: + # Enforces the update of a changelog file on every pull request + verify-changelog: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha }} + + - uses: dangoslen/changelog-enforcer@v3 + with: + skipLabels: "autocut" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..ec8724b22 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# CHANGELOG +Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + +## [Unreleased] +### Added +- Github workflow for changelog verification ([#306](https://github.com/opensearch-project/opensearch-js/pull/306)) + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + + +[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.0...HEAD \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9d13e47d..4f4295d13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,6 +5,8 @@ - [Feature Requests](#feature-requests) - [Contributing Code](#contributing-code) - [Developer Certificate of Origin](#developer-certificate-of-origin) +- [Changelog](#changelog) + - [Adding changes](#adding-changes) - [Review Process](#review-process) ## Contributing to OpenSearch @@ -84,6 +86,22 @@ Signed-off-by: Jane Smith You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message. +## Changelog + +OpenSearch-Js maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. + +The changes are curated by version, with the changes to the main branch added chronologically to the `Unreleased` version. Each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. + + +### Adding changes + +As a contributor, you must ensure that every pull request has its changes listed out within the corresponding version and appropriate section of the [CHANGELOG](CHANGELOG.md) file. + +Adding in the change is a two step process - +1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR. + +2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there. + ## Review Process We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/opensearch-js/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. From 5136c4b8d2bb3153c60b77f35c367ed5352151e7 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Thu, 20 Oct 2022 02:34:23 +0000 Subject: [PATCH 2/2] Adding dependabot changelog PR workflow Signed-off-by: Harsha Vamsi Kalluri --- .github/dependabot.yml | 3 +++ .github/pull_request_template.md | 16 ------------- .github/workflows/dependabot_pr.yml | 37 +++++++++++++++++++++++++++++ CONTRIBUTING.md | 6 ++--- 4 files changed, 43 insertions(+), 19 deletions(-) delete mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/dependabot_pr.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a1732e224..e86a31156 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,4 +4,7 @@ updates: package-ecosystem: npm schedule: interval: weekly + labels: + - "dependabot" + - "dependencies" version: 2 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 387312dc1..000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description -[Describe what this change achieves] - -### Issues Resolved -[List any issues this PR will resolve] - -### Check List -- [ ] New functionality includes testing. - - [ ] All tests pass. -- [ ] New functionality has been documented. - - [ ] New functionality has comments added. -- [ ] Commits are signed per the DCO using --signoff. -- [ ] [CHANGELOG](https://github.com/opensearch-project/opensearch-js/blob/main/CONTRIBUTING.md#changelog) has been updated. - -By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. -For more information on following the Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/opensearch-js/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). \ No newline at end of file diff --git a/.github/workflows/dependabot_pr.yml b/.github/workflows/dependabot_pr.yml new file mode 100644 index 000000000..f13889c13 --- /dev/null +++ b/.github/workflows/dependabot_pr.yml @@ -0,0 +1,37 @@ +name: Dependabot PR actions +on: pull_request + +jobs: + dependabot: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + + - name: Check out code + uses: actions/checkout@v2 + with: + token: ${{ steps.github_app_token.outputs.token }} + + - name: Update the changelog + uses: dangoslen/dependabot-changelog-helper@v1 + with: + version: 'Unreleased' + + - name: Commit the changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Update changelog" + branch: ${{ github.head_ref }} + commit_user_name: dependabot[bot] + commit_user_email: support@github.com + commit_options: '--signoff' \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f4295d13..9b6f6370d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ - [Contributing Code](#contributing-code) - [Developer Certificate of Origin](#developer-certificate-of-origin) - [Changelog](#changelog) - - [Adding changes](#adding-changes) + - [Adding Changes](#adding-changes) - [Review Process](#review-process) ## Contributing to OpenSearch @@ -88,12 +88,12 @@ You may type this line on your own when writing your commit messages. However, i ## Changelog -OpenSearch-Js maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. +OpenSearch-js maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. The changes are curated by version, with the changes to the main branch added chronologically to the `Unreleased` version. Each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. -### Adding changes +### Adding Changes As a contributor, you must ensure that every pull request has its changes listed out within the corresponding version and appropriate section of the [CHANGELOG](CHANGELOG.md) file.