Skip to content

Commit 0312681

Browse files
committed
ci: trim to release-note grouping and add release docs
Narrow the PR to grouping release notes by label: - Drop the path labeler. Its engine and area labels don't feed any release-note section. - Drop the Release Note section from the PR template. Nothing reads it. - Keep creating published GitHub releases rather than drafts. Whether to switch to drafts is a process decision for maintainers. Add RELEASING.md with the steps for releasing the Python package, the VS Code extension and the shared web package, and link to it from CONTRIBUTING.md. It was previously proposed separately in #6180. Signed-off-by: mday-io <mdaytn@gmail.com>
1 parent b9d60f0 commit 0312681

6 files changed

Lines changed: 73 additions & 103 deletions

File tree

‎.github/labeler.yml‎

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎.github/pull_request_template.md‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22

33
<!-- Describe your changes here -->
44

5-
## Release Note
6-
7-
<!--
8-
One or two sentences for users of SQLMesh: what changed for them, and anything they
9-
need to do when upgrading. Write "None" for changes users won't notice (CI, tests,
10-
refactors). Maintainers use this when writing the release highlights.
11-
-->
12-
135
## Test Plan
146

157
<!-- How were these changes tested? -->
168

179
## Checklist
1810

19-
- [ ] My PR title follows the `type(scope): description` format (see [CONTRIBUTING.md](CONTRIBUTING.md#pull-request-titles))
2011
- [ ] I have run `make style` and fixed any issues
2112
- [ ] I have added tests for my changes (if applicable)
2213
- [ ] All existing tests pass (`make fast-test`)

‎.github/workflows/pr-labels.yaml‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,11 @@ jobs:
120120
await github.rest.issues.addLabels({ owner, repo, issue_number, labels: toAdd });
121121
}
122122
123-
paths:
124-
name: Label by changed files
123+
migrations:
124+
name: Label new state migrations
125125
runs-on: ubuntu-latest
126126
steps:
127-
- uses: actions/labeler@v6
128-
with:
129-
configuration-path: .github/labeler.yml
130-
131-
- name: Label new state migrations
132-
uses: actions/github-script@v8
127+
- uses: actions/github-script@v8
133128
with:
134129
script: |
135130
const issue_number = context.payload.pull_request.number;

‎.github/workflows/release.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,3 @@ jobs:
6969
with:
7070
generate_release_notes: true
7171
tag_name: ${{ github.ref_name }}
72-
# Created as a draft so a maintainer can add highlights and upgrade
73-
# notes before publishing. Publishing to PyPI does not wait for this.
74-
draft: true

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ recategorize a PR, change its title rather than its labels. Use `ci` or `test` a
111111
or scope for internal-only changes (e.g. `fix(ci): ...`) so they are left out of the
112112
release notes. A maintainer can add the `skip-changelog` label to leave out any other PR.
113113

114+
## Releases
115+
116+
Maintainers publish releases. See [RELEASING.md](RELEASING.md) for the steps.
117+
114118
## Licensing
115119

116120
Code contributions are licensed under the [Apache License 2.0](LICENSE). Documentation contributions are licensed under [Creative Commons Attribution 4.0 International (CC-BY-4.0)](https://creativecommons.org/licenses/by/4.0/). See the LICENSE file and the [technical charter](sqlmesh-technical-charter.pdf) for details.

‎RELEASING.md‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Releasing SQLMesh
2+
3+
This guide is for maintainers with write access to `SQLMesh/sqlmesh`. It covers the three things the project publishes:
4+
5+
| Package | Registry | How a release starts |
6+
|---|---|---|
7+
| `sqlmesh` (Python) | PyPI | Push a `v*.*.*` tag |
8+
| SQLMesh VS Code extension | VS Code Marketplace and Open VSX | Run the **Release VSCode Extension** workflow |
9+
| `@tobikodata/sqlmesh-common` | npm | Run the **Release web common code** workflow |
10+
11+
## Release the Python Package
12+
13+
The [`Release`](.github/workflows/release.yaml) workflow runs when a tag that matches `v*.*.*` is pushed. The package version comes from the tag through `setuptools_scm`, so you don't edit a version number in the code.
14+
15+
The workflow does four things:
16+
17+
1. Builds the web UI and bundles it into the package.
18+
2. Publishes `sqlmesh` to PyPI with `make publish`.
19+
3. Publishes the test package to the private `tobiko-private` registry with `make publish-tests`.
20+
4. Creates a GitHub release with notes generated from the pull requests merged since the previous tag.
21+
22+
Each step publishes immediately and there's no approval gate. Check `main` before you tag.
23+
24+
### Steps
25+
26+
1. Pick the commit to release. It must be on `main`, and every required check must pass on it. Check the latest **pr.yaml** run for that commit on the [Actions page](https://github.com/SQLMesh/sqlmesh/actions/workflows/pr.yaml).
27+
2. Pick the version. Find the latest tag with `git tag --sort=-creatordate | head -1` and increment it.
28+
3. Tag the commit and push the tag:
29+
30+
```bash
31+
git fetch <sqlmesh-remote> main --tags
32+
git tag v0.236.5 <commit-sha>
33+
git push <sqlmesh-remote> v0.236.5
34+
```
35+
36+
Replace `<sqlmesh-remote>` with your remote for `SQLMesh/sqlmesh`. Push only the tag, not a branch.
37+
38+
4. Watch the [Release](https://github.com/SQLMesh/sqlmesh/actions/workflows/release.yaml) run until it finishes.
39+
5. Check that the new version is on [PyPI](https://pypi.org/project/sqlmesh/#history).
40+
6. Edit the generated release on the [Releases page](https://github.com/SQLMesh/sqlmesh/releases). Under **Breaking changes**, add a short upgrade note for each entry. Say what users will see after upgrading, such as a migration or a metadata-only change in `sqlmesh plan`.
41+
42+
If the workflow fails after the PyPI step, don't delete or reuse the tag. PyPI doesn't accept the same version twice. Fix the cause and release the next version.
43+
44+
### Release Notes
45+
46+
GitHub builds the notes from merged pull request titles and groups them by label, as configured in [`.github/release.yml`](.github/release.yml). The [PR Labels](.github/workflows/pr-labels.yaml) workflow applies the labels from each pull request's title (`type(scope): description`), and adds `migration` to pull requests that add a state migration. See [Pull Request Titles](CONTRIBUTING.md#pull-request-titles) in `CONTRIBUTING.md`.
47+
48+
- A `!` in the title, such as `fix!:` or `feat!:`, puts the pull request under **Breaking changes**.
49+
- A pull request that adds a state migration goes under **State migrations**.
50+
- CI, test and Dependabot pull requests are left out. Add the `skip-changelog` label to leave out any other pull request.
51+
52+
To move a pull request to another section, change its title. The workflow resets the type labels from the title.
53+
54+
## Release the VS Code Extension
55+
56+
The [Release VSCode Extension](.github/workflows/release_extension.yaml) workflow publishes to the VS Code Marketplace and to Open VSX.
57+
58+
1. On the workflow's page, choose **Run workflow**.
59+
2. Select the `main` branch. The workflow stops if you run it from any other branch.
60+
3. Enter the version without a `v`, for example `0.0.8`.
61+
62+
The workflow sets the version only in its own build. It doesn't commit it, so `vscode/extension/package.json` keeps its old version. Check the [Marketplace listing](https://marketplace.visualstudio.com/items?itemName=tobikodata.sqlmesh) for the latest published version and enter a higher one.
63+
64+
## Release the Shared Web Package
65+
66+
The [Release web common code](.github/workflows/release_shared_js.yaml) workflow publishes `@tobikodata/sqlmesh-common` from `web/common` to npm. Run it the same way as the extension workflow: from `main`, with a version that has no `v`. It also doesn't commit the version, so check [npm](https://www.npmjs.com/package/@tobikodata/sqlmesh-common) for the latest published version first.

0 commit comments

Comments
 (0)