Gate the codecov requirement on a build profile - #439
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.jsonprofilesdeclarations against declared types and each type's allowed profiles. - Extend the project type model to support
profileson a type andminProfileon a check. - Gate Codecov enforcement in
spec/audit.pyby computingcoverage_activeand skipping bothCODECOV_TOKENandcodecov.ymlrequirements 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
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)
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.
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 thecodecovmechanism at build profile) and gates both coverage requirements on it:CODECOV_TOKENsecret (per-type mechanism), andcodecov.ymlfile presence.A lint-only language has no tests, so no coverage, so neither applies.
Why
spec/audit.pyenforces coverage only via that secret + file (the project-typesminProfilechecks are human-judged contracts, not run mechanically). Without profile-awareness, a lint-only python subtree - e.g. ESPHome-Config's codegen tooling - draws a spuriousCODECOV_TOKENDEFECT andcodecov.ymlLETTER. This unblocks reclassifying such a repo cleanly (slice 4).Verification
spec/audit.py --selftestPASS;spec/validate.pyOK.python(lint-only)declaration on ESPHome-Config draws no codecov findings;python(build)still requiresCODECOV_TOKEN.🤖 Generated with Claude Code