Skip to content

chore(ci): data/release gates, CodeQL, dependency review, dev container - #772

Merged
tempus2016 merged 2 commits into
mainfrom
chore/ci-tooling-expansion
Aug 10, 2026
Merged

chore(ci): data/release gates, CodeQL, dependency review, dev container#772
tempus2016 merged 2 commits into
mainfrom
chore/ci-tooling-expansion

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Adds the CI/tooling items agreed in this session — everything except the repo-wide ruff format sweep, which follows in its own PR so the reformat noise stays isolated.

Repo-specific gates

Gate What it catches
Translation parity (scripts/check_translations.py) A locale drifting from en.json in either catalogue (386 backend keys, 1739 card/panel keys). Currently all 14 locale files pass key-for-key.
Data files (scripts/check_data_files.py) A blueprint, custom sentence, locale or metadata file that does not parse — the class of breakage that surfaces on a user install, not in pytest. Also cross-checks manifest.json required fields and the hacs.json zip_release/filename pairing.
Release guard (scripts/check_release.py + release-guard.yml) A release whose manifest.json version does not equal the tag exactly (including -beta.N), and a release missing taskmate.zip — which makes it uninstallable via HACS. Polls for the asset so it does not race release-zip.yml.

Security and supply chain

  • CodeQL — Python + JavaScript, security-and-quality queries, on push/PR and weekly. Findings land in the Security tab; not a merge gate.
  • Dependency review — fails a PR that introduces a dependency with a known moderate+ vulnerability.
  • Workflow lintactionlint + zizmor on the CI config itself, path-filtered to .github/**.
  • Findings that audit surfaced, now fixed: a template-injection in release-zip.yml (the release tag was expanded inline into a run: block; now passed via env), and persist-credentials: false on all eight checkouts.
  • Dependabot — 7/14-day cooldown so a bump never lands on a hours-old release, plus a pip entry (monthly, limit 1) so a newer test-harness pin surfaces as a decision instead of never being noticed. The deliberate pin itself is untouched.

CI quality and speed

  • pip + npm dependency caching — the HA test harness install was the slowest step in the run.
  • pytest-cov: a per-module coverage table written into the job summary (worst-covered first) and an HTML report uploaded as an artifact. Baseline is ~20% overall.
  • Removed the duplicate hassfest job from tests.ymlhassfest.yaml already runs it on every push and PR, so it was running twice per PR for no extra signal.
  • ruff check now covers scripts/ as well.

Contributor experience

  • .devcontainer/ — Codespaces / VS Code container that installs the toolchain and builds a scratch HA config at dev-config/ with the integration symlinked in, so hass -c dev-config runs a real HA against the working copy.
  • .pre-commit-config.yaml + pre-commit.ci — ruff, the two data checks, ESLint, and whitespace hygiene.
  • .github/CODEOWNERS — auto-requests review, including on fork PRs.
  • .github/release.yml — groups the generated "What's Changed" list by label so dependency bumps collapse into one section. Does not replace hand-written notes.
  • CONTRIBUTING.md documents all local commands; README gains Data checks / CodeQL / pre-commit.ci badges.

Diff noise, explained

README.md shows ~700 changed lines and two issue templates changed — all of it trailing-whitespace stripping, required for the whitespace hooks to pass. git diff -w on those files is empty. One missing final newline added to taskmate-child-card.js.

Needs your click (cannot be done from the API)

  1. Branch ruleset — add Translation parity and Data files as required checks if you want them to gate merges (the PAT gets 403 on rulesets).
  2. pre-commit.ci — install the app at https://pre-commit.ci for the badge to go live.
  3. Secret scanning + push protection — Settings → Code security, free on public repos.
  4. Repo settings — auto-delete head branches, require conversation resolution.

Verified locally

  • actionlint — clean
  • zizmor --persona regular --min-severity medium . — no findings (was 1 high + 10 medium)
  • ruff check custom_components/taskmate tests scripts — clean
  • python3 scripts/check_translations.py — pass, all 14 locales
  • python3 scripts/check_data_files.py — pass
  • pytest --cov — coverage flags and the summary renderer both work

…tooling

Repo-specific gates:
- scripts/check_translations.py + "Translation parity" job — fails the build
  if any locale's key set differs from en.json, in both the HA translations
  catalogue and the card/panel locales
- scripts/check_data_files.py + "Data files" job — parses every shipped
  blueprint, custom sentence, locale and metadata file, and cross-checks
  manifest/hacs packaging fields
- scripts/check_release.py + release-guard.yml — asserts manifest.json's
  version equals the release tag exactly, and that taskmate.zip actually
  landed on the release (HACS installs break without it)

Security and supply chain:
- codeql.yml — Python + JavaScript analysis on push/PR and weekly
- dependency-review.yml — blocks PRs introducing a vulnerable dependency
- workflow-lint.yml — actionlint + zizmor audit of the CI config itself
- fixed the findings that audit surfaced: template injection via the release
  tag in release-zip.yml, and persist-credentials on every checkout
- dependabot: 7/14-day cooldown on new releases, plus a pip entry so a newer
  test-harness pin surfaces as one PR a month instead of never

CI quality and speed:
- pip and npm dependency caching (the HA harness install was the slow step)
- pytest-cov with a per-module coverage table in the job summary and an HTML
  report artifact
- dropped the duplicate hassfest job from tests.yml (hassfest.yaml already
  runs it on every push/PR)
- ruff now covers scripts/ too

Contributor experience:
- .devcontainer — Codespaces/VS Code container that installs the toolchain and
  creates a scratch HA config with the integration symlinked in
- .pre-commit-config.yaml (+ pre-commit.ci) running ruff, the data checks,
  ESLint and whitespace hygiene
- .github/CODEOWNERS and .github/release.yml (label-grouped generated notes)
- CONTRIBUTING.md documents all of it; README gains the new status badges
@tempus2016 tempus2016 added the ci CI, workflows, and tooling label Aug 10, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation cards Lovelace cards / frontend (www/*.js) labels Aug 10, 2026
Advanced CodeQL configurations can't upload results while GitHub's default
setup is configured, so both Analyze jobs failed. The repo already scans
actions, javascript-typescript and python via default setup; its query suite
has been raised from 'default' to 'extended' instead, which is what the
workflow was adding.
@tempus2016
tempus2016 merged commit c8b0899 into main Aug 10, 2026
15 checks passed
@tempus2016
tempus2016 deleted the chore/ci-tooling-expansion branch August 10, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cards Lovelace cards / frontend (www/*.js) ci CI, workflows, and tooling documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant