Skip to content

Commit 1e517d1

Browse files
committed
Replace CHANGELOG.md with release-notes/AGENTS.md
Use an AI agent steering file to generate release notes from commit messages, PR descriptions, and PR labels. Signed-off-by: Andrew Ross <andrross@amazon.com>
1 parent 0537405 commit 1e517d1

File tree

5 files changed

+172
-31
lines changed

5 files changed

+172
-31
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
*.p12 binary
1313
*.ttf binary
1414
*.txt text=auto
15-
CHANGELOG.md merge=union

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# CHANGELOG
2-
All notable changes to this project are documented in this file.
1+
The CHANGELOG has been replaced by the process defined in release-notes/AGENTS.md
32

43
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See the [CONTRIBUTING guide](./CONTRIBUTING.md#Changelog) for instructions on how to add changelog entries.
54

@@ -87,3 +86,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8786
### Removed
8887

8988
[Unreleased 3.x]: https://github.com/opensearch-project/OpenSearch/compare/3.6...main
89+
Please ensure your PR is properly labeled with a good commit message and/or PR description

CONTRIBUTING.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- [Documentation Changes](#documentation-changes)
77
- [Contributing Code](#contributing-code)
88
- [Developer Certificate of Origin](#developer-certificate-of-origin)
9-
- [Changelog](#changelog)
109
- [Review Process](#review-process)
1110
- [Tips for Success](#tips)
1211
- [Troubleshooting Failing Builds](#troubleshooting-failing-builds)
@@ -119,33 +118,6 @@ Signed-off-by: Jane Smith <jane.smith@email.com>
119118
```
120119
You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `--signoff` to add the `Signed-off-by` line to the end of the commit message.
121120

122-
## Changelog
123-
124-
OpenSearch maintains version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) format. The purpose of the changelog is for the contributors and maintainers to incrementally build the release notes throughout the development process to avoid a painful and error-prone process of attempting to compile the release notes at release time. On each release the "unreleased" entries of the changelog are moved to the appropriate release notes document in the `./release-notes` folder. Also, incrementally building the changelog provides a concise, human-readable list of significant features that have been added to the unreleased version under development.
125-
126-
### Which changes require a CHANGELOG entry?
127-
Changelogs are intended for operators/administrators, developers integrating with libraries and APIs, and end-users interacting with OpenSearch Dashboards and/or the REST API (collectively referred to as "user"). In short, any change that a user of OpenSearch might want to be aware of should be included in the changelog. The changelog is _not_ intended to replace the git commit log that developers of OpenSearch itself rely upon. The following are some examples of changes that should be in the changelog:
128-
129-
- A newly added feature
130-
- A fix for a user-facing bug
131-
- Dependency updates
132-
- Fixes for security issues
133-
134-
The following are some examples where a changelog entry is not necessary:
135-
136-
- Adding, modifying, or fixing tests
137-
- An incremental PR for a larger feature (such features should include _one_ changelog entry for the feature)
138-
- Documentation changes or code refactoring
139-
- Build-related changes
140-
141-
Any PR that does not include a changelog entry will result in a failure of the validation workflow in GitHub. If the contributor and maintainers agree that no changelog entry is required, then the `skip-changelog` label can be applied to the PR which will result in the workflow passing.
142-
143-
### How to add my changes to [CHANGELOG](CHANGELOG.md)?
144-
145-
Adding in the change is two step process:
146-
1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR
147-
2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there.
148-
149121
## Review Process
150122

151123
We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/OpenSearch/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction.

RELEASING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
## Releasing
22

33
This project follows [OpenSearch project branching, labelling, and releasing](https://github.com/opensearch-project/.github/blob/main/RELEASING.md).
4+
5+
### Release Notes
6+
7+
The [release notes AGENTS.md file](release-notes/AGENTS.md) is intended to be given to an AI agent as a prompt. It will generate release notes and create a pull request. The agent will need to access commit information from the local git repository as well as permissions to read pull request descriptions and create a new pull request in GitHub.

release-notes/AGENTS.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Generate Release Notes
2+
3+
When asked to generate release notes, follow this procedure.
4+
5+
## Inputs
6+
7+
- `PREV_TAG`: The previous release tag (e.g., `3.4.0`)
8+
- `RELEASE_REF`: The release tag or branch to generate notes for (e.g., `3.5.0` or `upstream/3.5`)
9+
10+
If not provided, infer from context. Use `git tag --sort=-creatordate` to find recent tags.
11+
12+
All temporary files throughout this process should be written to `/tmp/release-notes-VERSION/` (e.g., `/tmp/release-notes-3.6.0/`). Create this directory at the start. This makes cleanup easy: `rm -rf /tmp/release-notes-VERSION/`.
13+
14+
## Step 1: Identify commits to exclude
15+
16+
The previous release tag lives on a release branch, not on main. Commits merged to main during the release window (between the branch cut and the tag) may have been backported to the release branch. These already shipped in the previous release and must be excluded.
17+
18+
```
19+
PREV_BRANCH_CUT=$(git merge-base "$PREV_TAG" "$RELEASE_REF")
20+
```
21+
22+
Extract all PR numbers from commits in the previous release window:
23+
24+
```
25+
git log ${PREV_BRANCH_CUT}..${PREV_TAG} --format='%s'
26+
```
27+
28+
Parse PR numbers (pattern `#NNNNN`) from these commit subjects. This is the exclusion set.
29+
30+
## Step 2: Collect candidate commits
31+
32+
```
33+
git log ${PREV_TAG}..${RELEASE_REF} --format='%s' --reverse
34+
```
35+
36+
Remove any commit whose PR number appears in the exclusion set from step 1. Log which commits were excluded and why.
37+
38+
Detect commit/revert pairs (a commit followed by a revert of that commit) and exclude both — the net effect is no change.
39+
40+
## Step 3: Fetch PR metadata
41+
42+
For each non-dependency-bump commit, fetch the PR title, labels, and description in a single call and write the results to a temp file per PR:
43+
44+
```
45+
gh pr view NNNNN --json title,body,labels --jq '{title, labels: [.labels[].name], body}' > /tmp/release-notes-VERSION/pr-NNNNN.json
46+
```
47+
48+
Dependency bumps (commit message matches "Bump X from Y to Z" or similar) do not need a GitHub API call — the commit message is sufficient. These go directly into the Dependencies category.
49+
50+
## Step 4: Filter and categorize
51+
52+
Using the cached PR metadata from step 3:
53+
54+
1. **Hard exclude** any PR with the `skip-changelog` label, regardless of content.
55+
56+
2. **Exclude non-user-facing changes** per this policy:
57+
- Test additions, modifications, or fixes (flaky test fixes, test refactoring)
58+
- Incremental PRs for a larger feature (these should already have one entry from the main PR)
59+
- Documentation changes or internal code refactoring
60+
- Build-related changes (CI config, Gradle changes)
61+
- Release machinery (release notes commits, README edits)
62+
- Maintainer list changes
63+
64+
Use the commit message, PR description, and labels to make this judgment. When uncertain whether a change is user-facing, include it — a human reviewer can remove it later.
65+
66+
3. **Categorize** each surviving commit using [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) categories. PR labels are useful here (e.g., `enhancement`, `bug`, `breaking`, `dependencies`, `deprecation`):
67+
- **Added** — new features and capabilities
68+
- **Changed** — changes to existing functionality
69+
- **Deprecated** — features that will be removed in a future release
70+
- **Removed** — features that were removed
71+
- **Fixed** — bug fixes
72+
- **Dependencies** — dependency version updates. List Apache Lucene updates first.
73+
74+
4. **Write entries.** For each entry, write a concise one-line summary. Use the commit message and PR description as input but rewrite for clarity and consistency. The target audience for these notes are OpenSearch users, such as end-users, operators, and system administrators.
75+
76+
Format each entry as:
77+
78+
```
79+
- Summary of change ([#NNNNN](https://github.com/opensearch-project/OpenSearch/pull/NNNNN))
80+
```
81+
82+
Group related commits into a single entry when appropriate (e.g., multiple PRs implementing parts of the same feature, or a series of dependency bumps for the same library).
83+
84+
## Step 5: Track borderline calls
85+
86+
During steps 1–4, record any judgment calls where the categorization or inclusion/exclusion decision is debatable. Examples:
87+
88+
- A PR labeled `bug` that reads more like a behavioral change
89+
- Grouping multiple PRs into a single entry
90+
- Including a PR that could reasonably be considered non-user-facing
91+
- Choosing one category over another when both fit
92+
93+
Write these to `/tmp/release-notes-VERSION/borderline.md` as a bulleted list. Each entry should reference the PR number(s) and briefly explain the decision and alternatives.
94+
95+
## Step 6: Output
96+
97+
Write the release notes file to `release-notes/opensearch.release-notes-VERSION.md` using this template:
98+
99+
```markdown
100+
## Version VERSION Release Notes
101+
102+
Compatible with OpenSearch and OpenSearch Dashboards version VERSION
103+
104+
### Added
105+
...
106+
107+
### Changed
108+
...
109+
110+
### Deprecated
111+
...
112+
113+
### Removed
114+
...
115+
116+
### Fixed
117+
...
118+
119+
### Dependencies
120+
...
121+
```
122+
123+
Omit empty categories. Use `- ` (dash space) for list items.
124+
125+
## Step 7: Commit and push
126+
127+
Identify the user's fork remote from `git remote -v` — look for a remote whose URL contains the user's GitHub username rather than `opensearch-project/OpenSearch`. If ambiguous, ask the user which remote to use.
128+
129+
```
130+
git checkout -b release-notes-VERSION
131+
git add release-notes/opensearch.release-notes-VERSION.md
132+
git commit -s -m "Add release notes for VERSION"
133+
git push <fork-remote> release-notes-VERSION
134+
```
135+
136+
## Step 8: Open PR
137+
138+
Create the PR body in a temp file, then open the PR:
139+
140+
```
141+
gh pr create \
142+
--base main \
143+
--head <github-user>:release-notes-VERSION \
144+
--title "Add release notes for VERSION" \
145+
--body-file /tmp/release-notes-VERSION/pr-body.md
146+
```
147+
148+
The PR body should follow this structure:
149+
150+
```markdown
151+
### Description
152+
Release notes for OpenSearch VERSION, covering commits from PREV_TAG to RELEASE_REF.
153+
154+
### Borderline calls
155+
- #NNNNN: Placed in **Category** — rationale. Could also be **Other Category**.
156+
- #AAAAA + #BBBBB: Grouped into one entry — rationale.
157+
- ...
158+
159+
### Check List
160+
- [x] Functionality includes testing.
161+
162+
By submitting this pull request, I confirm that my contribution is made under
163+
the terms of the Apache 2.0 license.
164+
```
165+
166+
The borderline calls section gives reviewers specific items to validate. If there are no borderline calls, omit the section.

0 commit comments

Comments
 (0)