openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Required checks lint, build and test are satisfied by a skip when dependency-locks fails

Open aviseth opened this issue 3 months ago • 3 comments

The required checks lint, build, test (HTTPX2), test (Python 3.10) and test (Python 3.14) all come from jobs that declare needs: dependency-locks, and dependency-locks is not itself a required check. Because GitHub treats a skipped required check as satisfied, a failure in dependency-locks skips all five and the branch rule is met with none of them having run.

From About protected branches:

Required status checks must have a successful, skipped, or neutral status before collaborators can make changes to a protected branch.

The state in .github/workflows/ci.yml on main today:

job check name required needs
dependency-locks dependency lock freshness no —
lint lint yes dependency-locks
build build yes dependency-locks
test test (Python 3.10 / 3.14) yes dependency-locks
test-httpx2 test (HTTPX2) yes dependency-locks

None of the five carries an always() or !cancelled() guard, so the default skip-on-upstream-failure behaviour applies. dependency-locks failing is not hypothetical — it is the job that fails when pyproject.toml and uv.lock disagree, which is exactly the situation where you would most want lint and the test suite to run.

The narrowest fix is to make the dependency it gates on a gate itself, by adding dependency lock freshness to the required checks in the ruleset. Nothing in the workflow changes, and a lock failure then blocks on its own terms rather than by silently withdrawing four other checks.

The alternative, if you would rather not grow the required list, is the aggregate-gate shape you already have elsewhere in the ecosystem: one job with if: always() that inspects needs.*.result and exits non-zero, required in place of the individual checks.

Two caveats on scope. Those five jobs also carry if: github.event_name == 'push' || github.event_name == 'merge_group' || github.event.pull_request.head.repo.fork, so on a same-repo pull request they are skipped by design and the real run happens in the merge queue; the exposure I am describing is inside the queue, where a dependency-locks failure would skip the rest of the run and the queue would see satisfied checks. And I can only read your rulesets, not classic branch protection, so if additional enforcement exists that I cannot see, this may already be covered.

Found with greenwash, a tool I wrote for auditing this specific failure mode; greenwash audit --repo openai/openai-python reproduces it.

aviseth avatar Aug 28 '26 13:08 aviseth

Minimal closure path identified from the active repository ruleset:

  • Ruleset 19498094 currently requires lint, build, test (Python 3.10), test (Python 3.14), test (HTTPX2), plus the existing policy/Castiron checks, but does not require dependency lock freshness.
  • Because this defect is specifically about a failed dependency-lock gate being hidden behind skipped required checks, the smallest governance fix is to add the existing dependency lock freshness check as a required status check in ruleset 19498094.
  • This avoids changing four downstream job predicates. The workflow-level fix in PR #3780 remains a valid implementation path and also covers the same-repository PR case highlighted by the P1 review.

Recommended order: add dependency lock freshness to the required checks, then validate the merge-queue path with a stale uv.lock reproduction. Do not treat merge_commit_sha metadata as proof of merge; the PR must report merged=true/merged_at.

fscfede-beep avatar Sep 02 '26 23:09 fscfede-beep

Agreed, and that is the narrower of the two — it is one ruleset edit against four workflow predicates, and it makes the lock job block on its own terms instead of by withdrawing the checks that depend on it.

Worth being clear that it does not fully replace #3780. Adding dependency lock freshness to the required set closes the merge-queue path, which is where the real run happens. On a same-repository pull request the five jobs are skipped by design, so nothing changes there either way, and the always() guards in #3780 are what cover a stale lock surfacing on the PR itself rather than only once it is queued. They are complementary; the ruleset change is the one I would land first because it needs no CI run to take effect.

Reproduction is the same either way: push a branch where pyproject.toml and uv.lock disagree and confirm the merge is blocked rather than green.

aviseth avatar Sep 08 '26 21:09 aviseth

Thanks for flagging this! We haven’t confirmed that this allows a PR to merge with a failed dependency-lock check, so we’re closing this for now. If you can reproduce that, please share the details and we’ll take another look.

marcuswood-oai avatar Sep 23 '26 23:09 marcuswood-oai