From 7e892154d4a041a29ba35e9a9edee3862d0ba82a Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Tue, 4 Feb 2025 10:52:01 -0800 Subject: [PATCH] Add changelog verifier workflow (#974) Signed-off-by: Owais (cherry picked from commit 0645781acfca788edd81ab36167ddf0a49e9917f) Signed-off-by: Owais --- .github/workflows/changelog_verifier.yml | 27 +++++++++++++++++++++++ CHANGELOG.md | 28 ++++++++++++++++++++++++ DEVELOPER_GUIDE.md | 18 +++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .github/workflows/changelog_verifier.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml new file mode 100644 index 00000000..3bc1ae5b --- /dev/null +++ b/.github/workflows/changelog_verifier.yml @@ -0,0 +1,27 @@ + +Viewed +Original file line number Diff line number Diff line change +@@ -0,0 +1,23 @@ +name: "Changelog Verifier" +on: + push: + branches-ignore: + - 'whitesource-remediate/**' + - 'backport/**' + 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: + if: github.repository == 'opensearch-project/anomaly-detection' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha }} + + - uses: dangoslen/changelog-enforcer@v3 + with: + skipLabels: "autocut, skip-changelog" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..85dc59ee --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# CHANGELOG +All notable changes to this project are documented in this file. + +Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) + +## [Unreleased 3.0](https://github.com/opensearch-project/anomaly-detection/compare/2.x...HEAD) +### Features +### Enhancements +### Bug Fixes +### Infrastructure + +### Documentation + +### Maintenance +### Refactoring + +## [Unreleased 2.x](https://github.com/opensearch-project/anomaly-detection/compare/2.19...2.x) +### Features + + +### Enhancements +- Github workflow for changelog verification ([#974](https://github.com/opensearch-project/anomaly-detection/pull/974)) +### Bug Fixes + +### Infrastructure +### Documentation +### Maintenance +### Refactoring \ No newline at end of file diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 39b84580..a0bd34b0 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -9,6 +9,7 @@ - [Integration Tests](#integration-tests) - [Formatting](#formatting) - [Backports](#backports) + - [Changelog](#changelog) ## Developer guide @@ -94,3 +95,20 @@ original PR with an appropriate label `backport ` is merge run successfully on the PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR to the `1.x` branch. + +## Changelog + +AD dashboards maintains 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.1.0/) format. + +Briefly, the changes are curated by version, with the changes to the main branch added chronologically to `Unreleased` version. Further, each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. + +#### How to add my changes to [CHANGELOG](CHANGELOG.md)? + +As a contributor, you must ensure that every pull request has the changes listed out within the corresponding version and appropriate section of [CHANGELOG](CHANGELOG.md) file. + +Adding in the change is two step process - +1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR + +`Your change here ([#PR_NUMBER](PR_URL))` + +2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there. \ No newline at end of file