From 002e7be89c69c0be32039a9c0452e7df4bc7ded9 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Tue, 14 Nov 2023 17:12:43 -0500 Subject: [PATCH 001/141] Test commit Signed-off-by: Johnathon Bowers --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000000..e69de29bb2d1 From a074b34254d52701a0dc79c49a385f73c4be17c0 Mon Sep 17 00:00:00 2001 From: qiwen li Date: Tue, 14 Nov 2023 17:59:59 -0500 Subject: [PATCH 002/141] test commit to project branch from Signed-off-by: qiwen li --- test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test.txt b/test.txt index e69de29bb2d1..2f153caed8dd 100644 --- a/test.txt +++ b/test.txt @@ -0,0 +1 @@ +Riley \ No newline at end of file From 7d2cc219f00394f779b77cf2cef0ef2c263b71e4 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Fri, 17 Nov 2023 17:41:31 +0000 Subject: [PATCH 003/141] creating '/chanelogs/fragments' folder and adding change_set_template.yml file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/change_set_template.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/change_set_template.yml diff --git a/changelogs/change_set_template.yml b/changelogs/change_set_template.yml new file mode 100644 index 000000000000..c296a5f621e8 --- /dev/null +++ b/changelogs/change_set_template.yml @@ -0,0 +1 @@ +# Template From 8045014c59776a56ddd2835e631f76893deb9e98 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Fri, 17 Nov 2023 17:42:53 +0000 Subject: [PATCH 004/141] creating '/chanelogs/fragments' folder and adding 'change_set_template.yml' file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/change_set_template.yml | 1 - changelogs/fragments/change_set_template.yml | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 changelogs/change_set_template.yml create mode 100644 changelogs/fragments/change_set_template.yml diff --git a/changelogs/change_set_template.yml b/changelogs/change_set_template.yml deleted file mode 100644 index c296a5f621e8..000000000000 --- a/changelogs/change_set_template.yml +++ /dev/null @@ -1 +0,0 @@ -# Template diff --git a/changelogs/fragments/change_set_template.yml b/changelogs/fragments/change_set_template.yml new file mode 100644 index 000000000000..1a6fa32bf8fb --- /dev/null +++ b/changelogs/fragments/change_set_template.yml @@ -0,0 +1,7 @@ +# Template + +bugfixes: + - This is a sample fixed + +feature: + - Introduces a new feature From 7b249c98dc8774ff8b7ee2f4c66ed187d4638877 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Fri, 17 Nov 2023 19:22:01 +0000 Subject: [PATCH 005/141] updating 'change_set_template.yml' file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/change_set_template.yml | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/changelogs/fragments/change_set_template.yml b/changelogs/fragments/change_set_template.yml index 1a6fa32bf8fb..c5a336112cd4 100644 --- a/changelogs/fragments/change_set_template.yml +++ b/changelogs/fragments/change_set_template.yml @@ -1,7 +1,41 @@ # Template +# 💥 Breaking Changes +breaking: + - This is a breaking change + +# 🚨 Deprecations +deprecations: + - This is a deprecation change + +# 🛡 Security +security: + - This is a security change + +# 🐛 Bug Fixes bugfixes: - This is a sample fixed +# 📈 Features/Enhancements feature: - Introduces a new feature + +# 🚞 Infrastructure +infrastructure: + - This is an infrastructure change + +# 📝 Documentation +documentation: + - This is a documentation change + +# 🛠 Maintenance +maintenance: + - This is a maintenance change + +# 🪛 Refactoring +refactoring: + - This is a refactoring change + +# 🔩 Tests +tests: + - This is a test change From 048803809564c7553ae02293b0d493d4a3667036 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Tue, 21 Nov 2023 16:44:43 +0000 Subject: [PATCH 006/141] updating change set .yml template file according what agreed last meeting Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/change_set_template.yml | 52 +++++++------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/changelogs/fragments/change_set_template.yml b/changelogs/fragments/change_set_template.yml index c5a336112cd4..477a31afee4d 100644 --- a/changelogs/fragments/change_set_template.yml +++ b/changelogs/fragments/change_set_template.yml @@ -1,41 +1,23 @@ -# Template +# ######################################## +# Change set template +# Filename: _category_.yml +# ######################################## -# 💥 Breaking Changes -breaking: - - This is a breaking change +# category: , , , , , +# , , or +# merged: +# --- -# 🚨 Deprecations -deprecations: - - This is a deprecation change - -# 🛡 Security -security: - - This is a security change +# - ([#]()) -# 🐛 Bug Fixes -bugfixes: - - This is a sample fixed +# ######################################## +# Example +# Filename: 5465_infra_2023_11_10.yml +# ######################################## -# 📈 Features/Enhancements -feature: - - Introduces a new feature -# 🚞 Infrastructure -infrastructure: - - This is an infrastructure change +# category: infra +# merged: 2023-11-10 +# --- -# 📝 Documentation -documentation: - - This is a documentation change - -# 🛠 Maintenance -maintenance: - - This is a maintenance change - -# 🪛 Refactoring -refactoring: - - This is a refactoring change - -# 🔩 Tests -tests: - - This is a test change +# - Bump `chromedriver` from `107.0.3` to `119.0.1` ([#5465](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5465)) From 18a6555a8586b246826ff7c1839a71351e4778e0 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Tue, 21 Nov 2023 20:23:33 -0500 Subject: [PATCH 007/141] Add 'Changelog' section to PR template Signed-off-by: Johnathon Bowers --- .github/pull_request_template.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3cb6f172b119..1c16f9de7462 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,16 +2,32 @@ +### Changelog Entry + + + ### Issues Resolved -## Screenshot +### Screenshot -## Testing the changes +### Testing the changes \ No newline at end of file From 5207ba5f26cb6d5a9626b531bcf007c9ae8f9331 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 23 Nov 2023 18:02:07 +0000 Subject: [PATCH 015/141] removing dummy changesets Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/5889.yml | 5 ----- changelogs/fragments/5967.yml | 4 ---- changelogs/fragments/5990.yml | 2 -- changelogs/fragments/5995.yml | 7 ------ changelogs/fragments/change_set_template.yml | 23 -------------------- 5 files changed, 41 deletions(-) delete mode 100644 changelogs/fragments/5889.yml delete mode 100644 changelogs/fragments/5967.yml delete mode 100644 changelogs/fragments/5990.yml delete mode 100644 changelogs/fragments/5995.yml delete mode 100644 changelogs/fragments/change_set_template.yml diff --git a/changelogs/fragments/5889.yml b/changelogs/fragments/5889.yml deleted file mode 100644 index ab29e8ff6a4c..000000000000 --- a/changelogs/fragments/5889.yml +++ /dev/null @@ -1,5 +0,0 @@ -fix: - - fix 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5889](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5889)) - - fix 2 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5889](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5889)) -deprecate: - - deprecate 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5889](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5889)) diff --git a/changelogs/fragments/5967.yml b/changelogs/fragments/5967.yml deleted file mode 100644 index 1cf86357b9a2..000000000000 --- a/changelogs/fragments/5967.yml +++ /dev/null @@ -1,4 +0,0 @@ -feat: - - feat 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5967](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5967)) -doc: - - doc 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5967](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5967)) diff --git a/changelogs/fragments/5990.yml b/changelogs/fragments/5990.yml deleted file mode 100644 index 2f8fde055041..000000000000 --- a/changelogs/fragments/5990.yml +++ /dev/null @@ -1,2 +0,0 @@ -feat: - - feat 2 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5990](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5990)) diff --git a/changelogs/fragments/5995.yml b/changelogs/fragments/5995.yml deleted file mode 100644 index 56d0c6d1814e..000000000000 --- a/changelogs/fragments/5995.yml +++ /dev/null @@ -1,7 +0,0 @@ -doc: - - doc 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5995](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5995)) -feat: - - feat 3 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5995](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5995)) - - feat 4 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5995](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5995)) -infra: - - infra 1 - Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit ([#5995](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5995)) diff --git a/changelogs/fragments/change_set_template.yml b/changelogs/fragments/change_set_template.yml deleted file mode 100644 index 477a31afee4d..000000000000 --- a/changelogs/fragments/change_set_template.yml +++ /dev/null @@ -1,23 +0,0 @@ -# ######################################## -# Change set template -# Filename: _category_.yml -# ######################################## - -# category: , , , , , -# , , or -# merged: -# --- - -# - ([#]()) - -# ######################################## -# Example -# Filename: 5465_infra_2023_11_10.yml -# ######################################## - - -# category: infra -# merged: 2023-11-10 -# --- - -# - Bump `chromedriver` from `107.0.3` to `119.0.1` ([#5465](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5465)) From 806e427638dfb1e48ea050e0bd6f7ca5b68af19b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:05:53 +0000 Subject: [PATCH 016/141] Add changeset for PR #2 --- changelogs/fragments/changeset-2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelogs/fragments/changeset-2.yml b/changelogs/fragments/changeset-2.yml index 5c65d294d4b3..4e68930ab59f 100644 --- a/changelogs/fragments/changeset-2.yml +++ b/changelogs/fragments/changeset-2.yml @@ -4,6 +4,9 @@ fix: feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +test: +- test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + unknown: - skip --> \ No newline at end of file From f9497ff6345e0ba317b2ebfbf20236dae83ca632 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:05:54 +0000 Subject: [PATCH 017/141] Add changeset for PR #2 From e30f4a8bc1c62158293b35a519f4570dfdb3b6f1 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 23 Nov 2023 18:09:39 +0000 Subject: [PATCH 018/141] updating pull_request_template.md for changelog entries Signed-off-by: Samuel Valdes Gutierrez --- .github/pull_request_template.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1c16f9de7462..f59fa4f4bb00 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,32 +2,16 @@ -### Changelog Entry - - - ### Issues Resolved -### Screenshot +## Screenshot -### Testing the changes +## Testing the changes +## Changelog + + ### Check List - [ ] All tests pass From 5dc2433f1524b6dccbf18bf121e5a0ba1b7fee57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:10:45 +0000 Subject: [PATCH 019/141] Add changeset for PR #2 From d0209e98d52e7378e8792c5a675c80e70dc5912d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:18:35 +0000 Subject: [PATCH 020/141] Add changeset for PR #2 --- changelogs/fragments/changeset-2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/changeset-2.yml b/changelogs/fragments/changeset-2.yml index 4e68930ab59f..ea2110b8de9e 100644 --- a/changelogs/fragments/changeset-2.yml +++ b/changelogs/fragments/changeset-2.yml @@ -5,7 +5,7 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- testing a test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) unknown: - skip From 560cff8052a60e54824251c9c0c61b9fac2b6312 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:28:41 +0000 Subject: [PATCH 021/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..01612f6d5039 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,12 @@ +fix: +- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +unknown: +- skip +--> \ No newline at end of file From a9b64cd1e4ac268731491b03475317f9863a2815 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 23 Nov 2023 18:29:44 +0000 Subject: [PATCH 022/141] removing old changeset with wrong format Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/changeset-2.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 changelogs/fragments/changeset-2.yml diff --git a/changelogs/fragments/changeset-2.yml b/changelogs/fragments/changeset-2.yml deleted file mode 100644 index ea2110b8de9e..000000000000 --- a/changelogs/fragments/changeset-2.yml +++ /dev/null @@ -1,12 +0,0 @@ -fix: -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- testing a test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -- skip ---> \ No newline at end of file From caeb6c98e5eadddf5bad05f24117c1dad9e59628 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:30:19 +0000 Subject: [PATCH 023/141] Add changeset for PR #2 From c85d009dd2dc63225a2bf87ba21e56d443cf23f9 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 23 Nov 2023 18:39:35 +0000 Subject: [PATCH 024/141] adding change sets dummy files 1.yml, 3.yml and 4.yml Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/1.yml | 6 ++++++ changelogs/fragments/2.yml | 4 ---- changelogs/fragments/3.yml | 7 +++++++ changelogs/fragments/4.yml | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/1.yml create mode 100644 changelogs/fragments/3.yml create mode 100644 changelogs/fragments/4.yml diff --git a/changelogs/fragments/1.yml b/changelogs/fragments/1.yml new file mode 100644 index 000000000000..a0ca4f664458 --- /dev/null +++ b/changelogs/fragments/1.yml @@ -0,0 +1,6 @@ +fix: +- Updates the graph ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) +- Updates the picture ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) + +infra: +- testing ingra ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 01612f6d5039..211b02b9c5db 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -6,7 +6,3 @@ feat: test: - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -- skip ---> \ No newline at end of file diff --git a/changelogs/fragments/3.yml b/changelogs/fragments/3.yml new file mode 100644 index 000000000000..404ca8772b84 --- /dev/null +++ b/changelogs/fragments/3.yml @@ -0,0 +1,7 @@ +fix: +- Updates the graph ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) + +doc: +- Creating docs 1 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) +- Creating docs 2 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) +- Creating docs 3 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) diff --git a/changelogs/fragments/4.yml b/changelogs/fragments/4.yml new file mode 100644 index 000000000000..7d7e6cb909b3 --- /dev/null +++ b/changelogs/fragments/4.yml @@ -0,0 +1,2 @@ +refactor: +- Refactor huge code([#4](https://github.com/BigSamu/OpenSearch-Dashboards/pull/4)) From 8f11b83e74a09b358dfe8508740590c007bf9ef3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:41:01 +0000 Subject: [PATCH 025/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 211b02b9c5db..01612f6d5039 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -6,3 +6,7 @@ feat: test: - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +unknown: +- skip +--> \ No newline at end of file From cab6b50d4f05712a414e962e46c582c31147c91b Mon Sep 17 00:00:00 2001 From: Qiwen Li Date: Thu, 23 Nov 2023 16:12:44 -0500 Subject: [PATCH 026/141] fix a line in changeset 2.yml file, add scripting for updating the changelog.md and generate a opensearch-dashboards.release-notes-pkgVersion.md when we make a release, have not implemented deleting all the changeset files in the script Signed-off-by: Qiwen Li --- changelogs/fragments/2.yml | 9 +- package.json | 3 +- scripts/generate_release_note.js | 7 ++ src/dev/generate_release_note.ts | 148 +++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 scripts/generate_release_note.js create mode 100644 src/dev/generate_release_note.ts diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 01612f6d5039..1afabe25ef11 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,12 +1,11 @@ fix: -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + - Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) unknown: -- skip ---> \ No newline at end of file + - skip diff --git a/package.json b/package.json index b95306a049e7..2a0dca89da99 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,8 @@ "docs:acceptApiChanges": "scripts/use_node --max-old-space-size=6144 scripts/check_published_api_changes.js --accept", "osd:bootstrap": "scripts/use_node scripts/build_ts_refs && scripts/use_node scripts/register_git_hook", "spec_to_console": "scripts/use_node scripts/spec_to_console", - "pkg-version": "scripts/use_node -e \"console.log(require('./package.json').version)\"" + "pkg-version": "scripts/use_node -e \"console.log(require('./package.json').version)\"", + "release_note:generate": "scripts/use_node scripts/generate_release_note" }, "repository": { "type": "git", diff --git a/scripts/generate_release_note.js b/scripts/generate_release_note.js new file mode 100644 index 000000000000..35a1581fea6d --- /dev/null +++ b/scripts/generate_release_note.js @@ -0,0 +1,7 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +require('../src/setup_node_env'); +require('../src/dev/generate_release_note'); diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts new file mode 100644 index 000000000000..95b89c98f375 --- /dev/null +++ b/src/dev/generate_release_note.ts @@ -0,0 +1,148 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { resolve } from 'path'; +import { readFileSync, writeFileSync, readdirSync } from 'fs'; +import { load as loadYaml } from 'js-yaml'; +import { version as pkgVersion } from '../../package.json'; + +// Path to the file +const filePath = resolve(__dirname, '..', '..', 'CHANGELOG.md'); + +function addContentAfterUnreleased(path: string, newContent: string): void { + // Read the existing content of the file + let fileContent = readFileSync(path, 'utf8'); + + // Define the target string to search for + const targetString = '## [Unreleased]'; + + // Find the index of the target string + const targetIndex = fileContent.indexOf(targetString); + if (targetIndex !== -1) { + // Find the end of the line containing the target string + const endOfLineIndex = fileContent.indexOf('\n', targetIndex); + + if (endOfLineIndex !== -1) { + // Insert the new content after the end of the target line + fileContent = + fileContent.slice(0, endOfLineIndex + 1) + + '\n' + + newContent + + fileContent.slice(endOfLineIndex + 1); + } else { + // eslint-disable-next-line no-console + console.warn('End of line for target string not found.'); + return; + } + } else { + // eslint-disable-next-line no-console + console.warn("'## [Unreleased]' not found in the file."); + return; + } + + // Write the modified content back to the file + writeFileSync(path, fileContent); +} + +function getCurrentDateFormatted(): string { + const now = new Date(); + const year = now.getFullYear(); + const month = now.getMonth() + 1; // Months are 0-based + const day = now.getDate(); + + // Pad the month and day with leading zeros if necessary + const formattedMonth = month < 10 ? `0${month}` : `${month}`; + const formattedDay = day < 10 ? `0${day}` : `${day}`; + + return `${year}-${formattedMonth}-${formattedDay}`; +} + +const currentDate = getCurrentDateFormatted(); + +const SECTION_MAPPING = { + breaking: '💥 Breaking Changes', + deprecate: 'Deprecations', + security: '🛡 Security', + feat: '📈 Features/Enhancements', + fix: '🐛 Bug Fixes', + infra: '🚞 Infrastructure', + doc: '📝 Documentation', + chore: '🛠 Maintenance', + refactor: '🪛 Refactoring', + test: '🔩 Tests', +}; + +const SECTION_KEYS = Object.keys(SECTION_MAPPING); +type SectionKey = keyof typeof SECTION_MAPPING; +type Changelog = Record; + +// const sections: Partial = {}; +const sections: Changelog = { + breaking: [], + deprecate: [], + security: [], + feat: [], + fix: [], + infra: [], + doc: [], + chore: [], + refactor: [], + test: [], +}; + +const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); +const fragmentPaths = readdirSync(fragmentDirPath).filter( + (path) => path.endsWith('.yml') || path.endsWith('.yaml') +); + +for (const fragmentFilename of fragmentPaths) { + const fragmentPath = resolve(fragmentDirPath, fragmentFilename); + const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); + const fragmentYaml = loadYaml(fragmentContents) as Changelog; + + // const prNumber = fragmentFilename.split('.').slice(0, -1).join('.'); + + for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { + if (!SECTION_KEYS.includes(sectionKey)) { + // shouldnt be any unknown section coz they are handled during the changesets generation + // eslint-disable-next-line no-console + console.log(`Unknown section ${sectionKey} with skip. SKipping`); + continue; + } + + const section = sections[sectionKey as SectionKey] || (sections[sectionKey as SectionKey] = []); + section.push(...entries); + } +} + +const changelogSections = []; + +for (const [sectionKey, entries] of Object.entries(sections)) { + const sectionName = SECTION_MAPPING[sectionKey as SectionKey]; + if (entries.length === 0) { + changelogSections.push(`### ${sectionName}`); + continue; + } + changelogSections.push(`### ${sectionName} + +${entries.map((entry) => ` - ${entry}`).join('\n')}`); +} + +const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) + +${changelogSections.join('\n\n')} +`; +// generate the release note in the /release-notes folder +const REALEASENOTE_FILENAME = `opensearch-dashboards.release-notes-${pkgVersion}.md`; +const REALEASENOTE_HEADER = `# VERSION ${pkgVersion} Release Note`; +const releasenote = `${REALEASENOTE_HEADER} + +${changelogSections.join('\n\n')} +`; +// console.log(`${changelogSections.join('\n\n')}`); +// console.log(resolve(__dirname, '..', '..', 'release-notes', REALEASENOTE_FILENAME)); +writeFileSync(resolve(__dirname, '..', '..', 'release-notes', REALEASENOTE_FILENAME), releasenote); +// writeFileSync(resolve(__dirname, '..', '..', 'CHANGELOG.md'), changelog + fileContent); +addContentAfterUnreleased(filePath, changelog); From 932c8cbbf848f47ef54ab1b0d18e469bdcc3b26c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:16:04 +0000 Subject: [PATCH 027/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 1afabe25ef11..01612f6d5039 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,11 +1,12 @@ fix: - - Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: - - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: - - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) unknown: - - skip +- skip +--> \ No newline at end of file From c2b9ac1fe782afb930a5e1a6dcbb6d2bb7f4340d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 22:05:16 +0000 Subject: [PATCH 028/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 01612f6d5039..1f4ba3133622 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -8,5 +8,4 @@ test: - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) unknown: -- skip ---> \ No newline at end of file +- skip \ No newline at end of file From 205f0a1d1d2fa5e69670ab0a66c502380c5c253c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:04:28 +0000 Subject: [PATCH 029/141] Add changeset for PR #2 From d5a37dc12ece167361f5ed89657a584b76e40440 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:07:04 +0000 Subject: [PATCH 030/141] Add changeset for PR #2 From 0b25ce377616831d1f27536f257d522bfc20503e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:13:22 +0000 Subject: [PATCH 031/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 1f4ba3133622..ef6c94fafd4c 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -4,6 +4,9 @@ fix: feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +doc: +- Adds new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + test: - testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) From 915ac6444294ab970b7426854cb60c81124b3e21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:17:51 +0000 Subject: [PATCH 032/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index ef6c94fafd4c..2cca4d00b0e5 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,14 +1,18 @@ fix: - Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +unknown: +- skip +--> +- skip doc: - Adds new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -- skip \ No newline at end of file +- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From a19b5271c1016a4b8702cbabae728d759d1eb571 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:47:29 +0000 Subject: [PATCH 033/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 2cca4d00b0e5..e753692f010d 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,18 +1,11 @@ fix: -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- This is a fix ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -- skip ---> -- skip - -doc: -- Adds new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- This is a feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- testing a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- This is a test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +unknown: +- skip \ No newline at end of file From 4efcc6d7533771499b266325347285c604f85484 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 14:04:06 +0000 Subject: [PATCH 034/141] Add changeset for PR #2 From 245b559990e2cdc1c14afbec75209eb4c9408c6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 14:08:47 +0000 Subject: [PATCH 035/141] Add changeset for PR #2 From 6b7409776be2dc0d21ee76c073cde3f7ddc3bc6f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 14:39:21 +0000 Subject: [PATCH 036/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index e753692f010d..49e68151e555 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,11 +1,8 @@ fix: -- This is a fix ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: -- This is a feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- This is a test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -- skip \ No newline at end of file +- test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 034b742d0060085dc72f922bff1612678ae9932d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:28:22 +0000 Subject: [PATCH 037/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 49e68151e555..6bfc8dbcde8b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,4 +5,4 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From d82cfca2f3f133dd152625ea51b6f281abb867b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:29:35 +0000 Subject: [PATCH 038/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 6bfc8dbcde8b..c683e824de96 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,7 +2,4 @@ fix: - Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From bdaba2f7e98b121dd4efe813a8e387c02345b2e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:29:40 +0000 Subject: [PATCH 039/141] Add changeset for PR #2 From ec41ec0e6854e33f3adbbaca544b93299cf196c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 02:56:38 +0000 Subject: [PATCH 040/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index c683e824de96..a8685c4587f4 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,4 +2,7 @@ fix: - Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From e3840817bc4dffa45fd9433d65e13fc4dfa91f0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:46:59 +0000 Subject: [PATCH 041/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index a8685c4587f4..4abbaa1563fd 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -4,5 +4,11 @@ fix: feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +test: +- test test test3 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + doc: -- new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +unknown: +## \ No newline at end of file From 621aa2fa1ae10136635993e2f86a94043da2d49d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:52:50 +0000 Subject: [PATCH 042/141] Add changeset for PR #2 From f65914a00fe1b02224eea930d9767ee8b1f56bb8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:55:11 +0000 Subject: [PATCH 043/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 4abbaa1563fd..e243da4ae924 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,10 +5,10 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- test test test3 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- test test test4 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) doc: -- new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- newish documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) unknown: ## \ No newline at end of file From f951e7b89f4598b7582bef88178b2bc3714b4ce8 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Fri, 24 Nov 2023 23:47:14 -0500 Subject: [PATCH 044/141] Bump actions/checkout from v2 to v4 Signed-off-by: Johnathon Bowers --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index ecd034a90bc4..0a057a9e7ca9 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: From 2c4c1defbe6a58098184a1a6c3ca661723f5f0bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 04:51:16 +0000 Subject: [PATCH 045/141] Add changeset for PR #2 From 5460b25b6fb48f264636445b327e5d0b1701da93 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 04:52:50 +0000 Subject: [PATCH 046/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index e243da4ae924..527c6f22a961 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,7 +5,7 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- test test test4 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- test test test5 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) doc: - newish documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) From d43c874b5f99abc2a2e57ec82ad5045b801cf619 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:03:33 +0000 Subject: [PATCH 047/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 527c6f22a961..b1ba09ed1ae9 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,10 +5,8 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: +- test test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - test test test5 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) doc: -- newish documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -unknown: -## \ No newline at end of file +- newish documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 78aabf65a4d84f575c124bbd2c69e01a8db58184 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:47:52 +0000 Subject: [PATCH 048/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index b1ba09ed1ae9..15a2deaf34b5 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,12 +1,2 @@ -fix: -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- test test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- test test test5 ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- newish documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +unknown: +- unknown: Feat/chanelog project \ No newline at end of file From 8a1b35f73025bdfcd8ddd7d4a70d5e1ad64c3fb3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:49:23 +0000 Subject: [PATCH 049/141] Add changeset for PR #2 From 9cb4afb895e5646d29c560ae00fd565196f46bb6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:53:12 +0000 Subject: [PATCH 050/141] Add changeset for PR #2 From e7fe1bbf9c23695bf01552d33f3ee84522bbb88a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:57:13 +0000 Subject: [PATCH 051/141] Add changeset for PR #2 From 80eb6f2c4053bccde1779461c6b8855e5b742aa7 Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Sat, 25 Nov 2023 14:28:40 -0500 Subject: [PATCH 052/141] release note script refactor + deletes fragment added the deletiong of fragment files at the end. Did minor refactoring/cleanup Signed-off-by: CMDWillYang --- src/dev/generate_release_note.ts | 96 +++++++++++++------------------- 1 file changed, 39 insertions(+), 57 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index 95b89c98f375..e639ae2e6d40 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -4,28 +4,25 @@ */ import { resolve } from 'path'; -import { readFileSync, writeFileSync, readdirSync } from 'fs'; +import { readFileSync, writeFileSync, readdirSync, unlinkSync } from 'fs'; import { load as loadYaml } from 'js-yaml'; import { version as pkgVersion } from '../../package.json'; -// Path to the file +// Define constant paths const filePath = resolve(__dirname, '..', '..', 'CHANGELOG.md'); +const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); +const releaseNotesDirPath = resolve(__dirname, '..', '..', 'release-notes'); +// Function to add content after the 'Unreleased' section in the changelog function addContentAfterUnreleased(path: string, newContent: string): void { - // Read the existing content of the file let fileContent = readFileSync(path, 'utf8'); - - // Define the target string to search for const targetString = '## [Unreleased]'; - - // Find the index of the target string const targetIndex = fileContent.indexOf(targetString); + if (targetIndex !== -1) { - // Find the end of the line containing the target string const endOfLineIndex = fileContent.indexOf('\n', targetIndex); if (endOfLineIndex !== -1) { - // Insert the new content after the end of the target line fileContent = fileContent.slice(0, endOfLineIndex + 1) + '\n' + @@ -42,25 +39,25 @@ function addContentAfterUnreleased(path: string, newContent: string): void { return; } - // Write the modified content back to the file writeFileSync(path, fileContent); } +// Function to format the current date function getCurrentDateFormatted(): string { const now = new Date(); const year = now.getFullYear(); - const month = now.getMonth() + 1; // Months are 0-based + const month = now.getMonth() + 1; const day = now.getDate(); - // Pad the month and day with leading zeros if necessary - const formattedMonth = month < 10 ? `0${month}` : `${month}`; - const formattedDay = day < 10 ? `0${day}` : `${day}`; + const formattedMonth = month.toString().padStart(2, '0'); + const formattedDay = day.toString().padStart(2, '0'); return `${year}-${formattedMonth}-${formattedDay}`; } const currentDate = getCurrentDateFormatted(); +// Define section mapping const SECTION_MAPPING = { breaking: '💥 Breaking Changes', deprecate: 'Deprecations', @@ -74,25 +71,15 @@ const SECTION_MAPPING = { test: '🔩 Tests', }; -const SECTION_KEYS = Object.keys(SECTION_MAPPING); type SectionKey = keyof typeof SECTION_MAPPING; type Changelog = Record; -// const sections: Partial = {}; -const sections: Changelog = { - breaking: [], - deprecate: [], - security: [], - feat: [], - fix: [], - infra: [], - doc: [], - chore: [], - refactor: [], - test: [], -}; +// Initialize sections +const sections: Changelog = (Object.fromEntries( + Object.keys(SECTION_MAPPING).map((key) => [key, []]) +) as unknown) as Changelog; -const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); +// Read fragment files and populate sections const fragmentPaths = readdirSync(fragmentDirPath).filter( (path) => path.endsWith('.yml') || path.endsWith('.yaml') ); @@ -102,47 +89,42 @@ for (const fragmentFilename of fragmentPaths) { const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); const fragmentYaml = loadYaml(fragmentContents) as Changelog; - // const prNumber = fragmentFilename.split('.').slice(0, -1).join('.'); - for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { - if (!SECTION_KEYS.includes(sectionKey)) { - // shouldnt be any unknown section coz they are handled during the changesets generation + if (!SECTION_MAPPING[sectionKey as SectionKey]) { // eslint-disable-next-line no-console - console.log(`Unknown section ${sectionKey} with skip. SKipping`); + console.warn(`Unknown section ${sectionKey}. Skipping.`); continue; } - const section = sections[sectionKey as SectionKey] || (sections[sectionKey as SectionKey] = []); - section.push(...entries); + sections[sectionKey as SectionKey].push(...entries); } } -const changelogSections = []; - -for (const [sectionKey, entries] of Object.entries(sections)) { +// Generate changelog sections +const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { const sectionName = SECTION_MAPPING[sectionKey as SectionKey]; - if (entries.length === 0) { - changelogSections.push(`### ${sectionName}`); - continue; - } - changelogSections.push(`### ${sectionName} - -${entries.map((entry) => ` - ${entry}`).join('\n')}`); -} + return entries.length === 0 + ? `### ${sectionName}` + : `### ${sectionName}\n\n${entries.map((entry) => ` - ${entry}`).join('\n')}`; +}); +// Generate full changelog const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) ${changelogSections.join('\n\n')} `; -// generate the release note in the /release-notes folder -const REALEASENOTE_FILENAME = `opensearch-dashboards.release-notes-${pkgVersion}.md`; -const REALEASENOTE_HEADER = `# VERSION ${pkgVersion} Release Note`; -const releasenote = `${REALEASENOTE_HEADER} -${changelogSections.join('\n\n')} -`; -// console.log(`${changelogSections.join('\n\n')}`); -// console.log(resolve(__dirname, '..', '..', 'release-notes', REALEASENOTE_FILENAME)); -writeFileSync(resolve(__dirname, '..', '..', 'release-notes', REALEASENOTE_FILENAME), releasenote); -// writeFileSync(resolve(__dirname, '..', '..', 'CHANGELOG.md'), changelog + fileContent); +// Generate release note +const releaseNoteFilename = `opensearch-dashboards.release-notes-${pkgVersion}.md`; +const releaseNoteHeader = `# VERSION ${pkgVersion} Release Note`; +const releaseNote = `${releaseNoteHeader}\n\n${changelogSections.join('\n\n')}`; +writeFileSync(resolve(releaseNotesDirPath, releaseNoteFilename), releaseNote); + +// Update changelog file addContentAfterUnreleased(filePath, changelog); + +// Delete fragment files +for (const fragmentFilename of fragmentPaths) { + const fragmentPath = resolve(fragmentDirPath, fragmentFilename); + unlinkSync(fragmentPath); +} From 7cb63de51393838c1f20d3bb87f1f0c9520c5963 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:43:37 +0000 Subject: [PATCH 053/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 15a2deaf34b5..d5f33e35857f 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,8 @@ -unknown: -- unknown: Feat/chanelog project \ No newline at end of file +fix: +- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 34cfb78923043157f57adc3be2b9fccfc096f24e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:56:30 +0000 Subject: [PATCH 054/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index d5f33e35857f..3a7a6f6ed261 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,4 +5,4 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) test: -- test test test test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 45072e8c7479b752c9bbee12f2b625e08a654ef1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:59:08 +0000 Subject: [PATCH 055/141] Add changeset for PR #2 From 698398dd5ea8828be23bd2c64a7b5dbc8d379d04 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 04:09:39 +0000 Subject: [PATCH 056/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 3a7a6f6ed261..777017942edf 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,8 +1,5 @@ -fix: -- Updates the graph ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -test: -- test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +refactor: +- Modifies function ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 9cc2a72b10c791c32e585ac037ee075f93d14142 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 04:11:20 +0000 Subject: [PATCH 057/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 777017942edf..4d71cb225bb5 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,4 +2,7 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) refactor: -- Modifies function ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Modifies function ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From c0b93e0ad05be8f12168f61afd9d2a630c96da63 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 04:30:58 +0000 Subject: [PATCH 058/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 4d71cb225bb5..d041d7fe68e7 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,8 +1,9 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds another new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) refactor: - Modifies function ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) doc: -- adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From f715f53a672f086eb0d2508c52b1e9c670801ef9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 05:58:56 +0000 Subject: [PATCH 059/141] Add changeset for PR #2 From 5c3739177ff25e59f3a5a79ad561e462356de4ba Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Tue, 28 Nov 2023 20:19:20 -0500 Subject: [PATCH 060/141] Update language in 'Changelog' section of PR template Signed-off-by: Johnathon Bowers --- .github/pull_request_template.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f59fa4f4bb00..b5fe6881d1c2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,10 +25,12 @@ Add each of the changelog entries as a line item in this section. e.g. - fix: Updates the graph - feat: Adds a new feature -If this chnage does not need to added to the changelog, just add a single `skip` line e.g. +If this change does not need to added to the changelog, just add a single `skip` line e.g. - skip -Valid prefixes: breaking, deprecate, feat, fix, infra, doc, chore, refactor, test +Valid prefixes: breaking, chore, deprecate, doc, feat, fix, infra, refactor, test + +Descriptions following the prefixes must be 50 characters or less --> ### Check List From ad76b43c4d3d576283045a70b1b3fd17197d93cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:20:16 +0000 Subject: [PATCH 061/141] Add changeset for PR #2 From 04bdb2b10d0b70f465dc15835bdc5fc9f342900c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:00:33 +0000 Subject: [PATCH 062/141] Add changeset for PR #2 From d5fe14275857f1ebcbd4c18abac918d82a3f9cb0 Mon Sep 17 00:00:00 2001 From: Qiwen Li Date: Wed, 29 Nov 2023 09:53:33 -0500 Subject: [PATCH 063/141] Update src/dev/generate_release_note.ts Co-authored-by: Ashwin P Chandran Signed-off-by: Qiwen Li --- src/dev/generate_release_note.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index e639ae2e6d40..d7fc29af2743 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -30,7 +30,7 @@ function addContentAfterUnreleased(path: string, newContent: string): void { fileContent.slice(endOfLineIndex + 1); } else { // eslint-disable-next-line no-console - console.warn('End of line for target string not found.'); + console.warn('End of line for "Unreleased" section not found.'); return; } } else { From 894430e3bded210dd34e52ea673b6931f57f10da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:54:54 +0000 Subject: [PATCH 064/141] Add changeset for PR #2 From 70dbb55c5e204a45721c5ea4f1023444d7763673 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Wed, 29 Nov 2023 10:04:07 -0500 Subject: [PATCH 065/141] Add first draft of changelog process README Signed-off-by: Johnathon Bowers --- changelogs/README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 changelogs/README.md diff --git a/changelogs/README.md b/changelogs/README.md new file mode 100644 index 000000000000..61c8d06c7c77 --- /dev/null +++ b/changelogs/README.md @@ -0,0 +1,40 @@ +# Revised Changelog and Release Notes Process + +- [Introduction](#introduction) +- [Process Overview](#process-overview) + +## Introduction + +On March 20, 2023, Josh Romero issued a [call for proposals](https://github.com/opensearch-project/.github/issues/148) that would "solve the entire collection of issues around generating both ongoing CHANGELOGs, and release notes during GA of the product, for all OpenSearch project repositories." + +On May 4, 2023, a working group voted unanimously to move forward with the "Automation" variation of [Ashwin Chandran's proposal](https://github.com/opensearch-project/.github/issues/156). This proposal has now been implemented, and the details of the new changelog and release notes process are set out below. + +## Process Overview + +The updated changelog and release notes process involves four primary changes in the repository: + +1. Creating a new `changelogs` directory in the root folder of the repository. + +2. Adding a "Changelog" section to the PR description template, with instructions for how contributors can add valid changelog entries to this section. + +3. Using a GitHub Actions workflow to extract entries from the "Changelog" section of each PR description, create or update a changeset file in `.yml` format, and add this file to the new `changelogs/fragments` directory. The generated changeset file is automatically included as part of the changes to be merged when the PR is approved. + +4. Implementing a script that, when manually triggered from the command line upon general availability of a new product version, will cull the `changelogs/fragments` directory for changeset files and use those files to populate the release notes for the new version. + +Details on each of these changes are available in the "[Process Details](#process-details)" section below. + +## Benefits of the New Process + +The new changelog and release notes process improves both contributor experience as well as the efficiency of product development and release. + +Previously, when a contributor opened a PR, they would be prompted to indicate whether or not they had manually added an entry to the changelog. However, they could not add an entry to the changelog without having a PR number to reference. + +This resulted in an inefficient two-step process, in which contributors had to (1) open a PR with their committed code and, once they had the PR number to reference in the changelog, (2) add an entry to the changelog, which then required pushing a new commit to their PR. + + + +## Process Details + +This section discusses in greater detail the four primary changes listed in the "[Process Overview](#process-overview)" section above. + +### 1. Creating a New `changelogs` Directory \ No newline at end of file From 1211af25844a4897d28143dd49707fef6c744ab2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:05:45 +0000 Subject: [PATCH 066/141] Add changeset for PR #2 From ef3f61ec977354426a7cb9ee069238993eca86db Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Wed, 29 Nov 2023 11:02:12 -0500 Subject: [PATCH 067/141] changed error handling behaviors. Signed-off-by: CMDWillYang --- src/dev/generate_release_note.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index d7fc29af2743..0d0d7b06f945 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -34,9 +34,7 @@ function addContentAfterUnreleased(path: string, newContent: string): void { return; } } else { - // eslint-disable-next-line no-console - console.warn("'## [Unreleased]' not found in the file."); - return; + throw new Error("'## [Unreleased]' not found in the file."); } writeFileSync(path, fileContent); @@ -91,9 +89,7 @@ for (const fragmentFilename of fragmentPaths) { for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { if (!SECTION_MAPPING[sectionKey as SectionKey]) { - // eslint-disable-next-line no-console - console.warn(`Unknown section ${sectionKey}. Skipping.`); - continue; + throw new Error(`Unknown section ${sectionKey}.`); } sections[sectionKey as SectionKey].push(...entries); From 981ef3e73dcf1dc94c798722dec7a666305f59e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:02:52 +0000 Subject: [PATCH 068/141] Add changeset for PR #2 From c1945a9abbea535933000178c56cd931b5dc93b2 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Wed, 29 Nov 2023 12:00:01 -0500 Subject: [PATCH 069/141] Add more details to changelog README Signed-off-by: Johnathon Bowers --- changelogs/README.md | 105 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 4 deletions(-) diff --git a/changelogs/README.md b/changelogs/README.md index 61c8d06c7c77..d084c20cfc3d 100644 --- a/changelogs/README.md +++ b/changelogs/README.md @@ -1,7 +1,14 @@ # Revised Changelog and Release Notes Process -- [Introduction](#introduction) -- [Process Overview](#process-overview) +- [Revised Changelog and Release Notes Process](#revised-changelog-and-release-notes-process) + - [Introduction](#introduction) + - [Process Overview](#process-overview) + - [Benefits of the New Process](#benefits-of-the-new-process) + - [Process Details](#process-details) + - [1. Creating a New `changelogs` Directory](#1-creating-a-new-changelogs-directory) + - [2. Adding a "Changelog" Section to the PR Description Template](#2-adding-a-changelog-section-to-the-pr-description-template) + - [3. Using a GitHub Actions Workflow to Generate Changeset Files](#3-using-a-github-actions-workflow-to-generate-changeset-files) + - [4. Implementing a Release Notes Script](#4-implementing-a-release-notes-script) ## Introduction @@ -15,7 +22,7 @@ The updated changelog and release notes process involves four primary changes in 1. Creating a new `changelogs` directory in the root folder of the repository. -2. Adding a "Changelog" section to the PR description template, with instructions for how contributors can add valid changelog entries to this section. +2. Adding a "Changelog" section to the PR template, with instructions for how contributors can add valid changelog entries to this section. 3. Using a GitHub Actions workflow to extract entries from the "Changelog" section of each PR description, create or update a changeset file in `.yml` format, and add this file to the new `changelogs/fragments` directory. The generated changeset file is automatically included as part of the changes to be merged when the PR is approved. @@ -37,4 +44,94 @@ This resulted in an inefficient two-step process, in which contributors had to ( This section discusses in greater detail the four primary changes listed in the "[Process Overview](#process-overview)" section above. -### 1. Creating a New `changelogs` Directory \ No newline at end of file +### 1. Creating a New `changelogs` Directory + +To centralize information pertinent to the new changelog process, a new `changelogs` directory has been added to the root of the repository. This directory is the new location for `CHANGELOG.md`. + +It also houses the `fragments` subdirectory, which includes changeset files in `.yml` format that have been generated from merged PRs. (Only one changeset file is generated per PR.) + +Changeset files are named with the PR number they correspond to. (E.g., `5218.yml`.) + +### 2. Adding a "Changelog" Section to the PR Description Template + +The PR template has been updated with a new "Changelog" section. The comment block in this section provides contributors with instructions for how to add properly-formatted changelog entries to their PR. + +Below are the formatting standards for changelog entries: +- Each entry line must begin with a hyphen (-) in the Markdown source file. +- Contributors must categorize their changes by using one of the following prefixes, followed by a colon. + - `breaking` + - `chore` + - `deprecate` + - `doc` + - `feat` + - `fix` + - `infra` + - `refactor` + - `test` +- If the changes in a PR are minor (e.g., fixing a typo), contributors can enter `- skip` in the "Changelog" section to instruct the workflow not to generate a changeset file. + - If `-skip` is entered in the "Changelog" section, no other categories or descriptions can be present. +- After the colon, contributors should provide a concise description of their changes. Descriptions must be 50 characters or less. + +Below is an example of a valid entry in the "Changelog" section of the PR description. (Contributors can add more than one entry if they are contributing more than one type of change in their PR. They do not need to delete the comment block in this section, although they can. If they leave the comment block, they should ensure that the changelog entries they add to their PR lie *outside* of the comment block.) + +```markdown +## Changelog + + +- feat: Adds a new feature +- refactor: Improves an existing feature +``` + +Below are examples of invalid entries: + +``` +// Including "skip" with another category +- skip +- feat: Adds a new feature +``` +``` +// Missing a hyphen +feat: Adds a new feature +``` +``` +// Invalid category prefix +- new: Adds something new +``` +``` +// Missing description +- feat +``` +``` +// Description longer than 50 characters +- feat: Adds a new feature that is simply too excellent to be described in 50 characters or less +``` + +### 3. Using a GitHub Actions Workflow to Generate Changeset Files + +Whenever a contributor opens a PR or edits an existing PR, a GitHub Actions workflow is triggered that extracts the metadata from the PR and checks what a contributor has entered in the "Changelog" section of the PR description. + +If a contributor has entered valid changelog entries (see formatting requirements in previous section above), the workflow will categorize these entries and either create or update a `.yml` changeset file in the `changelogs/fragments` directory of the repository. + +This changeset file will include changelog descriptions under their proper category and also add a link to the PR that generated these changes. Below is an example of what the contents of a changeset file will look like: + +```yaml +feat: + - Adds a new feature ([#532](https://github.com/.../pull/532)) + +refactor: + - Improves an existing feature ([#532](https://github.com/.../pull/532)) + +test: + - Add unit testing to new feature ([#532](https://github.com/.../pull/532)) + - Update unit testing for existing feature ([#532](https://github.com/.../pull/532)) +``` + +This changeset file will become part of the code that is merged when the PR is approved. + +If the workflow encounters a `- skip` line in the PR, and there are no other changelog entries present, it will skip the creation of a changeset file, and the workflow will terminate successfully. + +If the workflow encounters an error (e.g., an empty "Changelog" section or an invalid changelog entry), it will fail, and a custom error message will be printed to the workflow logs explaining the reason for the failure. + +Contributors can then address the error and update their PR, which will trigger the workflow to run again. + +### 4. Implementing a Release Notes Script \ No newline at end of file From c777b6662a97a0268ee74a8efd088e0945e95b64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:01:10 +0000 Subject: [PATCH 070/141] Add changeset for PR #2 From 4775d6f45765394c3b05ae7fc0768728702a2817 Mon Sep 17 00:00:00 2001 From: qiwen li Date: Wed, 29 Nov 2023 12:15:37 -0500 Subject: [PATCH 071/141] added error Signed-off-by: qiwen li --- src/dev/generate_release_note.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index 0d0d7b06f945..b002711f151e 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -29,9 +29,7 @@ function addContentAfterUnreleased(path: string, newContent: string): void { newContent + fileContent.slice(endOfLineIndex + 1); } else { - // eslint-disable-next-line no-console - console.warn('End of line for "Unreleased" section not found.'); - return; + throw new Error('End of line for "Unreleased" section not found.'); } } else { throw new Error("'## [Unreleased]' not found in the file."); From 81f1c59490f695a59ed7f9fdffb6ad21742ce922 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:18:03 +0000 Subject: [PATCH 072/141] Add changeset for PR #2 From 89337de8bdfcaf537aee8375e82ef2dfdaae01e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:59:11 +0000 Subject: [PATCH 073/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index d041d7fe68e7..975b36f774b3 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,9 +1,2 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Adds another new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -refactor: -- Modifies function ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 7620ffad8c838f3e9131fefc8ff26ef0c92df013 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 18:28:17 +0000 Subject: [PATCH 074/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 975b36f774b3..0400aacb4120 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,5 @@ feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Adds new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 7a567c3da1a9dfdd55a6f1b11b77da9f71a311fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 03:12:51 +0000 Subject: [PATCH 075/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 0400aacb4120..e69de29bb2d1 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,5 +0,0 @@ -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds new documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 31232dbd462cc70c59359e9783928a67b2d24428 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 03:42:30 +0000 Subject: [PATCH 076/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index e69de29bb2d1..4c4a03839787 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -0,0 +1,2 @@ +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 86f10bd4df5f5c476ab687bdd0126928936c0951 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 06:29:06 +0000 Subject: [PATCH 077/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 4c4a03839787..28d7843ab68d 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,5 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From c3843c61f579dc488fc44214e196f4a3bf8f2435 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:11:30 +0000 Subject: [PATCH 078/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 28d7843ab68d..43e4e0f2ab6b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,4 +2,7 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 72c3d896581dd373118ea7a4d85613680bdafb23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:52:40 +0000 Subject: [PATCH 079/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 43e4e0f2ab6b..28d7843ab68d 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,7 +2,4 @@ feat: - Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 204c363383f8f037917676f3b27755debaf5828f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:10:09 +0000 Subject: [PATCH 080/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 28d7843ab68d..462d8398fd3b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,5 +1 @@ -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +skip: From 3b0b2f29c98a363eb211d622bfe8b6201f390ef5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:18:19 +0000 Subject: [PATCH 081/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 462d8398fd3b..4c4a03839787 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1 +1,2 @@ -skip: +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From a875300f97d294d73f95ebe3ccdde92377e29e50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 23:13:44 +0000 Subject: [PATCH 082/141] Add changeset for PR #2 From 941dd6c731f9a0035d65d5c3de97ef41b6407564 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:42:51 +0000 Subject: [PATCH 083/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 4c4a03839787..5cd56d56ab2b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,2 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From b80f45f601a0e0b6637fe26ac774c88c08a2eb86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:56:03 +0000 Subject: [PATCH 084/141] Add changeset for PR #2 From 6795bc01fd4dbe137cb437a2d17ad10b5e72d313 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Wed, 6 Dec 2023 14:45:03 -0500 Subject: [PATCH 085/141] Abbreviate README and link to workflow README Signed-off-by: Johnathon Bowers --- changelogs/README.md | 136 +------------------------------------------ 1 file changed, 2 insertions(+), 134 deletions(-) diff --git a/changelogs/README.md b/changelogs/README.md index d084c20cfc3d..bc4504f98fde 100644 --- a/changelogs/README.md +++ b/changelogs/README.md @@ -1,137 +1,5 @@ # Revised Changelog and Release Notes Process -- [Revised Changelog and Release Notes Process](#revised-changelog-and-release-notes-process) - - [Introduction](#introduction) - - [Process Overview](#process-overview) - - [Benefits of the New Process](#benefits-of-the-new-process) - - [Process Details](#process-details) - - [1. Creating a New `changelogs` Directory](#1-creating-a-new-changelogs-directory) - - [2. Adding a "Changelog" Section to the PR Description Template](#2-adding-a-changelog-section-to-the-pr-description-template) - - [3. Using a GitHub Actions Workflow to Generate Changeset Files](#3-using-a-github-actions-workflow-to-generate-changeset-files) - - [4. Implementing a Release Notes Script](#4-implementing-a-release-notes-script) +For information regarding the revised changelog and release notes process, please consult the README in the GitHub Actions repository that this process utilizes. To view this README, follow the link below: -## Introduction - -On March 20, 2023, Josh Romero issued a [call for proposals](https://github.com/opensearch-project/.github/issues/148) that would "solve the entire collection of issues around generating both ongoing CHANGELOGs, and release notes during GA of the product, for all OpenSearch project repositories." - -On May 4, 2023, a working group voted unanimously to move forward with the "Automation" variation of [Ashwin Chandran's proposal](https://github.com/opensearch-project/.github/issues/156). This proposal has now been implemented, and the details of the new changelog and release notes process are set out below. - -## Process Overview - -The updated changelog and release notes process involves four primary changes in the repository: - -1. Creating a new `changelogs` directory in the root folder of the repository. - -2. Adding a "Changelog" section to the PR template, with instructions for how contributors can add valid changelog entries to this section. - -3. Using a GitHub Actions workflow to extract entries from the "Changelog" section of each PR description, create or update a changeset file in `.yml` format, and add this file to the new `changelogs/fragments` directory. The generated changeset file is automatically included as part of the changes to be merged when the PR is approved. - -4. Implementing a script that, when manually triggered from the command line upon general availability of a new product version, will cull the `changelogs/fragments` directory for changeset files and use those files to populate the release notes for the new version. - -Details on each of these changes are available in the "[Process Details](#process-details)" section below. - -## Benefits of the New Process - -The new changelog and release notes process improves both contributor experience as well as the efficiency of product development and release. - -Previously, when a contributor opened a PR, they would be prompted to indicate whether or not they had manually added an entry to the changelog. However, they could not add an entry to the changelog without having a PR number to reference. - -This resulted in an inefficient two-step process, in which contributors had to (1) open a PR with their committed code and, once they had the PR number to reference in the changelog, (2) add an entry to the changelog, which then required pushing a new commit to their PR. - - - -## Process Details - -This section discusses in greater detail the four primary changes listed in the "[Process Overview](#process-overview)" section above. - -### 1. Creating a New `changelogs` Directory - -To centralize information pertinent to the new changelog process, a new `changelogs` directory has been added to the root of the repository. This directory is the new location for `CHANGELOG.md`. - -It also houses the `fragments` subdirectory, which includes changeset files in `.yml` format that have been generated from merged PRs. (Only one changeset file is generated per PR.) - -Changeset files are named with the PR number they correspond to. (E.g., `5218.yml`.) - -### 2. Adding a "Changelog" Section to the PR Description Template - -The PR template has been updated with a new "Changelog" section. The comment block in this section provides contributors with instructions for how to add properly-formatted changelog entries to their PR. - -Below are the formatting standards for changelog entries: -- Each entry line must begin with a hyphen (-) in the Markdown source file. -- Contributors must categorize their changes by using one of the following prefixes, followed by a colon. - - `breaking` - - `chore` - - `deprecate` - - `doc` - - `feat` - - `fix` - - `infra` - - `refactor` - - `test` -- If the changes in a PR are minor (e.g., fixing a typo), contributors can enter `- skip` in the "Changelog" section to instruct the workflow not to generate a changeset file. - - If `-skip` is entered in the "Changelog" section, no other categories or descriptions can be present. -- After the colon, contributors should provide a concise description of their changes. Descriptions must be 50 characters or less. - -Below is an example of a valid entry in the "Changelog" section of the PR description. (Contributors can add more than one entry if they are contributing more than one type of change in their PR. They do not need to delete the comment block in this section, although they can. If they leave the comment block, they should ensure that the changelog entries they add to their PR lie *outside* of the comment block.) - -```markdown -## Changelog - - -- feat: Adds a new feature -- refactor: Improves an existing feature -``` - -Below are examples of invalid entries: - -``` -// Including "skip" with another category -- skip -- feat: Adds a new feature -``` -``` -// Missing a hyphen -feat: Adds a new feature -``` -``` -// Invalid category prefix -- new: Adds something new -``` -``` -// Missing description -- feat -``` -``` -// Description longer than 50 characters -- feat: Adds a new feature that is simply too excellent to be described in 50 characters or less -``` - -### 3. Using a GitHub Actions Workflow to Generate Changeset Files - -Whenever a contributor opens a PR or edits an existing PR, a GitHub Actions workflow is triggered that extracts the metadata from the PR and checks what a contributor has entered in the "Changelog" section of the PR description. - -If a contributor has entered valid changelog entries (see formatting requirements in previous section above), the workflow will categorize these entries and either create or update a `.yml` changeset file in the `changelogs/fragments` directory of the repository. - -This changeset file will include changelog descriptions under their proper category and also add a link to the PR that generated these changes. Below is an example of what the contents of a changeset file will look like: - -```yaml -feat: - - Adds a new feature ([#532](https://github.com/.../pull/532)) - -refactor: - - Improves an existing feature ([#532](https://github.com/.../pull/532)) - -test: - - Add unit testing to new feature ([#532](https://github.com/.../pull/532)) - - Update unit testing for existing feature ([#532](https://github.com/.../pull/532)) -``` - -This changeset file will become part of the code that is merged when the PR is approved. - -If the workflow encounters a `- skip` line in the PR, and there are no other changelog entries present, it will skip the creation of a changeset file, and the workflow will terminate successfully. - -If the workflow encounters an error (e.g., an empty "Changelog" section or an invalid changelog entry), it will fail, and a custom error message will be printed to the workflow logs explaining the reason for the failure. - -Contributors can then address the error and update their PR, which will trigger the workflow to run again. - -### 4. Implementing a Release Notes Script \ No newline at end of file +[GitHub Actions Workflow README](https://github.com/BigSamu/OpenSearch_Change_Set_Create_Action/blob/main/README.md) \ No newline at end of file From 7ba8a701ddea2aee62454151f6ff9ab1a8c07721 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:45:39 +0000 Subject: [PATCH 086/141] Add changeset for PR #2 From da6ad8e202d093fc4892a9d142afcf2a2fead580 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:53:03 +0000 Subject: [PATCH 087/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 5cd56d56ab2b..addb3aaefc46 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,9 @@ feat: -- Adds a feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 6e9a40111983c3612e88d22510d40ecaf07983f7 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:22:50 +0000 Subject: [PATCH 088/141] deleting test.txt file used to test if other contributors of project were able to push updates to this branch Signed-off-by: Samuel Valdes Gutierrez --- test.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index 2f153caed8dd..000000000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -Riley \ No newline at end of file From efdbf39f2f39cbcc06636980b7d30f399c444245 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:24:50 +0000 Subject: [PATCH 089/141] Add changeset for PR #2 From 941bf621eebf49ceb36ab2b2fc0b4aeef519d25b Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:25:30 +0000 Subject: [PATCH 090/141] fixing formatting in create_change_set_workflow.yml file Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 0a057a9e7ca9..705f7bd4b3ef 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -15,5 +15,5 @@ jobs: - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: - token: ${{ secrets.GITHUB_TOKEN}} + token: ${{secrets.GITHUB_TOKEN}} changeset_path: changelogs/fragments From 36e3fd5b98e550e61911d5c4021fe999f1c5ea28 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:27:03 +0000 Subject: [PATCH 091/141] updating title for README.md in changelogs directory Signed-off-by: Samuel Valdes Gutierrez --- changelogs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelogs/README.md b/changelogs/README.md index bc4504f98fde..94705302945a 100644 --- a/changelogs/README.md +++ b/changelogs/README.md @@ -1,5 +1,5 @@ -# Revised Changelog and Release Notes Process +# Changelog and Release Notes For information regarding the revised changelog and release notes process, please consult the README in the GitHub Actions repository that this process utilizes. To view this README, follow the link below: -[GitHub Actions Workflow README](https://github.com/BigSamu/OpenSearch_Change_Set_Create_Action/blob/main/README.md) \ No newline at end of file +[GitHub Actions Workflow README](https://github.com/BigSamu/OpenSearch_Change_Set_Create_Action/blob/main/README.md) From f91889778761de2ed9170cff9241f8b5a79e0e15 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:27:48 +0000 Subject: [PATCH 092/141] updating description of README.md in changelogs directory Signed-off-by: Samuel Valdes Gutierrez --- changelogs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/README.md b/changelogs/README.md index 94705302945a..a4620754cfd1 100644 --- a/changelogs/README.md +++ b/changelogs/README.md @@ -1,5 +1,5 @@ # Changelog and Release Notes -For information regarding the revised changelog and release notes process, please consult the README in the GitHub Actions repository that this process utilizes. To view this README, follow the link below: +For information regarding the changelog and release notes process, please consult the README in the GitHub Actions repository that this process utilizes. To view this README, follow the link below: [GitHub Actions Workflow README](https://github.com/BigSamu/OpenSearch_Change_Set_Create_Action/blob/main/README.md) From afc82b3ec3604c414d3429d0fb6fa59be345fdc9 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:41:21 +0000 Subject: [PATCH 093/141] removing demo fragments and adding new single one specifiying new feat of Changelog and Release Notes projects in this PR Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/1.yml | 6 ------ changelogs/fragments/2.yml | 9 --------- changelogs/fragments/3.yml | 7 ------- changelogs/fragments/4.yml | 2 -- changelogs/fragments/5519.yml | 4 ++++ 5 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 changelogs/fragments/1.yml delete mode 100644 changelogs/fragments/2.yml delete mode 100644 changelogs/fragments/3.yml delete mode 100644 changelogs/fragments/4.yml create mode 100644 changelogs/fragments/5519.yml diff --git a/changelogs/fragments/1.yml b/changelogs/fragments/1.yml deleted file mode 100644 index a0ca4f664458..000000000000 --- a/changelogs/fragments/1.yml +++ /dev/null @@ -1,6 +0,0 @@ -fix: -- Updates the graph ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) -- Updates the picture ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) - -infra: -- testing ingra ([#1](https://github.com/BigSamu/OpenSearch-Dashboards/pull/1)) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index addb3aaefc46..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,9 +0,0 @@ -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file diff --git a/changelogs/fragments/3.yml b/changelogs/fragments/3.yml deleted file mode 100644 index 404ca8772b84..000000000000 --- a/changelogs/fragments/3.yml +++ /dev/null @@ -1,7 +0,0 @@ -fix: -- Updates the graph ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) - -doc: -- Creating docs 1 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) -- Creating docs 2 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) -- Creating docs 3 ([#3](https://github.com/BigSamu/OpenSearch-Dashboards/pull/3)) diff --git a/changelogs/fragments/4.yml b/changelogs/fragments/4.yml deleted file mode 100644 index 7d7e6cb909b3..000000000000 --- a/changelogs/fragments/4.yml +++ /dev/null @@ -1,2 +0,0 @@ -refactor: -- Refactor huge code([#4](https://github.com/BigSamu/OpenSearch-Dashboards/pull/4)) diff --git a/changelogs/fragments/5519.yml b/changelogs/fragments/5519.yml new file mode 100644 index 000000000000..f67e6baed1f6 --- /dev/null +++ b/changelogs/fragments/5519.yml @@ -0,0 +1,4 @@ +feat: +- Designed new procedure for automating the process for updates of changelogs and release notes ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) +- Created Github workflow automating creation of changeset files (i.e. fragments) with changelog entries related to update([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) +- Created script automating the update of CHANGELOG.md file and release notes files ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) From 3af0f221baa05103d77bb5a7252bb1377fca3bc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:42:55 +0000 Subject: [PATCH 094/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..addb3aaefc46 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,9 @@ +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 7d9145a6a365cb492b07b0f0f48778bd60305ee1 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Sat, 9 Dec 2023 14:46:28 +0000 Subject: [PATCH 095/141] removing demo fragment 2.yml Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/2.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index addb3aaefc46..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,9 +0,0 @@ -feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From e907bc8bd81abfadf7af0a60c72ca1b56ba440a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:47:11 +0000 Subject: [PATCH 096/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..addb3aaefc46 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,9 @@ +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 79813cb31252a6f8b0d46f025649bd82fcb5a3e5 Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Mon, 11 Dec 2023 12:57:14 -0500 Subject: [PATCH 097/141] removed fragment thats too long. added helper file, used async functions, and added validation. Signed-off-by: CMDWillYang --- changelogs/fragments/5519.yml | 4 - scripts/generate_release_note.js | 1 + src/dev/generate_release_note.ts | 137 +++++++++++------------- src/dev/generate_release_note_helper.ts | 66 ++++++++++++ 4 files changed, 128 insertions(+), 80 deletions(-) delete mode 100644 changelogs/fragments/5519.yml create mode 100644 src/dev/generate_release_note_helper.ts diff --git a/changelogs/fragments/5519.yml b/changelogs/fragments/5519.yml deleted file mode 100644 index f67e6baed1f6..000000000000 --- a/changelogs/fragments/5519.yml +++ /dev/null @@ -1,4 +0,0 @@ -feat: -- Designed new procedure for automating the process for updates of changelogs and release notes ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) -- Created Github workflow automating creation of changeset files (i.e. fragments) with changelog entries related to update([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) -- Created script automating the update of CHANGELOG.md file and release notes files ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) diff --git a/scripts/generate_release_note.js b/scripts/generate_release_note.js index 35a1581fea6d..4721fe0dec35 100644 --- a/scripts/generate_release_note.js +++ b/scripts/generate_release_note.js @@ -5,3 +5,4 @@ require('../src/setup_node_env'); require('../src/dev/generate_release_note'); +require('../src/dev/generate_release_note_helper'); diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index b002711f151e..4f6fd6743e48 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -6,12 +6,18 @@ import { resolve } from 'path'; import { readFileSync, writeFileSync, readdirSync, unlinkSync } from 'fs'; import { load as loadYaml } from 'js-yaml'; +import { readdir } from 'fs/promises'; import { version as pkgVersion } from '../../package.json'; - -// Define constant paths -const filePath = resolve(__dirname, '..', '..', 'CHANGELOG.md'); -const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); -const releaseNotesDirPath = resolve(__dirname, '..', '..', 'release-notes'); +import { + validateFragment, + getCurrentDateFormatted, + Changelog, + SECTION_MAPPING, + fragmentDirPath, + SectionKey, + releaseNotesDirPath, + filePath, +} from './generate_release_note_helper'; // Function to add content after the 'Unreleased' section in the changelog function addContentAfterUnreleased(path: string, newContent: string): void { @@ -38,87 +44,66 @@ function addContentAfterUnreleased(path: string, newContent: string): void { writeFileSync(path, fileContent); } -// Function to format the current date -function getCurrentDateFormatted(): string { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth() + 1; - const day = now.getDate(); - - const formattedMonth = month.toString().padStart(2, '0'); - const formattedDay = day.toString().padStart(2, '0'); - - return `${year}-${formattedMonth}-${formattedDay}`; -} - const currentDate = getCurrentDateFormatted(); -// Define section mapping -const SECTION_MAPPING = { - breaking: '💥 Breaking Changes', - deprecate: 'Deprecations', - security: '🛡 Security', - feat: '📈 Features/Enhancements', - fix: '🐛 Bug Fixes', - infra: '🚞 Infrastructure', - doc: '📝 Documentation', - chore: '🛠 Maintenance', - refactor: '🪛 Refactoring', - test: '🔩 Tests', -}; - -type SectionKey = keyof typeof SECTION_MAPPING; -type Changelog = Record; - // Initialize sections const sections: Changelog = (Object.fromEntries( Object.keys(SECTION_MAPPING).map((key) => [key, []]) ) as unknown) as Changelog; // Read fragment files and populate sections -const fragmentPaths = readdirSync(fragmentDirPath).filter( - (path) => path.endsWith('.yml') || path.endsWith('.yaml') -); - -for (const fragmentFilename of fragmentPaths) { - const fragmentPath = resolve(fragmentDirPath, fragmentFilename); - const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); - const fragmentYaml = loadYaml(fragmentContents) as Changelog; - - for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { - if (!SECTION_MAPPING[sectionKey as SectionKey]) { - throw new Error(`Unknown section ${sectionKey}.`); +async function readFragments() { + const fragmentPaths = await readdir(fragmentDirPath, { withFileTypes: true }); + for (const fragmentFilename of fragmentPaths) { + // skip non yml or yaml files + if (!fragmentFilename.name.endsWith('.yml') && !fragmentFilename.name.endsWith('.yaml')) { + // eslint-disable-next-line no-console + console.warn(`Skipping non yml or yaml file ${fragmentFilename.name}`); + continue; + } + + const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); + const fragmentContents = readFileSync(fragmentPath, { encoding: 'utf-8' }); + + validateFragment(fragmentContents); + + const fragmentYaml = loadYaml(fragmentContents) as Changelog; + + for (const [sectionKey, entries] of Object.entries(fragmentYaml)) { + sections[sectionKey as SectionKey].push(...entries); } + } - sections[sectionKey as SectionKey].push(...entries); + // Delete fragment files + for (const fragmentFilename of fragmentPaths) { + const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); + unlinkSync(fragmentPath); } } -// Generate changelog sections -const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { - const sectionName = SECTION_MAPPING[sectionKey as SectionKey]; - return entries.length === 0 - ? `### ${sectionName}` - : `### ${sectionName}\n\n${entries.map((entry) => ` - ${entry}`).join('\n')}`; -}); - -// Generate full changelog -const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) - -${changelogSections.join('\n\n')} -`; - -// Generate release note -const releaseNoteFilename = `opensearch-dashboards.release-notes-${pkgVersion}.md`; -const releaseNoteHeader = `# VERSION ${pkgVersion} Release Note`; -const releaseNote = `${releaseNoteHeader}\n\n${changelogSections.join('\n\n')}`; -writeFileSync(resolve(releaseNotesDirPath, releaseNoteFilename), releaseNote); - -// Update changelog file -addContentAfterUnreleased(filePath, changelog); - -// Delete fragment files -for (const fragmentFilename of fragmentPaths) { - const fragmentPath = resolve(fragmentDirPath, fragmentFilename); - unlinkSync(fragmentPath); -} +(async () => { + await readFragments(); + + // Generate changelog sections + const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { + const sectionName = SECTION_MAPPING[sectionKey as SectionKey]; + return entries.length === 0 + ? `### ${sectionName}` + : `### ${sectionName}\n\n${entries.map((entry) => ` - ${entry}`).join('\n')}`; + }); + + // Generate full changelog + const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) + + ${changelogSections.join('\n\n')} + `; + + // Generate release note + const releaseNoteFilename = `opensearch-dashboards.release-notes-${pkgVersion}.md`; + const releaseNoteHeader = `# VERSION ${pkgVersion} Release Note`; + const releaseNote = `${releaseNoteHeader}\n\n${changelogSections.join('\n\n')}`; + writeFileSync(resolve(releaseNotesDirPath, releaseNoteFilename), releaseNote); + + // Update changelog file + addContentAfterUnreleased(filePath, changelog); +})(); diff --git a/src/dev/generate_release_note_helper.ts b/src/dev/generate_release_note_helper.ts new file mode 100644 index 000000000000..a895edf03703 --- /dev/null +++ b/src/dev/generate_release_note_helper.ts @@ -0,0 +1,66 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { resolve } from 'path'; + +export const filePath = resolve(__dirname, '..', '..', 'CHANGELOG.md'); +export const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); +export const releaseNotesDirPath = resolve(__dirname, '..', '..', 'release-notes'); + +export function getCurrentDateFormatted(): string { + const now = new Date(); + const year = now.getFullYear(); + const month = now.getMonth() + 1; + const day = now.getDate(); + + const formattedMonth = month.toString().padStart(2, '0'); + const formattedDay = day.toString().padStart(2, '0'); + + return `${year}-${formattedMonth}-${formattedDay}`; +} + +export const SECTION_MAPPING = { + breaking: '💥 Breaking Changes', + deprecate: 'Deprecations', + security: '🛡 Security', + feat: '📈 Features/Enhancements', + fix: '🐛 Bug Fixes', + infra: '🚞 Infrastructure', + doc: '📝 Documentation', + chore: '🛠 Maintenance', + refactor: '🪛 Refactoring', + test: '🔩 Tests', +}; + +export type SectionKey = keyof typeof SECTION_MAPPING; +export type Changelog = Record; + +const MAX_ENTRY_LENGTH = 50; + +// validate format of fragment files +export function validateFragment(content: string) { + const sections = content.split('\n\n'); + + // validate each section + for (const section of sections) { + const lines = section.split('\n'); + const sectionName = lines[0]; + const sectionKey = sectionName.slice(0, -1); + + if (!SECTION_MAPPING[sectionKey as SectionKey] || !sectionName.endsWith(':')) { + throw new Error(`Unknown section ${sectionKey}.`); + } + // validate entries. each entry must start with '-' and a space. then followed by a string. string must be non-empty and less than 50 characters + const entryRegex = new RegExp(`^-.{1,${MAX_ENTRY_LENGTH}}\\(\\[#.+]\\(.+\\)\\)$`); + for (const entry of lines.slice(1)) { + if (entry === '') { + continue; + } + if (!entryRegex.test(entry)) { + throw new Error(`Invalid entry ${entry} in section ${sectionKey}.`); + } + } + } +} From db0024effb3ca6f861f3b2270517b40f761c053b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:58:23 +0000 Subject: [PATCH 098/141] Add changeset for PR #2 From 2090f1c69d19bf1059975ce16d8ba5ae02e0ba15 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:45:15 +0000 Subject: [PATCH 099/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index addb3aaefc46..89246cb73db0 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,9 +1,5 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -- Adds a second feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) -test: -- Adds a new test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -fix: -- Fixes a bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +doc: +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From b200102be28e60c9ae7479231e0516cdbe009219 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 22:12:12 +0000 Subject: [PATCH 100/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 89246cb73db0..462d8398fd3b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,5 +1 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +skip: From c6bcd39d5ab28810a601761011871569a03939c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:06:53 +0000 Subject: [PATCH 101/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 462d8398fd3b..167427ca4c1b 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1 +1,5 @@ -skip: +feat: +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 48e6b56f04ad451fcc5e468307945f8a5ffba18d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 05:11:55 +0000 Subject: [PATCH 102/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 167427ca4c1b..4c4a03839787 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,5 +1,2 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From c24773b92ff42208e43beca6a5bbcbf7c3da94d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 05:14:51 +0000 Subject: [PATCH 103/141] Add changeset for PR #2 From 616290fc0a8f79da564476f3740c719f0db7d726 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 05:20:22 +0000 Subject: [PATCH 104/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 4c4a03839787..975b36f774b3 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,2 @@ feat: -- Adds a new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 2d2a42527338a2fb51b119486ec5e9c83f692ab9 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 11:41:21 +0000 Subject: [PATCH 105/141] adding 5519.yml fragment file and removing 2.yml dummy fragment file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/2.yml | 2 -- changelogs/fragments/5519.yml | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 changelogs/fragments/2.yml create mode 100644 changelogs/fragments/5519.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index 975b36f774b3..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,2 +0,0 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file diff --git a/changelogs/fragments/5519.yml b/changelogs/fragments/5519.yml new file mode 100644 index 000000000000..f67e6baed1f6 --- /dev/null +++ b/changelogs/fragments/5519.yml @@ -0,0 +1,4 @@ +feat: +- Designed new procedure for automating the process for updates of changelogs and release notes ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) +- Created Github workflow automating creation of changeset files (i.e. fragments) with changelog entries related to update([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) +- Created script automating the update of CHANGELOG.md file and release notes files ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) From 862b72b64f00b89cbe42d9cae182ec009eda6ae8 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 11:43:31 +0000 Subject: [PATCH 106/141] updating changeset worflow removing syncronize option Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 705f7bd4b3ef..be90c1f5e09b 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -2,7 +2,7 @@ name: Create Change Set on: pull_request: - types: [synchronize, opened, edited] + types: [opened, edited] paths-ignore: - 'changelogs/fragments/**/*' From 4f63874959b7cba43ff3e2ad753f0980d020ba55 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 11:58:01 +0000 Subject: [PATCH 107/141] deleting 5519.yml fragment file (now will be generated by workflow) Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/5519.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 changelogs/fragments/5519.yml diff --git a/changelogs/fragments/5519.yml b/changelogs/fragments/5519.yml deleted file mode 100644 index f67e6baed1f6..000000000000 --- a/changelogs/fragments/5519.yml +++ /dev/null @@ -1,4 +0,0 @@ -feat: -- Designed new procedure for automating the process for updates of changelogs and release notes ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) -- Created Github workflow automating creation of changeset files (i.e. fragments) with changelog entries related to update([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) -- Created script automating the update of CHANGELOG.md file and release notes files ([#5519](https://github.com/BigSamu/OpenSearch-Dashboards/pull/5519)) From aef2861207ea90cac6976efc29b6b56951624885 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:18:42 +0000 Subject: [PATCH 108/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..975b36f774b3 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,2 @@ +feat: +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From f359dfbd5572e8cb86d3d6bc6ce7ef8ef47e5c88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:22:57 +0000 Subject: [PATCH 109/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 975b36f774b3..89246cb73db0 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,5 @@ feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From c258342e8980f592a1c09e044de5c18fc3b77bde Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 15:42:14 +0000 Subject: [PATCH 110/141] removing 2.yml fragment dummy file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/2.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index 89246cb73db0..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,5 +0,0 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From d117bd522a7f5aabc61d4788afc09ffcf27cf25e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:46:39 +0000 Subject: [PATCH 111/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..89246cb73db0 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,5 @@ +feat: +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 996b6ecde060f70b879961f87bdbca1178d7830f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:48:59 +0000 Subject: [PATCH 112/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 89246cb73db0..99b1a4662008 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -2,4 +2,7 @@ feat: - Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +test: +- Test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From ced0e10d665876db041b84784e0f236064c633e2 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 15:50:04 +0000 Subject: [PATCH 113/141] removing 2.yml fragment dummy file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/2.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index 99b1a4662008..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,8 +0,0 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Adds documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -test: -- Test ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 9387e34340d41b0125906e6e9b6044c9fe5449fa Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Wed, 13 Dec 2023 11:27:22 -0500 Subject: [PATCH 114/141] refactored code (deleteFragments, readFragments returns sections and paths) Signed-off-by: CMDWillYang --- src/dev/generate_release_note.ts | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index 4f6fd6743e48..c3fd387d4a63 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -4,7 +4,7 @@ */ import { resolve } from 'path'; -import { readFileSync, writeFileSync, readdirSync, unlinkSync } from 'fs'; +import { readFileSync, writeFileSync, unlinkSync, Dirent } from 'fs'; import { load as loadYaml } from 'js-yaml'; import { readdir } from 'fs/promises'; import { version as pkgVersion } from '../../package.json'; @@ -44,15 +44,21 @@ function addContentAfterUnreleased(path: string, newContent: string): void { writeFileSync(path, fileContent); } -const currentDate = getCurrentDateFormatted(); - -// Initialize sections -const sections: Changelog = (Object.fromEntries( - Object.keys(SECTION_MAPPING).map((key) => [key, []]) -) as unknown) as Changelog; +function deleteFragments(fragmentPaths: Dirent[]): void { + // Delete fragment files + for (const fragmentFilename of fragmentPaths) { + const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); + unlinkSync(fragmentPath); + } +} // Read fragment files and populate sections async function readFragments() { + // Initialize sections + const sections: Changelog = (Object.fromEntries( + Object.keys(SECTION_MAPPING).map((key) => [key, []]) + ) as unknown) as Changelog; + const fragmentPaths = await readdir(fragmentDirPath, { withFileTypes: true }); for (const fragmentFilename of fragmentPaths) { // skip non yml or yaml files @@ -73,16 +79,12 @@ async function readFragments() { sections[sectionKey as SectionKey].push(...entries); } } - - // Delete fragment files - for (const fragmentFilename of fragmentPaths) { - const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); - unlinkSync(fragmentPath); - } + return { sections, fragmentPaths }; } (async () => { - await readFragments(); + const { sections, fragmentPaths } = await readFragments(); + deleteFragments(fragmentPaths); // Generate changelog sections const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { @@ -93,6 +95,7 @@ async function readFragments() { }); // Generate full changelog + const currentDate = getCurrentDateFormatted(); const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) ${changelogSections.join('\n\n')} From 4ec65488bbc582cdcc38d286b97f0e3f9fa2146d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:31:18 +0000 Subject: [PATCH 115/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..975b36f774b3 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,2 @@ +feat: +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 0c4a14106ec48da351a74753d1046b7e600766b5 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 16:32:21 +0000 Subject: [PATCH 116/141] removing 2.yml fragment dummy file Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/2.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index 975b36f774b3..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,2 +0,0 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From d736d6b30740824b7bdf3632564ce6062301fdaa Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Wed, 13 Dec 2023 13:07:45 -0500 Subject: [PATCH 117/141] moved deleteFragment to end of script Signed-off-by: CMDWillYang --- src/dev/generate_release_note.ts | 3 ++- src/dev/generate_release_note_helper.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index c3fd387d4a63..589bfc98d58a 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -84,7 +84,6 @@ async function readFragments() { (async () => { const { sections, fragmentPaths } = await readFragments(); - deleteFragments(fragmentPaths); // Generate changelog sections const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { @@ -109,4 +108,6 @@ async function readFragments() { // Update changelog file addContentAfterUnreleased(filePath, changelog); + + deleteFragments(fragmentPaths); })(); diff --git a/src/dev/generate_release_note_helper.ts b/src/dev/generate_release_note_helper.ts index a895edf03703..ac2fe96b2fa8 100644 --- a/src/dev/generate_release_note_helper.ts +++ b/src/dev/generate_release_note_helper.ts @@ -58,7 +58,8 @@ export function validateFragment(content: string) { if (entry === '') { continue; } - if (!entryRegex.test(entry)) { + // if (!entryRegex.test(entry)) { + if (!entryRegex.test(entry.trim())) { throw new Error(`Invalid entry ${entry} in section ${sectionKey}.`); } } From bc988e79fe0dede5547fb9f7d52b66aca22af31e Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 18:08:16 +0000 Subject: [PATCH 118/141] removing changelog_verifier.yml Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/changelog_verifier.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/changelog_verifier.yml diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml deleted file mode 100644 index 0890ea8b8fbb..000000000000 --- a/.github/workflows/changelog_verifier.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Changelog Verifier" -on: - pull_request: - branches: [ '**', '!feature/**' ] - 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, Skip-Changelog" From 8d456ff1e74e33cd34d173e3f3d2f46c385f9a2f Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Wed, 13 Dec 2023 13:23:55 -0500 Subject: [PATCH 119/141] changed max_length to 100 Signed-off-by: CMDWillYang --- src/dev/generate_release_note_helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/generate_release_note_helper.ts b/src/dev/generate_release_note_helper.ts index ac2fe96b2fa8..b22cf409b3ae 100644 --- a/src/dev/generate_release_note_helper.ts +++ b/src/dev/generate_release_note_helper.ts @@ -37,7 +37,7 @@ export const SECTION_MAPPING = { export type SectionKey = keyof typeof SECTION_MAPPING; export type Changelog = Record; -const MAX_ENTRY_LENGTH = 50; +const MAX_ENTRY_LENGTH = 100; // validate format of fragment files export function validateFragment(content: string) { From 53e5445ec9d33801dda46ce876fe741a617995f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 18:38:11 +0000 Subject: [PATCH 120/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..5abf36c586a5 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,5 @@ +feat: +- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Add documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 44958fc967b43aee054e5a9ffa50426908ef7cd6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 18:38:39 +0000 Subject: [PATCH 121/141] Add changeset for PR #2 From 53bf365ba9735136d112d82aa8c71a0026bbc887 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 18:48:23 +0000 Subject: [PATCH 122/141] adding write permissions to for changeset workflow Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index be90c1f5e09b..fd93ccb30e94 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -9,6 +9,9 @@ on: jobs: update-changelog: runs-on: ubuntu-latest + permissions: + contents: write + issues: write steps: - name: Check out repository uses: actions/checkout@v4 From e4798bb6699ee46a0a1bb490c3397bc56e09982a Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 18:48:53 +0000 Subject: [PATCH 123/141] removing 2.yml fragment dummy file Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 1 + changelogs/fragments/2.yml | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 changelogs/fragments/2.yml diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index fd93ccb30e94..c8e3a327e2bb 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -12,6 +12,7 @@ jobs: permissions: contents: write issues: write + pull-requests: write steps: - name: Check out repository uses: actions/checkout@v4 diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml deleted file mode 100644 index 5abf36c586a5..000000000000 --- a/changelogs/fragments/2.yml +++ /dev/null @@ -1,5 +0,0 @@ -feat: -- Adds new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Add documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From a7ed3c031e8bb69baca75dd3e527c93cfb62809c Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 18:54:16 +0000 Subject: [PATCH 124/141] adding write permissions to for changeset workflow Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index c8e3a327e2bb..ba06089a253c 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -13,6 +13,7 @@ jobs: contents: write issues: write pull-requests: write + repository-projects: write steps: - name: Check out repository uses: actions/checkout@v4 From 97eb4c98a04c4fe71b78a0ec9e3a75bda7f10302 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 19:06:08 +0000 Subject: [PATCH 125/141] adding write permissions to for changeset workflow Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index ba06089a253c..3ee975e492f6 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -9,11 +9,7 @@ on: jobs: update-changelog: runs-on: ubuntu-latest - permissions: - contents: write - issues: write - pull-requests: write - repository-projects: write + permissions: write-all steps: - name: Check out repository uses: actions/checkout@v4 From bc888ec0f395c00ecf520afb9293d17f9591ad59 Mon Sep 17 00:00:00 2001 From: CMDWillYang Date: Wed, 13 Dec 2023 14:15:12 -0500 Subject: [PATCH 126/141] refactored code/main function, now move fragment to temp folder. Signed-off-by: CMDWillYang --- src/dev/generate_release_note.ts | 54 ++++++++++++++++++------- src/dev/generate_release_note_helper.ts | 1 + 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/dev/generate_release_note.ts b/src/dev/generate_release_note.ts index 589bfc98d58a..158c48b79d49 100644 --- a/src/dev/generate_release_note.ts +++ b/src/dev/generate_release_note.ts @@ -4,9 +4,9 @@ */ import { resolve } from 'path'; -import { readFileSync, writeFileSync, unlinkSync, Dirent } from 'fs'; +import { readFileSync, writeFileSync, Dirent, renameSync, rm } from 'fs'; import { load as loadYaml } from 'js-yaml'; -import { readdir } from 'fs/promises'; +import { mkdir, readdir } from 'fs/promises'; import { version as pkgVersion } from '../../package.json'; import { validateFragment, @@ -14,6 +14,7 @@ import { Changelog, SECTION_MAPPING, fragmentDirPath, + fragmentTempDirPath, SectionKey, releaseNotesDirPath, filePath, @@ -44,12 +45,12 @@ function addContentAfterUnreleased(path: string, newContent: string): void { writeFileSync(path, fileContent); } -function deleteFragments(fragmentPaths: Dirent[]): void { - // Delete fragment files - for (const fragmentFilename of fragmentPaths) { - const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); - unlinkSync(fragmentPath); - } +async function deleteFragments() { + rm(fragmentTempDirPath, { recursive: true }, (err: any) => { + if (err) { + throw err; + } + }); } // Read fragment files and populate sections @@ -82,9 +83,19 @@ async function readFragments() { return { sections, fragmentPaths }; } -(async () => { - const { sections, fragmentPaths } = await readFragments(); +async function moveFragments(fragmentPaths: Dirent[]): Promise { + // create folder for temp fragments at fragmentTempDirPath + await mkdir(fragmentTempDirPath, { recursive: true }); + + // Move fragment files to temp fragments folder + for (const fragmentFilename of fragmentPaths) { + const fragmentPath = resolve(fragmentDirPath, fragmentFilename.name); + const fragmentTempPath = resolve(fragmentTempDirPath, fragmentFilename.name); + renameSync(fragmentPath, fragmentTempPath); + } +} +function generateChangelog(sections: Changelog) { // Generate changelog sections const changelogSections = Object.entries(sections).map(([sectionKey, entries]) => { const sectionName = SECTION_MAPPING[sectionKey as SectionKey]; @@ -95,19 +106,32 @@ async function readFragments() { // Generate full changelog const currentDate = getCurrentDateFormatted(); - const changelog = `## [${pkgVersion}-${currentDate}](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/${pkgVersion}) - + const changelog = `## [${pkgVersion}-${currentDate}]( ${changelogSections.join('\n\n')} `; + // Update changelog file + addContentAfterUnreleased(filePath, changelog); + return changelogSections; +} +function generateReleaseNote(changelogSections: string[]) { // Generate release note const releaseNoteFilename = `opensearch-dashboards.release-notes-${pkgVersion}.md`; const releaseNoteHeader = `# VERSION ${pkgVersion} Release Note`; const releaseNote = `${releaseNoteHeader}\n\n${changelogSections.join('\n\n')}`; writeFileSync(resolve(releaseNotesDirPath, releaseNoteFilename), releaseNote); +} - // Update changelog file - addContentAfterUnreleased(filePath, changelog); +(async () => { + const { sections, fragmentPaths } = await readFragments(); + + // move fragments to temp fragments folder + await moveFragments(fragmentPaths); + + const changelogSections = generateChangelog(sections); + + generateReleaseNote(changelogSections); - deleteFragments(fragmentPaths); + // remove temp fragments folder + await deleteFragments(); })(); diff --git a/src/dev/generate_release_note_helper.ts b/src/dev/generate_release_note_helper.ts index b22cf409b3ae..0f73122755f7 100644 --- a/src/dev/generate_release_note_helper.ts +++ b/src/dev/generate_release_note_helper.ts @@ -7,6 +7,7 @@ import { resolve } from 'path'; export const filePath = resolve(__dirname, '..', '..', 'CHANGELOG.md'); export const fragmentDirPath = resolve(__dirname, '..', '..', 'changelogs', 'fragments'); +export const fragmentTempDirPath = resolve(__dirname, '..', '..', 'changelogs', 'temp_fragments'); export const releaseNotesDirPath = resolve(__dirname, '..', '..', 'release-notes'); export function getCurrentDateFormatted(): string { From 1b43e42e33a77dce16453bf4031059b7e2ce8d84 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Wed, 13 Dec 2023 17:25:37 -0500 Subject: [PATCH 127/141] Add test.txt Signed-off-by: Johnathon Bowers --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000000..e69de29bb2d1 From 8bb008ba0c1735c82516bbc329b8f2e1587d3373 Mon Sep 17 00:00:00 2001 From: Johnathon Bowers Date: Wed, 13 Dec 2023 17:28:09 -0500 Subject: [PATCH 128/141] Remove test.txt Signed-off-by: Johnathon Bowers --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index e69de29bb2d1..000000000000 From 0b567744b14e4a398a116ea60708c78d3cc08377 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Wed, 13 Dec 2023 23:45:22 +0000 Subject: [PATCH 129/141] updating token name for workflow Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 3ee975e492f6..0b0ddaeb7ca9 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -16,5 +16,5 @@ jobs: - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: - token: ${{secrets.GITHUB_TOKEN}} + token: ${{secrets.OPENSEARCH_TOKEN}} changeset_path: changelogs/fragments From 6285dca324aa188f6d009ebc6bdb39223ae35e69 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 00:18:27 +0000 Subject: [PATCH 130/141] update token name Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 0b0ddaeb7ca9..82d0aec5dcc0 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -16,5 +16,5 @@ jobs: - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: - token: ${{secrets.OPENSEARCH_TOKEN}} + token: ${{ secrets.GITHUB_TOKEN }} changeset_path: changelogs/fragments From 67200d249ee497d91029c33c44d8089867dfb189 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 02:46:46 +0000 Subject: [PATCH 131/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..a0bd60d8add3 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,8 @@ +feat: +- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +doc: +- Add documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fix bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 9f508f524b616b3298853b0755df2f02944ecbe8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 02:52:03 +0000 Subject: [PATCH 132/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index a0bd60d8add3..7ce32155b340 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -5,4 +5,4 @@ doc: - Add documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) fix: -- Fix bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Fix bugs ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 58dbc6962617d651a5bfc2106ea7aec7661df498 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:00:22 +0000 Subject: [PATCH 133/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 7ce32155b340..9743fafba3ea 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,8 +1,2 @@ feat: -- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -doc: -- Add documentation ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) - -fix: -- Fix bugs ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From cbf568946a9a6b95a6bfb375c30082f8b707e9af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:05:50 +0000 Subject: [PATCH 134/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml index 9743fafba3ea..2795ea18df92 100644 --- a/changelogs/fragments/2.yml +++ b/changelogs/fragments/2.yml @@ -1,2 +1,5 @@ feat: -- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file +- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fix bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From affdf8d6d0912d0f99dcb75c3ee3b5503cd498c5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:59:32 +0000 Subject: [PATCH 135/141] Add changeset for PR #2 --- changelogs/fragments/2.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/fragments/2.yml diff --git a/changelogs/fragments/2.yml b/changelogs/fragments/2.yml new file mode 100644 index 000000000000..2795ea18df92 --- /dev/null +++ b/changelogs/fragments/2.yml @@ -0,0 +1,5 @@ +feat: +- Add new feature ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) + +fix: +- Fix bug ([#2](https://github.com/BigSamu/OpenSearch-Dashboards/pull/2)) \ No newline at end of file From 62739b7f827aa23f1744c97ba89d4772135f4bc3 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 13:39:19 +0000 Subject: [PATCH 136/141] updating changeset workflow by giving correct reference for checkout action Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 82d0aec5dcc0..ca546eaa04b2 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: From b81044cebbf50b8482e1aefef81577e934b8e542 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 14:00:46 +0000 Subject: [PATCH 137/141] updating changeset workflow by removing reference for checkout action Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index ca546eaa04b2..82d0aec5dcc0 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - name: Update Changelog uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: From e8f4fbb36aef5d01a974cf0e868afde8edb1976b Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 15:48:13 +0000 Subject: [PATCH 138/141] updating github action event from pull_request to pull_request_target Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index 82d0aec5dcc0..e0da3f12a67a 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -1,7 +1,7 @@ name: Create Change Set on: - pull_request: + pull_request_target: types: [opened, edited] paths-ignore: - 'changelogs/fragments/**/*' From 88994050c48499ee258213d78090141ae53d9495 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:52:33 +0000 Subject: [PATCH 139/141] Add changeset for PR #19 --- changelogs/fragments/19.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/19.yml diff --git a/changelogs/fragments/19.yml b/changelogs/fragments/19.yml new file mode 100644 index 000000000000..6ed2c278274a --- /dev/null +++ b/changelogs/fragments/19.yml @@ -0,0 +1,2 @@ +test: +- Test ([#19](https://github.com/BigSamu/OpenSearch-Dashboards/pull/19)) \ No newline at end of file From 8abb3a846d4b0adf72689a7901b24359ee879e51 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 15:55:26 +0000 Subject: [PATCH 140/141] deleting fragment 19.yml Signed-off-by: Samuel Valdes Gutierrez --- changelogs/fragments/19.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 changelogs/fragments/19.yml diff --git a/changelogs/fragments/19.yml b/changelogs/fragments/19.yml deleted file mode 100644 index 6ed2c278274a..000000000000 --- a/changelogs/fragments/19.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: -- Test ([#19](https://github.com/BigSamu/OpenSearch-Dashboards/pull/19)) \ No newline at end of file From 13609ce6c051f557a7fc7b52a6ca8037d81f3e9a Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 14 Dec 2023 16:33:01 +0000 Subject: [PATCH 141/141] adding CHANGESET_TOKEN and related logic Signed-off-by: Samuel Valdes Gutierrez --- .github/workflows/create_change_set_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create_change_set_workflow.yml b/.github/workflows/create_change_set_workflow.yml index e0da3f12a67a..1b0b0dcd9985 100644 --- a/.github/workflows/create_change_set_workflow.yml +++ b/.github/workflows/create_change_set_workflow.yml @@ -17,4 +17,5 @@ jobs: uses: BigSamu/OpenSearch_Change_Set_Create_Action@main with: token: ${{ secrets.GITHUB_TOKEN }} + changeset_token: ${{ secrets.CHANGESET_TOKEN }} changeset_path: changelogs/fragments