Repository navigation
Conversation
This adds a PR title check, the `conventional` job of the PR title workflow, which fails when a PR title is not a conventional commit subject. It changes nothing else. It relies on merge settings that the admin applies when this merges (last paragraph). The release automation tracked in #1395 will build the changelog from the commit subjects on main. Most subjects on main have the conventional shape, but nothing checks it; for example #596's (b0d1c64) does not. In the 0.1.15 cycle two squash-merged PR titles did not have it, and seven merge commits brought 24 more subjects to main that do not have it. devtools/check-pr-title accepts `type(scope)!: summary`, with the scope and the `!` optional. The type is one of the eleven of commitlint's config-conventional: build, chore, ci, docs, feat, fix, perf, refactor, revert, style and test. A scope is lowercase letters, digits, `.`, `_`, `/` and `-`. A refusal names the rule that failed: the shape, the type, the scope or the space after the colon. The PR title workflow runs it on opened, edited, reopened and synchronize events. The title reaches the script through the environment. The job checks out devtools/ (in cone mode, also the files at the repository root) from the default branch, so a PR that edits the checker is checked by main's version, and an older or stacked PR whose base has no checker still gets main's. The workflow file itself runs from the PR's merge ref, as every pull_request workflow does, so a change to it is protected by review only. The job fails on this PR, because main has no checker yet. A merge queue run has no title, so the job is skipped there, which counts as passing if the check is made required. CONTRIBUTING.md says how to title a PR and a revert. Settings to apply when this merges: allow squash merging only, in the repository settings, the main ruleset's allowed merge methods and the merge queue's merge method. Under "Allow squash merging", set the default commit message to "Pull request title and description" (API: squash_merge_commit_title PR_TITLE, squash_merge_commit_message PR_BODY). A squash commit then takes the PR title as its subject and the PR description as its message. With the current "Default message", a single-commit PR's squash subject is the commit's subject, which this check does not see. Then add `conventional` (GitHub Actions) to main's required status checks. Merge this before the release-please change of #1395 (#1467), which builds on its CONTRIBUTING.md text. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
fd44cee to
ad3f616
Compare
0f8b175 to
2ac2817
Compare
ad3f616 to
a82b895
Compare
2ac2817 to
a8fcd46
Compare
This adds a PR title check, the `conventional` job of the PR title workflow, which fails when a PR title is not a conventional commit subject. It changes nothing else. It relies on merge settings that the admin applies when this merges (last paragraph). The release automation tracked in #1395 will build the changelog from the commit subjects on main. Most subjects on main have the conventional shape, but nothing checks it; for example #596's (b0d1c64) does not. In the 0.1.15 cycle two squash-merged PR titles did not have it, and seven merge commits brought 24 more subjects to main that do not have it. devtools/check-pr-title accepts `type(scope)!: summary`, with the scope and the `!` optional. The type is one of the eleven of commitlint's config-conventional: build, chore, ci, docs, feat, fix, perf, refactor, revert, style and test. A scope is lowercase letters, digits, `.`, `_`, `/` and `-`. A refusal names the rule that failed: the shape, the type, the scope or the space after the colon. The PR title workflow runs it on opened, edited, reopened and synchronize events. The title reaches the script through the environment. The job checks out devtools/ (in cone mode, also the files at the repository root) from the default branch, so a PR that edits the checker is checked by main's version, and an older or stacked PR whose base has no checker still gets main's. The workflow file itself runs from the PR's merge ref, as every pull_request workflow does, so a change to it is protected by review only. Until main has a checker, on this PR and the PRs stacked on it, the job uses the PR's own copy. A merge queue run has no title, so the job is skipped there, which counts as passing if the check is made required. CONTRIBUTING.md says how to title a PR and a revert. Settings to apply when this merges: allow squash merging only, in the repository settings, the main ruleset's allowed merge methods and the merge queue's merge method. Under "Allow squash merging", set the default commit message to "Pull request title and description" (API: squash_merge_commit_title PR_TITLE, squash_merge_commit_message PR_BODY). A squash commit then takes the PR title as its subject and the PR description as its message. With the current "Default message", a single-commit PR's squash subject is the commit's subject, which this check does not see. Then add `conventional` (GitHub Actions) to main's required status checks. Merge this before the release-please change of #1395 (#1467), which builds on its CONTRIBUTING.md text. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
a82b895 to
85b663f
Compare
a8fcd46 to
816177c
Compare
85b663f to
39288eb
Compare
816177c to
d632afb
Compare
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks. I read the change against #1466's head 39288eb. cargo metadata --locked reads the same packages, versions and dependencies with and without the new markers. release-please-config.json and .release-please-manifest.json are valid JSON, and each file that the config names holds 1.1.0. actionlint reports only the extenddb_ubuntu-2404_4-core runner label, which ten workflows on main use too.
The workflow runs on push to main only, and no ${{ }} expression appears inside a run: block. The App token is minted only in the two jobs that need it. prepare-release-pr, which runs the build scripts, holds no credential. The first release PR will propose 1.2.0, as the new text of docs/versioning.md says.
Before I approve, the support policy change needs a decision of its own, because it narrows what users get. Today a fix for 1.1 ships in a 1.1.x patch, and a rollback from it needs only the earlier binary. With this change, the fix ships in 1.2.0, which can carry new configuration keys and a breaking catalog migration. Users of 1.0 also lose their three months of security fixes until release branches exist. The release workflows on main already refuse a tag that is not on main, so the old promise could not be kept either.
Points in the text:
docs/versioning.md:56still says "The newest minor release gets bug fixes and security fixes", andROADMAP.md:31says "Patch releases ship as needed for bug fixes and security updates". Under line 54, the newest minor release gets no fix release of its own. Both lines need the new rule.packaging/README.md:239calls release branches "follow-up work to #1395", but #1395 says that they are out of scope there, and no issue tracks them. An issue, linked from the README and fromdocs/versioning.md, would track the open promise.always-bump-minorgives a minor version to a!commit.docs/versioning.md:9allows the removal of a deprecated item only in a major release, but no text says when aRelease-As: X+1.0.0footer is required. One sentence inCONTRIBUTING.mdand one inpackaging/README.mdwould say it.packaging/README.md:187says how to ask for a patch release, but not when one is allowed. A patch frommaincarries everything merged since the last release.docs/versioning.md:11bars a new configuration key or backup format version from a patch release, andfreeze-migrationsrefuses only the breaking migration.release.yml:274accepts any version above the highest tag on main. Aspackaging/README.md:254-257says, aRelease-As:footer can come from aBEGIN_COMMIT_OVERRIDEblock in a merged PR's description, and its author can edit that description after the merge. The step could accept only the next minor version, or a version that a commit message ingit log v<highest>..origin/mainnames. The release PR's reviewer would then not be the only check on the version.
The red cassandra-pytest (1) job is a TLS handshake error in tests/test_put_item_create_race.py, a file that this stack does not change. That test builds its own client with one attempt and does not use call_with_handshake_retry. I started a re-run of the failed jobs.
I found no other open PR that adds release-please or changes the support policy.
39288eb to
5b83421
Compare
d632afb to
2d71049
Compare
|
This adds release.yml, which keeps a release PR open and up to date and, when that PR merges, creates the tag and a draft release (#1395). It publishes nothing. Merging this changes nothing by itself: every job is skipped until the repository variable RELEASE_APP_CLIENT_ID is set. Merge it after the PR title check (ci/pr-title-check). Today a release starts with a hand-written PR that bumps the version on every surface, regenerates Cargo.lock and the license notices, and freezes the catalog migrations. With this, every push to main makes release-please rebuild one PR, `chore(release): X.Y.Z`, with CHANGELOG.md and the new version in Cargo.toml (the workspace version and the 13 pins), packaging/npm/package.json (the version and the five pins) and three lines of sample output in the docs. The release type is `simple`, because the `rust` type's Cargo.toml updater throws on a virtual workspace manifest. Every release is a minor release (`always-bump-minor`), because docs/versioning.md ships a change that makes ExtendDB answer as DynamoDB does in a minor release (or a patch release when it closes a security issue), and most fixes are such changes. A `Release-As: X.Y.Z` footer asks for another version. Two jobs then finish the PR. The release-please job records the SHA of the release PR's branch, and both jobs work on that commit, not on the branch name, because anyone with write access can push to the branch. prepare-release-pr compares that commit with main byte for byte and refuses it unless it is one release-please commit that changes only the version lines and the changelog: the manifest and the files that release-please-config.json on main lists, so adding a versioned file needs only its config entry. Every inline Python check runs with `python3 -I`, so it imports nothing from the checked-out tree. It also refuses a version other than the next minor version after the highest release tag on main or a higher version that a Release-As footer names. devtools/release-tags holds the rule for a release version (no leading zeros) and finds the highest release tag on main, so release-publish.yml (#1469) can use the same rule. Then it runs `cargo update --workspace` (only workspace entries may change), the license notice generators for the four notice files and devtools/freeze-migrations. It holds no credential and hands its result on as a patch. push-release-pr applies the patch and refuses anything but content changes to the ten files that .github/release-pr-files.txt lists, a list it reads from the commit before the patch applies. The generators and the freeze run build scripts, so it checks the content again with the standard library: in Cargo.lock and the four license notices only the workspace version may change, in the migration files only the RELEASED_THROUGH line and Released entries appended to each table. It then pushes its commit with the App token, minted after the checks. A PR opened with GITHUB_TOKEN would start no workflow. Merging the release PR creates the tag on the merge commit and a draft release. With force-tag-creation, release-please reports a release on a tag that already exists, so a step fails the run unless the tag's commit is the merge commit. The version must be the next minor version or one that a commit message on main since the last release names in a Release-As footer, so a footer that a BEGIN_COMMIT_OVERRIDE block gains after the merge is refused. The check reads the whole log before grep: under pipefail, `grep -q` would end the pipe early and git log would exit on SIGPIPE, refusing a footer it found on any history over 64 KiB of messages. CONTRIBUTING.md says how release-please reads a PR description, in the item that the PR title check added, and that a change allowed only in a major release carries a Release-As: X+1.0.0 footer. The support policy in docs/versioning.md and ROADMAP.md changes to match: a fix ships in the next release from main, a minor release unless a Release-As footer asks for a patch. A fix for an earlier minor release, including the 3 months of security fixes for the previous minor release, needs a release branch, which #1550 tracks; until then it ships in the next release from main. packaging/README.md also says when a patch release from main is allowed, and describes the version rules, the upgrade manual step and the one- time setup: squash-only merges with "Pull request title and description" and the required checks as #1395 merges; then, once all of #1395 is merged, the App, its environment, a new tag ruleset whose only rule restricts the creation of v* tags to the App (protect-release-tags keeps no bypass actors), and last the variable. Until then releases are made by hand, as today. The by-hand steps now include .release-please- manifest.json, Cargo.lock and the sample output. .release-please-manifest.json starts at 1.1.0, the release cut by hand on 222d80a, so the first release PR proposes 1.2.0. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
2d71049 to
c9d56f6
Compare
|
Changes in c9d56f6, rebased onto main after #1466 merged:
|
) This adds a PR title check, the `conventional` job of the PR title workflow, which fails when a PR title is not a conventional commit subject. It changes nothing else. It relies on merge settings that the admin applies when this merges (last paragraph). The release automation tracked in ExtendDB#1395 will build the changelog from the commit subjects on main. Most subjects on main have the conventional shape, but nothing checks it; for example ExtendDB#596's (b0d1c64) does not. In the 0.1.15 cycle two squash-merged PR titles did not have it, and seven merge commits brought 24 more subjects to main that do not have it. devtools/check-pr-title accepts `type(scope)!: summary`, with the scope and the `!` optional. The type is one of the eleven of commitlint's config-conventional: build, chore, ci, docs, feat, fix, perf, refactor, revert, style and test. A scope is lowercase letters, digits, `.`, `_`, `/` and `-`. A refusal names the rule that failed: the shape, the type, the scope or the space after the colon. The PR title workflow runs it on opened, edited, reopened and synchronize events. The title reaches the script through the environment. The job checks out devtools/ (in cone mode, also the files at the repository root) from the default branch, so a PR that edits the checker is checked by main's version, and an older or stacked PR whose base has no checker still gets main's. The workflow file itself runs from the PR's merge ref, as every pull_request workflow does, so a change to it is protected by review only. Until main has a checker, on this PR and the PRs stacked on it, the job uses the PR's own copy. A merge queue run has no title, so the job is skipped there, which counts as passing if the check is made required. CONTRIBUTING.md says how to title a PR and a revert. Settings to apply when this merges: allow squash merging only, in the repository settings, the main ruleset's allowed merge methods and the merge queue's merge method. Under "Allow squash merging", set the default commit message to "Pull request title and description" (API: squash_merge_commit_title PR_TITLE, squash_merge_commit_message PR_BODY). A squash commit then takes the PR title as its subject and the PR description as its message. With the current "Default message", a single-commit PR's squash subject is the commit's subject, which this check does not see. Then add `conventional` (GitHub Actions) to main's required status checks. Merge this before the release-please change of ExtendDB#1395 (ExtendDB#1467), which builds on its CONTRIBUTING.md text. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
Release automation (#1395), PR 4 of 6. #1464 (PR title check), #1465 (signing in a called workflow) and #1466 (freeze-migrations) have merged. Stack: #1467 release-please ← #1468 rehearsal ← #1469 release-publish. Merge in that order. Its base is main.
What
Adds
release.yml, which keeps one release PR open and up to date and, when that PR merges, creates the tag and a draft GitHub release. It publishes nothing (#1469 adds publishing). Merging this changes nothing by itself: every job is skipped until the repository variableRELEASE_APP_CLIENT_IDis set.The release PR
On every push to
main, release-please rebuilds one PR,chore(release): X.Y.Z, withCHANGELOG.mdand the new version on the lines betweenx-release-please-start-versionandx-release-please-endmarkers: the workspace version and the 13 pins inCargo.toml, and three lines of sample output in the docs. It sets the version and the five pins inpackaging/npm/package.jsonby JSON path.simple: therusttype's Cargo.toml updater throws on a virtual workspace manifest.always-bump-minor), becausedocs/versioning.mdships a change that makes ExtendDB answer as DynamoDB does in a minor release (or a patch release when it closes a security issue), and most fixes are such changes. ARelease-As: X.Y.Zfooter asks for a patch or major version.Finishing the PR
python3 -I, so it imports nothing from the checked-out tree.prepare-release-prrefuses the commit unless it is one release-please commit onmainthat changes only the version lines and the changelog (compared byte for byte), in the manifest and the files thatrelease-please-config.jsononmainlists, and refuses a version other than the next minor version after the highest release tag onmainor a higher version that the message of a commit onmainsince that tag names in aRelease-As:footer. A footer that aBEGIN_COMMIT_OVERRIDEblock gains after the merge is therefore refused.devtools/release-tagsholds the rule for a release version (no leading zeros) and finds the highest release tag onmain. It then runscargo update --workspace(only workspace entries may change), the license-notice generators for the four notice files anddevtools/freeze-migrations. It holds no credential and hands its result on as a patch.push-release-prapplies the patch and refuses anything but content changes to the ten files that.github/release-pr-files.txtlists, a list it reads from the commit before the patch applies. A file on the list with no content check below is refused. The generators and the freeze run build scripts, so it checks the content again: in Cargo.lock and the four license notices only the workspace version, in the migration files only theRELEASED_THROUGHline andReleasedentries appended to each table. It then pushes one commit with the App token, minted after the checks.Merging the release PR creates the tag on the merge commit. A step fails the run if the tag already existed on another commit.
Docs
docs/versioning.mdandROADMAP.md: the support policy changes to match the release PR. A fix ships in the next release frommain, a minor release unless aRelease-As:footer asks for a patch. A fix for an earlier minor release, including the 3 months of security fixes for the previous minor release, needs a release branch, which Release branches for patch releases of an earlier minor release #1550 tracks; until then it ships in the next release frommain.CONTRIBUTING.mdandpackaging/README.md: a change allowed only in a major release carries aRelease-As: X+1.0.0footer, and the README says when a patch release frommainmay be asked for..release-please-manifest.json,Cargo.lockand the sample output..release-please-manifest.jsonstarts at 1.1.0, the release cut by hand on 222d80a, so the first release PR proposes 1.2.0.Why
Part of #1395. Today a release starts with a hand-written PR that bumps the version on every surface, regenerates Cargo.lock and the license notices, and freezes the catalog migrations. A PR opened with the default
GITHUB_TOKENstarts no workflow, so release-please and the push use a GitHub App token.Testing done
chore(release): 1.2.0, and its own updaters change exactly the Cargo.toml, package.json and doc lines that the 1.1.0 hand bump changed. With this config,fix,featand breaking commits all give the next minor version,Release-Asoverrides, hidden types alone open no PR, and an unchanged body still updates the PR.json.pynext to a code change passes a check run aspython3 -; withpython3 -Ithe check refuses it.run:block extracted verbatim and run against good and hostile inputs: branch shapes (human commits, merge commits, extra Cargo.toml changes, CR, NUL, U+2028), version and tag cases (annotated, lightweight, stray tags offmain), patches (renames, copies, symlinks, mode changes, deletions, binary patches, swapped crate sources, code appended toregistry.rs), and the real frozen and unfrozen migration files.prepare-release-pr's steps run locally on release-please's output: only the 15 workspace lock entries move, the notices change only version lines (and the push-side check refuses any other notice change), the freeze works withcargo test --locked, anddoc_version_literalspasses.Release-As: 1.1.1: above no other commit, above 1.3 MB of older messages, above main's v1.0.0..v1.1.0 messages, and with a CR after the version. Each accepts 1.2.0 and 1.1.1 and refuses 2.0.0, 1.1.10, 1.1.0 and 1.0.5. A footer inside aBEGIN_COMMIT_OVERRIDEblock of the commit message counts.push-release-pr's two checks, extracted, on a copy of this tree: a workspace version inCargo.lockand a version in a license notice pass; a change to an unlisted file, a new file, an edit of the list itself, a change to anotherCargo.lockentry, a committed list with no entries, and a listed file with no content check are refused.prepare-release-pr's branch-shape step, extracted, on a copy of this tree with a release-please-like commit: it passes; adding a change to an unlisted file, a config entry for that file in the same commit, or a non-version change toCargo.tomlis refused.devtools/release-tagshas unit tests (release_tags_test.py): the version shapes, numeric order, annotated and lightweight tags, a tag off the branch, and a missing ref.devtools/check-actions-pinnedare clean.Setup (admin)
RELEASE_APP_CLIENT_IDis set, and releases are made by hand as before.release-pleaseenvironment (branchmain, no reviewers) with its private key asRELEASE_APP_PRIVATE_KEY.release-tag-creation, onrefs/tags/v*with only the rule "Restrict creations" and the App as its only bypass actor. A bypass actor bypasses every rule of its ruleset, soprotect-release-tagskeeps no bypass actors.RELEASE_APP_CLIENT_ID.Checklist
cargo test --workspace): not run;doc_version_literalspasses with the markerscargo fmt --check): no Rust changecargo clippy -- -W clippy::pedantic): no Rust changerun:block was tested by extraction (Testing done)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a: CI and release tooling only; the design is discussed in #1395
Breaking changes
None until the variable is set. After that, releases from
mainare minor releases unless aRelease-As:footer says otherwise, so a fix for the newest minor release ships in the next minor release by default. Until release branches exist (#1550), the previous minor release gets no security release of its own; its fixes ship in the next release frommain.By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.