diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md index 4b8c4b9..4d14dac 100644 --- a/.claude/skills/release/SKILL.md +++ b/.claude/skills/release/SKILL.md @@ -28,24 +28,24 @@ Follow MAINTAINING.md → "Releasing", and the principles in `CLAUDE.md`. The ru | .venv/bin/python -c 'import sys; from packaging.version import Version; print(max(sys.stdin.read().split(), key=Version))' jq -r '.requirements[]' custom_components/hive/manifest.json ``` - If it's newer than the pin, run `/bump-pyhive` for it first, and get that merged to `master`, unless the user decides to skip it. Check for an open `deps/pyhive-integration-*` PR before starting a new one. - - **Stable:** the pin must not be a pre-release. If `master` pins a pyhive beta, stop: either wait for a stable pyhive, or move the pin to the latest stable with `/bump-pyhive` first. + If it's newer than the pin, run `/bump-pyhive` for it first, and get that merged to `dev`, unless the user decides to skip it. Check for an open `deps/pyhive-integration-*` PR before starting a new one. + - **Stable:** the pin must not be a pre-release. If `dev` pins a pyhive beta, stop: either wait for a stable pyhive, or move the pin to the latest stable with `/bump-pyhive` first. 3. **Check it's safe to ship.** - - `gh run list -w ci.yml -b master -L 1` and `gh run list -w compat.yml -L 1` must both be green. If either is red, stop and report. For a red Compatibility run, suggest `/triage-compat`. + - `gh run list -w ci.yml -b dev -L 1` and `gh run list -w compat.yml -L 1` must both be green. If either is red, stop and report. For a red Compatibility run, suggest `/triage-compat`. - A hassfest **warning** about `pyhive-integration` differing from core hive is expected (see `CLAUDE.md`). Only errors count. - `script/test` and `script/lint --check` must pass locally. - - Check `git log ..origin/master --oneline`. If there's nothing to release, say so. + - Check `git log ..origin/dev --oneline`. If there's nothing to release, say so. -4. **Bump the manifest.** Change only the `version` value in `manifest.json`. Don't touch `requirements`; that's `/bump-pyhive`. The change must reach `master` before tagging: +4. **Bump the manifest.** Change only the `version` value in `manifest.json`. Don't touch `requirements`; that's `/bump-pyhive`. The change must reach `dev` before tagging: - If the user asks, make a branch `release/`, commit it, and open a PR. - Otherwise hand the change over for them to commit. - - Wait until it's merged, then check with `git fetch && git show origin/master:custom_components/hive/manifest.json | jq -r '.version, .requirements[]'`. + - Wait until it's merged, then check with `git fetch && git show origin/dev:custom_components/hive/manifest.json | jq -r '.version, .requirements[]'`. 5. **Publish** (only after the user confirms the tag): ```bash - gh release create --target master --generate-notes --prerelease # beta - gh release create --target master --generate-notes --latest # stable + gh release create --target dev --generate-notes --prerelease # beta + gh release create --target dev --generate-notes --latest # stable ``` For a beta, add the `pyhive-integration` version to the notes, and say whether it's ahead of core's. diff --git a/.claude/skills/repo-health/SKILL.md b/.claude/skills/repo-health/SKILL.md index c303011..93adc32 100644 --- a/.claude/skills/repo-health/SKILL.md +++ b/.claude/skills/repo-health/SKILL.md @@ -17,20 +17,20 @@ gh pr list -R $R --state open --json number,title,author,labels,statusCheckRollu gh issue list -R $R --label no-issue-activity gh pr list -R $R --label no-pr-activity gh release list -R $R -L 5 -git fetch -q origin && git log $(gh release list -R $R -L1 --exclude-pre-releases --json tagName -q '.[0].tagName')..origin/master --oneline -gh api repos/$R/branches/master/protection 2>&1 | jq '{checks: .required_status_checks.contexts, code_owners: .required_pull_request_reviews.require_code_owner_reviews}' +git fetch -q origin && git log $(gh release list -R $R -L1 --exclude-pre-releases --json tagName -q '.[0].tagName')..origin/dev --oneline +gh api repos/$R/branches/dev/protection 2>&1 | jq '{checks: .required_status_checks.contexts, code_owners: .required_pull_request_reviews.require_code_owner_reviews}' gh secret list -R $R # expect BOT_TOKEN ``` (The protection and secrets calls need admin access. If they fail, say so rather than guessing.) Compare what you find with MAINTAINING.md: -- **Workflows:** all active, with no `disabled_inactivity`. The latest CI run on master and the latest Compatibility run should both be green. The last Compatibility run should be under ~26 hours old. +- **Workflows:** all active, with no `disabled_inactivity`. The latest CI run on dev and the latest Compatibility run should both be green. The last Compatibility run should be under ~26 hours old. - **Bot PRs:** Dependabot and pyhive bump PRs with no checks at all mean `BOT_TOKEN` is missing (for pyhive ones). PRs failing checks need attention. Anything older than about 2 weeks is going stale. -- **Unreleased commits on master:** suggest a release if there are user-facing changes. +- **Unreleased commits on dev:** suggest a release if there are user-facing changes. - **Branch protection:** the required checks should be `HACS validation`, `Hassfest`, `Lint` and `Tests`, with code owner review on. - **Secrets:** `BOT_TOKEN` should be present. - **Hassfest:** a warning that `pyhive-integration` differs from core hive is expected (see `CLAUDE.md`), so don't report it as a problem. -- **pyhive-integration:** compare the manifest pin with core hive's pin and with the newest version on PyPI, pre-releases included. A newer pyhive beta than the pin is a candidate for the next component beta (`/bump-pyhive`, then `/release`). A pre-release pin on `master` blocks stable releases until it's moved to a stable version. +- **pyhive-integration:** compare the manifest pin with core hive's pin and with the newest version on PyPI, pre-releases included. A newer pyhive beta than the pin is a candidate for the next component beta (`/bump-pyhive`, then `/release`). A pre-release pin on `dev` blocks stable releases until it's moved to a stable version. - **Latest beta release:** the tag should match the `version` in its manifest (`git show :custom_components/hive/manifest.json | jq -r .version`). - **Pinned HA:** compare the HA version in the `requirements_test.txt` comment with the latest stable on PyPI (`curl -fsS https://pypi.org/pypi/homeassistant/json | jq -r .info.version`). A gap of more than one minor release means the Dependabot PR is stuck. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7b022a9..2665da1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Code owners are requested for review automatically on every PR. -# With "Require review from Code Owners" on master, their approval is needed to merge. +# With "Require review from Code Owners" on dev, their approval is needed to merge. # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners * @KJonline diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb7d3ea..2a85205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,5 @@ -# Checks every PR and push to master. Make the jobs below required checks on master. +# Checks every PR and push to dev, the main branch. Make the jobs below required +# checks on dev. # # This workflow deliberately has no schedule: GitHub auto-disables scheduled # workflows after 60 days without repo activity, which also stops their @@ -8,7 +9,7 @@ name: CI on: pull_request: push: - branches: [master] + branches: [dev] workflow_dispatch: permissions: diff --git a/CLAUDE.md b/CLAUDE.md index 195765e..1d08f6f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -54,6 +54,8 @@ silence it. ## Working here +- `dev` is the main and default branch. PRs target `dev`, and betas and stable + releases are tagged from it (`--target dev`). `master` is no longer used. - `script/setup`, `script/test`, `script/lint` (`--check` in CI). `.venv` must be Python 3.14 (`script/setup --recreate`). - Tests mock `apyhiveapi`. When the library changes, also exercise the real code: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8bd5e9..01bd191 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,8 @@ Add or update a test with every behaviour change. ## Pull requests -- Branch from `master` and open the PR against `master`. +- Branch from `dev` and open the PR against `dev`, the main branch. Betas and stable + releases are both cut from `dev`. - CI must pass: HACS validation, hassfest, lint and tests. - @KJonline is asked to review automatically. - Don't bump `version` in `manifest.json` unless the PR is meant to be released diff --git a/MAINTAINING.md b/MAINTAINING.md index ad16d25..497b63c 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -21,7 +21,7 @@ The full version is in [CLAUDE.md](CLAUDE.md). Everything below follows from the | When | Workflow | What it does | If it fails | |---|---|---|---| -| Every PR and every push to `master` | `ci.yml` | HACS validation, hassfest (through `.github/scripts/hassfest.py`, see [Hassfest and the pyhive pin](#hassfest-and-the-pyhive-pin)), lint and tests. A push to master also re-enables scheduled workflows that GitHub turned off. | Fix it in the PR before merging | +| Every PR and every push to `dev` | `ci.yml` | HACS validation, hassfest (through `.github/scripts/hassfest.py`, see [Hassfest and the pyhive pin](#hassfest-and-the-pyhive-pin)), lint and tests. A push to dev also re-enables scheduled workflows that GitHub turned off. | Fix it in the PR before merging | | Daily, 04:17 UTC | `compat.yml` | Tests against the newest HA stable and beta, plus an import check against HA `dev` | [Compatibility is red](#compatibility-is-red) | | Daily, 05:29 UTC | `stale.yml` | Labels issues and PRs inactive for 60 days, then closes issues after 30 more days and PRs after 14 | Add the `pinned` label to keep something open | | Monday, 06:23 UTC | `pyhive_bump.yml` | Opens a PR if a newer `pyhive-integration` is on PyPI | [Dependency PRs](#dependency-prs) | @@ -47,19 +47,19 @@ who opt in. Stable releases go to everyone. | .venv/bin/python -c 'import sys; from packaging.version import Version; print(max(sys.stdin.read().split(), key=Version))' ``` - - **Stable:** the pin must be a stable version. If `master` pins a pyhive beta, wait + - **Stable:** the pin must be a stable version. If `dev` pins a pyhive beta, wait for a stable pyhive, or move the pin back to the latest stable first. -2. Open a PR that sets `version` in `custom_components/hive/manifest.json`. Merge it +2. Open a PR against `dev` that sets `version` in `custom_components/hive/manifest.json`. Merge it once CI passes. -3. Check that the last Compatibility run on `master` passed, so you aren't shipping +3. Check that the last Compatibility run passed (it runs on `dev`), so you aren't shipping something current HA versions break. 4. Publish the release from the same version: ```bash # beta: HACS offers it only to users who opt into betas - gh release create 2026.10.0b1 --target master --prerelease --generate-notes + gh release create 2026.10.0b1 --target dev --prerelease --generate-notes # stable - gh release create 2026.10.0 --target master --latest --generate-notes + gh release create 2026.10.0 --target dev --latest --generate-notes ``` For a beta, mention the `pyhive-integration` version in the release notes. @@ -151,7 +151,8 @@ users on older HA versions. ## Repo settings (one-time; check they're still on) -- **Branch protection on `master`:** +- **Branch protection on `dev`** (the default branch, which all PRs and releases + go through): - Require the checks *HACS validation*, *Hassfest*, *Lint* and *Tests*. - Turn on *Require review from Code Owners*. - **Secret `BOT_TOKEN`:** a fine-grained PAT with Contents and Pull requests write @@ -161,7 +162,7 @@ users on older HA versions. It triggers a bump PR as soon as Pyhive releases. - **Scheduled workflows enabled:** - Check with `gh workflow list --all`. - - CI switches them back on after the next push to master, but if the repo goes + - CI switches them back on after the next push to dev, but if the repo goes quiet for 60 days they stop again. ## Known issues in the code diff --git a/README.md b/README.md index c8891ba..59e3eb0 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ python script/gen_translations.py # regenerate translations/en.json after edi | Workflow | When | What | | --- | --- | --- | -| `ci.yml` | PRs and pushes to master | HACS validation, hassfest, ruff, tests | +| `ci.yml` | PRs and pushes to dev | HACS validation, hassfest, ruff, tests | | `compat.yml` | Nightly | Tests against the latest HA stable and beta, import check against HA dev | | `release.yml` | Release published | Checks the tag matches `manifest.json`, attaches `hive.zip` | | `pyhive_bump.yml` | Weekly, manual, or dispatched from Pyhive | Opens a PR bumping `pyhive-integration` |