Skip to content

Commit

Permalink
docs: Add help docs about semver-checks (#1590)
Browse files Browse the repository at this point in the history
Also makes both `release-plz` and `release-please` mark their PRs with
`release` labels.
  • Loading branch information
aborgna-q authored Oct 18, 2024
1 parent c79b95b commit c5b597d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
20 changes: 20 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@ cargo +nightly miri test

Run `just` to see all available commands.

### 💥 API-breaking changes

Any breaking change in the public Rust APIs will cause the next release to be a
major version bump. You can check the next release version [draft release
PR](https://github.com/CQCL/hugr/pulls?q=is%3Aopen+is%3Apr+label%3Arelease) on
github.

Use `cargo semver-checks` to alert you of any problematic changes.
Replace the baseline-rev with a commit hash if your branch is not up-to-date with the main branch.

```bash
# Ensure you have cargo-semver-checks installed
cargo install cargo-semver-checks --locked
# Check for breaking changes against the main branch
cargo semver-checks --baseline-rev origin/main
```

These checks are also run on the CI. You will see a warning comment on your PR
if you introduce a breaking change.

## 💅 Coding Style

The rustfmt tool is used to enforce a consistent rust coding style. The CI will fail if the code is not formatted correctly.
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ gen-extensions:
cargo run -p hugr-cli gen-extensions -o specification/std_extensions
cp -r specification/std_extensions/* hugr-py/src/hugr/std/_json_defs/

# Build the python documentation in hugr-py/docs.
build-py-docs:
cd hugr-py/docs && ./build.sh

# Run rust semver-checks to detect breaking changes since the last release.
semver-checks:
cargo semver-checks

# Runs a rust and a python command, depending on the `language` variable.
#
# If `language` is set to `rust` or `python`, only run the command for that language.
Expand Down
3 changes: 2 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"initial-version": "0.0.0",
"extra-label": "release",
"packages": {
"hugr-py": {
"release-type": "python",
Expand Down Expand Up @@ -62,4 +63,4 @@
"hidden": true
}
]
}
}
1 change: 1 addition & 0 deletions release-plz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pr_draft = true
# (This would normally only be enabled once there are multiple packages in the workspace)
git_tag_name = "{{ package }}-v{{ version }}"
git_release_name = "{{ package }}: v{{ version }}"
pr_labels = ["release"]

# Only create releases / push to crates.io after merging a release-please PR.
# This lets merge new crates to `main` without worrying about accidentally creating
Expand Down

0 comments on commit c5b597d

Please sign in to comment.