feat(coverage-floor): add extras: input for selective extras install#69
Merged
Conversation
Adds a new optional input `extras` to the coverage-floor reusable workflow. Lets Python callers control which `[project.optional-dependencies]` extras get installed before pytest-cov runs. Values: - "all" (default) — `uv sync --all-extras`, preserves prior behavior - "none" — `uv sync` with no extras - comma-separated list — `uv sync --extra <a> --extra <b> ...` Motivation — burn 2026-05-19 (wxa_webcat): Coverage Floor failed silently for 8 consecutive PRs (#379-#387) because `uv sync --all-extras` triggered uv to clone webcat's `crawl` extra: webcrawl @ git+https://github.com/topcoder1/webcrawl.git AUTOMERGE_PAT (the only forwardable cross-org credential) doesn't have read scope on topcoder1/webcrawl. The `Configure git for cross-org clones` step ran successfully (rewrote URL with token) but the actual fetch returned 404, killing the `uv sync` step in 0 seconds. Workarounds that DIDN'T work or had unwanted tradeoffs: - Forwarding AUTOMERGE_PAT (already forwarded; PAT scope is the issue) - Broadening AUTOMERGE_PAT scope (security tradeoff — fleet-wide PAT growing in scope is exactly the kind of credential sprawl we want to avoid) - Repo-side pyproject restructure (changes how webcrawl is consumed in real environments, not just CI) This input lets the caller pass `extras: "dev,api,model,data,headless"` to skip the problematic `crawl` extra without changing any fleet-wide credentials. The pattern generalizes to any future repo with cross-org git deps. Backward compatibility: - Default `"all"` reproduces the current `--all-extras` behavior verbatim. - All 44 existing callers in the fleet continue to work without modification. - Self-test on this repo is unaffected (no extras anyway; default path). Follow-ups (separate PRs): - Update `callers/coverage-floor.yml` template in topcoder1/dotclaude to document the input with a commented example. - whois-api-llc/wxa_webcat caller-side PR to pass `extras: "dev,api,model,data,headless"` and unblock the coverage-floor gate there. - Consider adding graceful degradation: catch `uv sync` cross-org clone failures and retry with the extra dropped + warning, so future repos can self-recover without needing the caller to know which extra is the offender. Deferred — explicit caller control is the safer default. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Coverage Floor — mode:
|
|
No issues found. Bash array expansion, IFS scoping, and env-var injection surface all check out; the unreachable empty-string case arm and xargs trimming are minor but not bugs given PEP 508 extra-name constraints. |
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.
Summary
Adds an
extras:input to the coverage-floor reusable workflow, letting Python callers control which[project.optional-dependencies]extras get installed before pytest-cov runs."all"(default)uv sync --all-extras— preserves prior behavior"none"uv syncwith no extras"dev,api,model"(comma list)uv sync --extra dev --extra api --extra modelMotivation — burn 2026-05-19 (
whois-api-llc/wxa_webcat)Coverage Floor has been silently failing on every webcat PR since at least #379 (8 consecutive failures, 6 days). Detected during the autonomous-agent-team calibration runs (#385, #387 both auto-merged with this check red — it's non-required).
Root cause discovered after deep diagnosis:
pyproject.tomldeclarescrawl = ["webcrawl @ git+https://github.com/topcoder1/webcrawl.git"]uv sync --quiet --all-extrastriggersgit clone topcoder1/webcrawlAUTOMERGE_PAT(the secret forwarded to the reusable for the seed-PR flow) does not have read scope ontopcoder1/webcrawlConfigure git for cross-org clonesstep successfully rewrites the URL with token auth (no error), but the actual fetch returns 404, killinguv syncin 0 secondsWhy this approach over alternatives
AUTOMERGE_PATscopeCROSS_ORG_READ_PATsecretpyproject.toml(move webcrawl out of extras)Backward compatibility
"all"reproduces--all-extrasbehavior verbatim.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/coverage-floor.yml'))")"all"code path — should remain greenwhois-api-llc/wxa_webcatwill passextras: "dev,api,model,data,headless"and validate the comma-list code path end-to-endcoverage-floor / Measure coverage and enforce floorto required-status-checksFollow-ups (separate PRs, NOT this one)
topcoder1/dotclaude— updatecallers/coverage-floor.ymltemplate with a commentedextras:examplewhois-api-llc/wxa_webcat— caller-side PR usingextras: "dev,api,model,data,headless"Auto-merge rationale
Reusable workflow change with input default preserving current behavior. Touches
.github/workflows/coverage-floor.yml(workflow file — high-risk path underclaude-author-automerge.ymlrules), so this is manual-click merge required, not auto-merge. Recommend reviewing the input naming, YAML structure, and bash escaping before clicking.Codex pre-review
Recommended before merge — this is a reusable workflow consumed by 44 fleet repos. Codex should specifically check:
IFS=',',read -ra, quoted expansion of\"\${EXTRA_FLAGS[@]}\")extras: ""(empty) should be treated as"all"(current behavior) or"none"(current behavior also routes empty to "none" via the case fallthrough — fine either way)HUMAN_READABLE_SUMMARY
Coverage Floor reusable now accepts an
extras:input letting callers skip Python extras that contain cross-org git deps. Default behavior unchanged for all 44 existing callers. Fixes a 6-day silent gate failure on webcat caused by--all-extrastrying to clonetopcoder1/webcrawlwithout sufficient PAT scope.🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com