Skip to content

Gate the codecov requirement on a build profile - #439

Merged
ptr727 merged 5 commits into
developfrom
audit-codecov-profile-gate
Jul 25, 2026
Merged

Gate the codecov requirement on a build profile#439
ptr727 merged 5 commits into
developfrom
audit-codecov-profile-gate

Conversation

@ptr727

@ptr727 ptr727 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Slice 3 of the lint-only language type work (slices 1-2 merged: the model doc, the vocabulary + schema). This is the audit's profile consumption - and the fix for the spurious codecov findings a lint-only python subtree draws.

What

Computes coverage_active (any declared type claims the codecov mechanism at build profile) and gates both coverage requirements on it:

  • the CODECOV_TOKEN secret (per-type mechanism), and
  • the codecov.yml file presence.

A lint-only language has no tests, so no coverage, so neither applies.

Why

spec/audit.py enforces coverage only via that secret + file (the project-types minProfile checks are human-judged contracts, not run mechanically). Without profile-awareness, a lint-only python subtree - e.g. ESPHome-Config's codegen tooling - draws a spurious CODECOV_TOKEN DEFECT and codecov.yml LETTER. This unblocks reclassifying such a repo cleanly (slice 4).

Verification

  • spec/audit.py --selftest PASS; spec/validate.py OK.
  • End-to-end: a temp python(lint-only) declaration on ESPHome-Config draws no codecov findings; python(build) still requires CODECOV_TOKEN.

🤖 Generated with Claude Code

ptr727 and others added 5 commits July 25, 2026 08:16
Define the cpp lint-only type (clang-format), the build and lint-only
profiles on the language types that carry them, and a minProfile on the
build-requiring checks (both coverage checks, uvlock, pyright) so the
audit can hold them N/A for a lint-only language. Declare the profile in
the registry as a parallel profiles map rather than an object-or-string
types entry, because audit.py builds a set and dict-indexes the types
list and an object would break both. validate.py checks a declared
profile against the repo's types and the type's allowed profiles. The
audit does not consume the new fields yet, so behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Use the declared profile vocabulary (build/lint-only) as the profile
names throughout the python type, keeping PROJECT/SCRIPTS only as the
structural pyproject shapes they detect. Removes the two-vocabulary
ambiguity about what the registry declares, and splits two more
pre-existing semicolon splices in the touched asserts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Say the declared profile corresponds to the pyproject shape and that
each check names its minimum profile, rather than claiming the audit
validates the profile against pyproject or gates checks by it - that
consumption lands in a later slice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A lint-only language has no tests and no coverage, so it must not draw
the codecov requirement. Compute whether any type claims the codecov
mechanism at build profile, and hold both the CODECOV_TOKEN secret and
the codecov.yml file N/A when none does. Fixes the spurious CODECOV_TOKEN
defect and codecov.yml letter a lint-only python subtree (e.g. an ESPHome
codegen tooling subtree) otherwise draws.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds profile awareness (build vs lint-only) to the audit so Codecov requirements are enforced only when a repo has at least one declared build profile language that claims Codecov, eliminating spurious coverage findings for lint-only language subtrees.

Changes:

  • Validate registry/repos.json profiles declarations against declared types and each type's allowed profiles.
  • Extend the project type model to support profiles on a type and minProfile on a check.
  • Gate Codecov enforcement in spec/audit.py by computing coverage_active and skipping both CODECOV_TOKEN and codecov.yml requirements when coverage is N/A.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/validate.py Adds validation for profiles declarations (shape + type/profile allowlist checks).
spec/project-types.schema.json Adds schema support for per-check minProfile and per-type profiles.
spec/project-types.json Declares supported profiles for csharp, python, and cpp, and marks coverage-related checks as minProfile: build.
spec/audit.py Computes coverage_active and gates Codecov token and codecov.yml requirements on non-lint-only profiles.
registry/repos.schema.json Adds profiles field to the registry schema (type -> {lint-only, build}).

@ptr727
ptr727 merged commit 8b72627 into develop Jul 25, 2026
7 checks passed
@ptr727
ptr727 deleted the audit-codecov-profile-gate branch July 25, 2026 16:05
ptr727 added a commit that referenced this pull request Jul 25, 2026
## Promote develop to main

The lint-only language type work, slices 1-4 (doc/spec/registry only, no
code path changes - no release):

- **#437** - `spec/type-model.md`: the durable model doc
(declared-primary, detection-as-validator, build/lint-only profiles, the
ignore mechanism).
- **#438** - the `cpp` type + `build`/`lint-only` profile vocabulary +
per-check `minProfile` in `project-types.json`/schemas + `validate.py`
enforcement; python profile names aligned to build/lint-only.
- **#439** - `audit.py` gates the codecov requirement (CODECOV_TOKEN
secret + codecov.yml file) on a build profile, so a lint-only language
draws no coverage finding.
- **#440** - reclassify ESPHome-Config `source-only + python(lint-only)
+ cpp(lint-only)`; record the devcontainer-is-optional convention in the
section model.

## Verification

- `spec/validate.py` OK; `spec/audit.py --selftest` PASS.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants