Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .agents/generated-rules.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"copier-template": "c297313eea2b16f7b713e0faf4a3672de05d6ea27a4ff374e659d3960d9784bc",
"documentation-toc": "c9a57aa3bd766ede36c80761786aa113bea025e92c3fc28a189c0b1bfc86f356",
"github-actions": "ff2bdef59ef786c7aae187227b1e7313427a199134538abf98eb495be87b2737",
"github-actions": "00e9df140a396df37cda1ecc47400e441e0715c44817a4f714360316de9259bd",
"markdown-documentation": "b83a62259c4f741f4e4ddb88faa403c4123dde19f9c2fd4078527ec26eafe8c2",
"shell-scripts": "bfb8e475d0e8f9e01fe1fd241625bb5c06ba5845748ff00baf80e1829d5dde1c"
"shell-scripts": "bdeed1f2724292989168f25949c8d83245f1436c24a3b82dab10429f60790d64"
}
1 change: 1 addition & 0 deletions .agents/rules/commit-message-convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Allowed types:
- `chore`
- `style`
- `perf`
- `ci`

Rules:

Expand Down
4 changes: 2 additions & 2 deletions .agents/rules/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
## Callable workflows (this repository)

- Files under **`.github/workflows/`** that define **`on: workflow_call`** are **reusable entry points**. This repo uses the **`reusable-` filename prefix** as an org convention for discoverability (see `docs/reusable-workflows.md`). Renaming a published reusable file is a **breaking change** for every consumer `uses:` path.
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. See **`docs/versioning.md`**.
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. Its `release-please` job stays suspended until the repository is enrolled for Release Please. See **`docs/versioning.md`**.
- **`reusable-pre-commit.yml`** should remain a thin, predictable pipeline: checkout → setup Python (with pip cache) → optional pre-install → install → `pre-commit run --all-files` (or overridden command). Avoid surprising side effects in defaults; document new **`inputs`** in `docs/reusable-workflows.md` and **`CHANGELOG.md`** when behavior or contract changes.

## Template caller workflows (`template/.github/workflows/`)

- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. The pin is bumped by **`scripts/standards_release_bump.sh`** (`.bumpversion.toml`) and reaches consumers via `copier update`.
- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. Its pin carries the `x-release-please-version` marker so release preparation bumps it with `STANDARDS_VERSION`, and it reaches consumers via `copier update`.
- **`test.yml`** is a **starter only** for consumer repos. This standards repo does **not** ship a reusable test matrix. Reviews should resist moving project-specific test logic here unless the README and docs explicitly expand that scope.

## Review checklist
Expand Down
1 change: 0 additions & 1 deletion .agents/rules/shell-scripts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Review: shell scripts

- Prefer **`#!/usr/bin/env bash`** with **`set -euo pipefail`** for new or heavily edited scripts.
- **`scripts/publish_github_release.py`** is maintainer-only: keep it working with **`CHANGELOG.md`** section headers **`## [X.Y.Z]`** and **`gh release create`**.
- Use portable patterns where reasonable. Avoid introducing dependencies on nonstandard tools without documenting them.
44 changes: 0 additions & 44 deletions .bumpversion.toml

This file was deleted.

4 changes: 2 additions & 2 deletions .claude/rules/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ paths:
## Callable workflows (this repository)

- Files under **`.github/workflows/`** that define **`on: workflow_call`** are **reusable entry points**. This repo uses the **`reusable-` filename prefix** as an org convention for discoverability (see `docs/reusable-workflows.md`). Renaming a published reusable file is a **breaking change** for every consumer `uses:` path.
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. See **`docs/versioning.md`**.
- **`release-tag.yml`** runs on pushes to `main`. On a version bump, its shared workflow creates the tag and publishes the GitHub Release. The calling job grants `contents: write` for publication. Its `release-please` job stays suspended until the repository is enrolled for Release Please. See **`docs/versioning.md`**.
- **`reusable-pre-commit.yml`** should remain a thin, predictable pipeline: checkout → setup Python (with pip cache) → optional pre-install → install → `pre-commit run --all-files` (or overridden command). Avoid surprising side effects in defaults; document new **`inputs`** in `docs/reusable-workflows.md` and **`CHANGELOG.md`** when behavior or contract changes.

## Template caller workflows (`template/.github/workflows/`)

- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. The pin is bumped by **`scripts/standards_release_bump.sh`** (`.bumpversion.toml`) and reaches consumers via `copier update`.
- **`lint.yml`** is the **Tier A** pattern: a single job that **`uses:`** the org reusable workflow with a **pinned ref**. Its pin carries the `x-release-please-version` marker so release preparation bumps it with `STANDARDS_VERSION`, and it reaches consumers via `copier update`.
- **`test.yml`** is a **starter only** for consumer repos. This standards repo does **not** ship a reusable test matrix. Reviews should resist moving project-specific test logic here unless the README and docs explicitly expand that scope.

## Review checklist
Expand Down
1 change: 0 additions & 1 deletion .claude/rules/shell-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ paths:
# Review: shell scripts

- Prefer **`#!/usr/bin/env bash`** with **`set -euo pipefail`** for new or heavily edited scripts.
- **`scripts/publish_github_release.py`** is maintainer-only: keep it working with **`CHANGELOG.md`** section headers **`## [X.Y.Z]`** and **`gh release create`**.
- Use portable patterns where reasonable. Avoid introducing dependencies on nonstandard tools without documenting them.
8 changes: 1 addition & 7 deletions .github/release-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
"path": "STANDARDS_VERSION",
"format": "text"
},
"mirrors": [
{
"path": ".bumpversion.toml",
"format": "toml",
"key": "tool.bumpversion.current_version"
}
],
"mirrors": [],
"tag_prefix": "v",
"changelog": "CHANGELOG.md",
"outputs": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agent-guidance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
python3 .agent-config-engine/scripts/render-project-rules.py .
python3 .agent-config-engine/scripts/check-project-agents.py .
- name: Test release preparation
- name: Check release version markers
run: python3 -m unittest discover -s scripts/tests -p "test_release_*.py"
- name: Verify rendered consumer templates
run: bash scripts/tests/agent-template.sh "$GITHUB_WORKSPACE/.agent-config-engine/scripts/check-project-agents.py"
18 changes: 18 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# A title edit reruns this check without restarting the test suite.
name: PR title

on:
pull_request:
branches: [main]
types: [opened, edited, synchronize, reopened]

permissions:
pull-requests: read

concurrency:
group: pr-title-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
pr-title:
uses: BehindTheMusicTree/github-workflows/.github/workflows/pr-title.yml@8b10f1dfcb88a245e4e4256e61164b49e595faea
12 changes: 12 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ jobs:
app-id: ${{ vars.RELEASE_APP_ID }}
secrets:
release-app-private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}

release-please:
needs: release-tag
# Pushes skip this job until the App and main ruleset are configured.
if: github.event_name == 'workflow_dispatch'
uses: BehindTheMusicTree/github-workflows/.github/workflows/release-please.yml@8b10f1dfcb88a245e4e4256e61164b49e595faea # v6.5.0
with:
app-id: ${{ vars.RELEASE_PR_APP_ID }}
release-policies: .github/release-policy.json
auto-merge: true
secrets:
release-pr-app-private-key: ${{ secrets.RELEASE_PR_APP_PRIVATE_KEY }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ The format is inspired by Keep a Changelog and follows semantic-style versioning

## [Unreleased]

### Changed

- Prepare the move to Release Please: mark the seven standards pins with `x-release-please-version`, add the `pr-title` check and a suspended `release-please` job, and check that marked pins match `STANDARDS_VERSION`.

### Removed

- The manual bump path (`scripts/standards_release_bump.sh`, `scripts/finalize_standards_changelog.py`, `scripts/publish_github_release.py` and `.bumpversion.toml`) and the `.bumpversion.toml` mirror in the release policy. CI already owns tagging and publication.

## [5.2.1] - 2026-11-25

### Changed
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Portable agent guidance is an optional Copier bootstrap; see [development guidan
- `copier.yml` + `template/`: **[Copier](https://copier.readthedocs.io/)** template rendered into consumer repos — `.pre-commit-config.yaml`, `baselines/ruff.toml`, optional `.github/workflows/lint.yml` (updated by `copier update`), plus bootstrap-only `pyproject.toml` and `.github/workflows/test.yml`.
- `.github/workflows/reusable-*.yml`: **callable** workflows (shared pre-commit) for repos that reference this repository instead of duplicating lint YAML. The **`reusable-` filename prefix** is an org convention for discoverability, not a GitHub requirement — see the **Naming** section in [docs/reusable-workflows.md](docs/reusable-workflows.md).
- `docs/`: **[development.md](docs/development.md)** (hub), migration guide, versioning, reusable workflows, and style notes (e.g. [`string-enums.md`](docs/string-enums.md)).
- `scripts/`: maintainer release tooling; **`standards_release_bump.sh`** + **`finalize_standards_changelog.py`** automate SemVer bumps (see [docs/versioning.md](docs/versioning.md)). **`.bumpversion.toml`** configures **`bump-my-version`** for **`STANDARDS_VERSION`** and example **`@v…`** pins (not **`CHANGELOG.md`**).
- `scripts/tests/`: repository checks, including the read-only sync between **`STANDARDS_VERSION`** and every pin carrying the Release Please version marker (see [docs/versioning.md](docs/versioning.md)).

## Usage Model

Expand Down Expand Up @@ -77,7 +77,7 @@ Not every Python repo should use the same CI shape. Use these tiers:
| **A — Library** | Packaged library, multi-OS/Python matrix, `pyproject.toml` dev extras | **Delegated** [`reusable-pre-commit.yml`](.github/workflows/reusable-pre-commit.yml) for lint; **owned** `test.yml` (see [`template/.github/workflows/test.yml`](template/.github/workflows/) + local matrix/coverage) | Thin `lint.yml` caller; full control over test CI |
| **B — Service / API** | Django/FastAPI apps, Docker, DB, secrets, long integration jobs | [`reusable-pre-commit.yml`](.github/workflows/reusable-pre-commit.yml), pre-commit + policy templates | Full test / deploy workflows in the app repository |

**Pinning:** Consumer workflows should reference a **release tag** such as **`@v5.2.1`** (or a commit SHA), not **`@main`**; `copier update` bumps the template `lint.yml` pin. See [docs/versioning.md](docs/versioning.md).
**Pinning:** Consumer workflows should reference a **release tag** such as **`@v5.2.1`** (or a commit SHA), not **`@main`**; `copier update` bumps the template `lint.yml` pin. See [docs/versioning.md](docs/versioning.md). <!-- x-release-please-version -->

**Example Tier B:** [hear-the-music-tree-api](https://github.com/BehindTheMusicTree/hear-the-music-tree-api) keeps database and containerized pytest in its own workflow and may call **reusable pre-commit** only. See that repo’s `docs/ci/python-project-standards.md`.

Expand All @@ -95,7 +95,7 @@ See [docs/reusable-workflows.md](docs/reusable-workflows.md) for caller examples

Versions are **SemVer** (`v1.2.3` tags, `STANDARDS_VERSION` without `v`). Maintainers prepare version and **`CHANGELOG.md`** changes through a PR to `main`; CI creates **`vX.Y.Z`** and publishes a **GitHub Release** with the same notes. Consumers pin callable workflows to that tag (or a commit SHA), not to `main` long term.

After a version change merges into `main`, [`.github/workflows/release-tag.yml`](.github/workflows/release-tag.yml) creates the SemVer tag and publishes the GitHub Release from the matching **`CHANGELOG.md`** section. Use **`python3 scripts/publish_github_release.py --dry-run`** locally to preview notes; publication is owned by CI (see **[docs/versioning.md](docs/versioning.md)**).
After a version change merges into `main`, [`.github/workflows/release-tag.yml`](.github/workflows/release-tag.yml) creates the SemVer tag and publishes the GitHub Release from the matching **`CHANGELOG.md`** section. Publication is owned by CI; Release Please will prepare version and changelog PRs from conventional PR titles once activated (see **[docs/versioning.md](docs/versioning.md)**).

## Status

Expand Down
4 changes: 2 additions & 2 deletions docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Reusable workflows are resolved **at CI runtime** from this repository. Template
Prefer a **release tag** or **commit SHA**, not `main`:

```yaml
uses: BehindTheMusicTree/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1
uses: BehindTheMusicTree/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1 # x-release-please-version
```

The template’s `lint.yml` carries this pin, so `copier update` bumps it. Repos with their own caller workflow (`reusable_lint: false`) bump the pin by hand. See [versioning.md](versioning.md).
Expand All @@ -28,7 +28,7 @@ The template’s `lint.yml` carries this pin, so `copier update` bumps it. Repos
Install Copier with an exact pin (for example `uv tool install copier==9.18.2`), then from the repository root:

```bash
copier copy --vcs-ref v5.2.1 gh:BehindTheMusicTree/python-project-standards . --overwrite
copier copy --vcs-ref v5.2.1 gh:BehindTheMusicTree/python-project-standards . --overwrite # x-release-please-version
git add -p # keep repo-specific hooks and settings the template overwrote
```

Expand Down
6 changes: 3 additions & 3 deletions docs/reusable-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This repository uses the **`reusable-` prefix** as an **organizational conventio
## Requirements

- The consumer repo must be allowed to use workflows from this repository (typically same GitHub organization and org settings that permit reusable workflows).
- Pin the callee ref (**prefer `@v5.2.1` or a commit SHA**). Avoid `@main` in production CI so standards updates do not surprise you.
- Pin the callee ref (**prefer `@v5.2.1` or a commit SHA**). Avoid `@main` in production CI so standards updates do not surprise you. <!-- x-release-please-version -->

## Reference workflows

Expand All @@ -33,7 +33,7 @@ This repository uses the **`reusable-` prefix** as an **organizational conventio
```yaml
jobs:
pre-commit:
uses: YOUR_ORG/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1
uses: YOUR_ORG/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1 # x-release-please-version
with:
python-version: "3.14"
install-command: |
Expand All @@ -55,7 +55,7 @@ on:

jobs:
lint:
uses: YOUR_ORG/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1
uses: YOUR_ORG/python-project-standards/.github/workflows/reusable-pre-commit.yml@v5.2.1 # x-release-please-version
```

Override inputs only when needed (see table below).
Expand Down
Loading
Loading