chore(ci): consolidate workflows, wire Codex+Claude, scope CODEOWNERS#175
Merged
Conversation
Replace 9 PR-time workflows with a single ci.yml (lint, types, pytest, HACS validate, hassfest, gitleaks) so branch protection has one status target. Add Codex-aware claude-assistant.yml driven by @claude mentions with --max-turns 30 as the load-bearing cap. Rewrite CLAUDE.md as a thin override importing @AGENTS.md and @ENGINEERING_CONSTITUTION.md instead of duplicating AGENTS.md. AGENTS.md gains an explicit P0/P1/P2/P3 Review guidelines section so Codex review noise stays bounded. CODEOWNERS scoped to .github/ + manifest.json only — irreversibility, not architectural sensitivity. Cost-calc accuracy is enforced via P0 review rules in AGENTS.md. SHA-pin home-assistant/actions/hassfest, hacs/action, and gitleaks/gitleaks-action per repo pinning policy. wiki-update.yml moved to .github/workflows.disabled/ pending a deliberate re-enable decision.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb2fe9cc1d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Install from requirements.txt (no pyproject.toml in repo; pyproject migration tracked in #176) - Strip job name: overrides so emitted check names match the branch-protection targets (ci, validate, security) - Drop ruff format --check gate — current tree has ~16 files dirty; format-the-tree + re-enable tracked in #176 - Add mypy --ignore-missing-imports to preserve the previous workflow's behaviour while HA stubs aren't installed; HA stubs install + flag drop tracked in #176 Resolves Codex P1 findings on PR #175.
…rrors Scoping mypy to `custom_components/pricehawk` triggered strict package mode and surfaced 3 pre-existing type errors that the old `mypy .` invocation didn't catch. Aligning with the old invocation is the minimum change to unblock the migration; tightening scope + fixing the underlying type errors is tracked in #176.
`mypy .` saw `custom_components/pricehawk/*.py` under two import names (`pricehawk.x` and `custom_components.pricehawk.x`) because the parent directory lacks `__init__.py`, triggering the "Source file found twice" hard-error. Pinning the config via `mypy.ini` with `mypy_path = custom_components` + `explicit_package_bases` resolves it. The 3 type errors that scoped invocation surfaced earlier remain real but are out of scope for this migration — tracked in #176.
Three pre-existing mypy errors surface under the consolidated CI's package-scoped mypy invocation. Per scope discipline (workflow PR, not a typing PR), suppress each with `# type: ignore[code]` and a TODO(#176) comment documenting the correct root-cause fix: - config_flow.py:211 — annotate GLOBIRD_PLAN_DEFAULTS so .get() has a typed return - config_flow.py:415 — install pytest-homeassistant-custom-component for HA stubs that type the ConfigFlow domain kwarg - backfill.py:329 — widen daily_costs value type or split into two dicts Each ignore is greppable (`grep -rn 'TODO(#176)'`) for the follow-up cleanup PR. Constitution §2 satisfied: workarounds are explicitly labelled, isolated, and document the path to correct fix.
The bundle's ci.yml set --cov-fail-under=70 but the current tree sits at ~48% (sensor.py untested, coordinator.py 12%). Old python-ci.yml ran pytest without a coverage gate; matching that behaviour is the minimum-change unblock. Raising coverage + re-enabling the gate is tracked in #176.
Artic0din
added a commit
that referenced
this pull request
May 27, 2026
Resolution policy: - Workflows + CODEOWNERS + slash commands + ENGINEERING_CONSTITUTION.md + mypy.ini → take main's version (the migration's intent). - Source files (backfill.py, config_flow.py) → take dev's version (dev has 60 commits of newer source supersending main's mypy type-ignore comments, which no longer apply to the dev versions). - CHANGELOG.md → preserve dev's beta history, inject main's [Unreleased] block at the top. - 5 legacy workflows deleted per main's intent. This brings the new ci.yml + mypy.ini onto dev so the 16 open dev-targeting PRs run under the consolidated CI once rebased.
Artic0din
added a commit
that referenced
this pull request
May 27, 2026
Migration #175 folded validate.yaml's hassfest + HACS jobs into ci.yml's `validate:` job. test_ci_workflows.py still pointed at the deleted validate.yaml and FileNotFoundError'd on every PR. Rewrite against the new ci.yml structure while preserving the same coverage (triggers, hassfest, HACS, category, permissions floor).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ha-pricehawk had 12 workflows, duplicate AGENTS.md/CLAUDE.md content, and a CodeRabbit-aware Claude assistant that conflicted with the global tool stance (CodeRabbit not used). Branch protection had multiple required checks competing for a single signal.
Closes #
Approach
Drop in the validated
~/Downloads/files/bundle:ci.ymlconsolidates lint, types, tests, HACS validate, hassfest, gitleaks.claude-assistant.ymlhandles@claudemention triggers with--max-turns 30as the load-bearing cap (no--max-budget-usd— unverified support in current action version).CLAUDE.mdrewritten as thin override (@AGENTS.md+@ENGINEERING_CONSTITUTION.md); no more duplication.AGENTS.mdgains explicit P0/P1/P2/P3 Review guidelines for Codex.CODEOWNERSscoped to.github/+manifest.jsononly (irreversibility, not sensitivity)./self-review,/fix-review,/ship) added under.claude/commands/.hassfest,hacs/action,gitleaks-actionper repo pinning policy.wiki-update.ymlmoved to.github/workflows.disabled/rather than deleted — deliberate re-enable later.Scope
This PR does NOT:
pyproject.toml, source code, or tests.dev-templatesto v3 (deferred to follow-up session).Test plan
ci.ymlis the first real test; if it fails on this PR, fix here.actionlintpasses on both new workflow files (verified locally).python -c "import yaml; yaml.safe_load(...)"passes for both (verified).Risk
claude-code-action@v1is now invoked on@claudementions. Costs charged to ANTHROPIC_API_KEY.ci,validate,securitybefore merge — otherwise main will block on checks that no longer exist.Reviewer focus
For @codex: pay particular attention to:
.github/workflows/ci.ymlaction SHA pins.github/workflows/claude-assistant.yml— does the action accept the inputs as written?custom_instructionswas removed because actionlint flagged it as not a valid v1 input.AGENTS.mdReview guidelines section — calibrate severity levels against the actual repoConstitution check
Operator follow-ups (Ryan, GitHub UI)
Before merge:
Artic0din/ha-pricehawk("After every push").ci,validate,security; required Code Owner review on.github/+manifest.json; enable repo-level auto-merge.After merge:
4. Run
gh pr list --state open --json number --jq '.[].number' | xargs -I {} gh pr comment {} --body "@codex review"to trigger Codex on the remaining 15 open PRs.5. Triage per the three-bucket rubric (LGTM / P0-P1 fix-loop / stale-close).