Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add RELEASE.md for the release process #1690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ This is the [Go](http://golang.org) client library for
instrumenting application code, and one for creating clients that talk to the
Prometheus HTTP API.

**This library requires Go1.21 or later.**
> The library mandates the use of Go1.21 or subsequent versions. While it has demonstrated functionality with versions as old as Go 1.17, our commitment remains to offer support and rectifications for only the most recent three major releases.
## Version Compatibility

This library supports the three most recent major releases of Go. While it may function with older versions, we only provide fixes and support for the currently supported Go releases.

> [!NOTE]
> See our [Release Process](RELEASE.md#supported-go-versions) for details on compatibility and support policies.

## Important note about releases and stability

Expand Down Expand Up @@ -68,24 +72,3 @@ See the [contributing guidelines](CONTRIBUTING.md) and the
[Community section](http://prometheus.io/community/) of the homepage.

`client_golang` community is also present on the CNCF Slack `#prometheus-client_golang`.

### For Maintainers: Release Process

To cut a minor version:

1. Create a new branch `release-<major>.<minor>` on top of the `main` commit you want to cut the version from and push it.
2. Create a new branch on top of the release branch, e.g. `<yourname>/cut-<major>.<minor>.<patch>`,
3. Change the `VERSION` file.
4. Update `CHANGELOG` (only user-impacting changes to mention).
5. Create PR, and get it reviewed.
6. Once merged, create a release with the `release-<major>.<minor>` tag on GitHub with the `<version>` title.
7. Announce on the prometheus-announce mailing list, slack and Twitter.
8. Merge the release branch back to the `main` using the "merge without squashing" approach (!).

> NOTE: In case of merge conflicts, you can checkout the release branch in a new branch, e.g. `<yourname>/resolve-conflicts`, fix the merge problems there, and then do a PR into main from the new branch. In that way, you still get all the commits in the release branch back into `main`, but leave the release branch alone.

To cut the patch version:

1. Create a branch on top of the release branch you want to use.
2. Cherry-pick the fixes from the `main` branch (or add new commits) to fix critical bugs for that patch release.
3. Follow steps 3-8 as above.
152 changes: 152 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Release

The Prometheus Go client library follows a release process similar to the [Prometheus server](https://github.com/prometheus/prometheus/blob/main/RELEASE.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it similar? I have the impression that we do releases when we have a feeling it's needed, there's no schedule here 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can explicitly state that we don't have a cadence.


## Branch Management

We use [Semantic Versioning](https://semver.org/).

- Maintain separate `release-<major>.<minor>` branches
- Branch protection enabled automatically for `release-*` branches
- Bug fixes go to latest release branch, then merge to main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Bug fixes go to latest release branch, then merge to main
- Bug fixes go to the latest release branch, then merge to main

- Features and changes go to main branch
- Older release branches maintained on best-effort basis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Older release branches maintained on best-effort basis
- Non-latest minor release branches are maintained (e.g. bug and security fixes) on the best-effort basis


## Pre-Release Preparations

1. Review main branch state:
- Expedite critical bug fixes
- Hold back risky changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Hold back risky changes
- Don't rush on risky changes, consider them for the next release if not ready

- Update dependencies via Dependabot PRs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Update dependencies via Dependabot PRs
- Update dependencies via Dependabot PRs or manually if needed

- Check for security alerts

## Cutting a Minor Release

1. Create release branch:

```bash
git checkout -b release-<major>.<minor> main
git push origin release-<major>.<minor>
```

2. Create feature branch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Create feature branch:
2. Create a new branch on top of `release-<major>.<minor>`:


```bash
git checkout -b <yourname>/cut-<major>.<minor>.0 release-<major>.<minor>
```

3. Update version and documentation:
- Update `VERSION` file
- Update `CHANGELOG.md` (user-impacting changes)
- Order: [SECURITY], [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
- For RCs, append `-rc.0`

4. Create PR and get review

5. After merge, create tags:

```bash
tag="v$(< VERSION)"
git tag -s "${tag}" -m "${tag}"
git push origin "${tag}"
```

6. For Release Candidates:
- Create PR against prometheus/prometheus using RC version
- Create PR against kubernetes/kubernetes using RC version
- Make sure the CI is green for the PRs
- Allow 1-2 days for downstream testing
- Fix any issues found before final release
- Use `-rc.1`, `-rc.2` etc. for additional fixes

7. For Final Release:
- Wait for CI completion
- Verify artifacts published
Comment on lines +63 to +64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Wait for CI completion
- Verify artifacts published

There are no CI/artifacts for our library.

- Click "Publish release"
- For RCs, ensure "pre-release" box is checked

8. Announce release:
- <[email protected]>
- Slack
- x.com/BlueSky
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean with our personal accounts? Or Prometheus account?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters. We can use our own accounts and ask someone to repost it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters. We can use our own accounts and ask someone to repost it.


9. Merge release branch to main:

```bash
git checkout main
git merge --no-ff release-<major>.<minor>
```

## Cutting a Patch Release

1. Create branch from release branch:

```bash
git checkout -b <yourname>/cut-<major>.<minor>.<patch> release-<major>.<minor>
```

2. Apply fixes:
- Cherry-pick from main: `git cherry-pick <commit>`
- Or add new fix commits
Comment on lines +89 to +90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Cherry-pick from main: `git cherry-pick <commit>`
- Or add new fix commits
- Commit the required fixes; avoid refactoring or otherwise risky changes (preferred)
- Cherry-pick from main if fix was already merged there: `git cherry-pick <commit>`


3. Follow steps 3-9 from minor release process

## Handling Merge Conflicts

If conflicts occur merging to main:

1. Create branch: `<yourname>/resolve-conflicts`
2. Fix conflicts there
3. PR into main
4. Leave release branch unchanged

## Note on Versioning

Go modules require strict semver. Because we don't commit to avoid breaking changes between minor releases, we use major version zero releases for libraries.
Comment on lines +103 to +105
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy pasta? I think we do care about breaking changes =D

Suggested change
## Note on Versioning
Go modules require strict semver. Because we don't commit to avoid breaking changes between minor releases, we use major version zero releases for libraries.


## Compatibility Guarantees

### Supported Go Versions

- Support provided only for the three most recent major Go releases
- While the library may work with older versions, no fixes or support provided
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- While the library may work with older versions, no fixes or support provided
- While the library may work with older Go versions, support and fixes are best-effort for those.

- Each release documents the minimum required Go version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add that to the TODO list for release too?


### API Stability

The Prometheus Go client library aims to maintain backward compatibility within minor versions, similar to [Go 1 compatibility promises](https://golang.org/doc/go1compat). However, as indicated by the major version zero (v0):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as indicated by the major version zero (v0)

What v0 version?


- API signatures may change between minor versions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? They can't change in many cases I believe e.g. you cannot rename them, remove arguments, or add arguments (unless it's variadic).

- Types may be modified or relocated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, they cannot mostly (you can only add fields)

- Default behaviors might be altered
- Feature removal/deprecation can occur with minor version bump
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It cannot, mostly? 🤔


### Compatibility Testing

Before each release:

1. **Internal Testing**:
- Full test suite must pass
- Integration tests with latest Prometheus server
- Benchmark comparisons with previous version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? We don't have any tooling or way right now. Should we skip this and add once we have such a process?


2. **External Validation**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. **External Validation**:
2. **External Validation**:
Test against bigger users, especially looking for broken tests or builds. This will give us awareness of a potential accidental breaking changes, or if there were intentional ones, the potential damage radius of them.

- Testing with prometheus/prometheus master branch
- Testing with kubernetes/kubernetes master branch
Comment on lines +134 to +135
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Testing with prometheus/prometheus master branch
- Testing with kubernetes/kubernetes master branch
- Testing with prometheus/prometheus main branch
- Testing with kubernetes/kubernetes main branch

- Breaking changes must be documented in CHANGELOG.md

### Version Policy

- Bug fixes increment patch version (e.g., v0.9.1)
- New features increment minor version (e.g., v0.10.0)
- Breaking changes increment minor version with clear documentation
- Major version remains at 0 to indicate potential instability
Comment on lines +138 to +143
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy pasta? It's bit trivial and also wrong (we are not v0 version)


### Deprecation Policy

1. Features may be deprecated in any minor release
2. Deprecated features:
- Will be documented in CHANGELOG.md
- Will emit warnings when used (when possible)
- May be removed in next minor version
- Must have migration path documented
Comment on lines +145 to +152
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not needed?