Skip to content

feat(core): check that quality scale tier changes stand alone - #196

Open
epenet wants to merge 7 commits into
OpenHomeFoundation:mainfrom
epenet:title-quality-scale
Open

epenet wants to merge 7 commits into
OpenHomeFoundation:mainfrom
epenet:title-quality-scale

Conversation

@epenet

@epenet epenet commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Proposed change

Follows #181. Quality scale tier changes on core must stand alone and get the expected title.

"Manifest" (new row, member-waivable). When a PR sets the quality_scale tier in an existing integration's manifest.json, nothing else may change, except script/hassfest/quality_scale.py for a first tier (it lists the integrations without a quality scale). Anything else (rule changes, other manifest settings, code, tests, another integration's manifest) fails with "Change only the quality scale tier in this PR, and move the other changes to a separate PR." PRs without a tier change skip the row, and a new integration's manifest isn't a change. To tell which keys a manifest diff changes, each changed line is placed under its top-level key; a line that can't be placed counts as another change.

"PR title". A standalone tier change must be titled Set quality scale to <tier> in <name>, with the tier as in the manifest and <name> the integration's name in its manifest on dev, written exactly (any name when the manifest can't be read). Otherwise the row fails with "Rename this PR to <expected title>." A title in the expected form still goes through the checks from #181.

The row is named "Manifest" so follow-ups can add other manifest changes that must stand alone, such as code owners. Titles for quality_scale.yaml changes are left for a follow-up too.

The tier detection lives in helpers/manifest-change.ts, shared by both checks; the expected title is in rules/title.ts. This PR doesn't depend on #195, which adds the dependency bump titles to the same rule; whichever merges second needs a small rebase.

Of 100 recent quality scale PRs on core, 8 change a tier; 7 of them would fail the "Manifest" row because they also change the rules (5) or code (2).

Type of change

  • Dependency upgrade
  • Bugfix
  • New rule or command
  • New repository manifest (enable the bot on another repo)
  • New feature (which adds functionality to an existing engine)
  • Code quality improvement or refactor (incl. tests)

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass (mise run test). Your PR cannot be merged unless tests pass.
  • Lint and type checks pass (mise run check).
  • The code has been formatted (mise run format).
  • Tests have been added to verify that the new code works.
  • There is no commented out or debug code in this PR.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If behaviour, configuration, or environment variables changed:

  • README.md and .env.example have been updated accordingly.

A PR that changes nothing but one integration's quality scale must be titled "Set quality scale to <tier> in <name>", "Add quality scale file to <name>" or "Update quality scale rules in <name>". A tier change next to other manifest changes fails: they belong in a separate PR.
A tier change in manifest.json next to quality_scale.yaml changes now fails as well: the rules go in a separate PR.
Changing an existing tier is a manifest.json change on its own. Adding a first tier may also take the integration off script/hassfest/quality_scale.py.
…le row

The standalone requirement is about the PR's content, not its title, so it moves from "PR title" to a new member-waivable "Quality scale" check. It now also covers tier changes made with code or tests. "PR title" only expects "Set quality scale to <tier> in <name>" on a standalone tier change.
@epenet epenet changed the title feat(core): check the titles of quality scale changes feat(core): check the titles and scope of quality scale changes Dec 1, 2026
…covers code owners

Code owner changes to an existing integration's manifest must stand alone too, with the generated CODEOWNERS file. Changed manifest keys are now read by following each changed line's top-level key, so code owner lists over several lines are recognised.
@epenet epenet changed the title feat(core): check the titles and scope of quality scale changes feat(core): check quality scale titles and standalone manifest changes Dec 1, 2026
The quality_scale.yaml titles and code owner changes move to follow-up PRs, to keep this one small.
@epenet epenet changed the title feat(core): check quality scale titles and standalone manifest changes feat(core): check that quality scale tier changes stand alone Dec 1, 2026
Like the style checks in OpenHomeFoundation#181, it belongs to the rule; only the tier detection, shared with the Manifest check, stays a helper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant