Repository navigation
Do not schedule the unit bugfix validation when the functional or integration one owns the verdict - #118108
Conversation
…egration one owns the verdict `new_tests_check.check` is mutually exclusive on the functional/integration-vs-rest axis by design: it returns inside its `has_ft or has_it` branch (new_tests_check.py:230-242), so the branch that reads the unit validator (:251) is unreachable whenever the PR carries such a test. `unit_bugfix_validation_refuted` is that job's only consumer. `filter_job.should_skip_job` already declines to schedule the two functional arms when a PR changes no functional test, and the two integration arms when it changes no integration test, but had no arm for the unit one. So on a bug-fix PR whose reproducer is an SQL or integration test, and which also touches a gtest file for scoping or whitelist reasons, it built a merge-base unit_tests_dbms and emitted a verdict nothing reads. Master's gtest suite is green, so the touched suite passes on the merge base by construction, the verdict is FAIL, and Result.complete_job exits 1: a red check the author cannot clear. This adds the missing arm, so each Bugfix-validation arm is scheduled iff `new_tests_check.check` can consult it. It reuses the two predicates the consumer branches on and that this file already imports, so the scheduler and the gate cannot diverge. Whenever the arm fires, a functional or integration arm exists to hold the verdict, and a missing one leaves the PR blocked, so nothing merges unvalidated. At the scheduler rather than inside the job, because a should_skip_job skip is excluded from the praktika cache by construction (hook_cache.py:101-107 via native_jobs.py:651) and Config Workflow is uncached, so the decision is re-derived on every commit: delete the SQL test later and the arm is scheduled again and refutes correctly. An in-job abstention would instead create a cacheable non-FAIL record whose correctness depends on tests/queries/**, which is not a digest input. That is the hazard 3c57efc was written about. Measured over 60 days of CI DB records, per (pr, sha): 9 false red checks removed on 9 PRs, 8 of them other contributors' and 3 merged with the red still on them; about 553 merge-base unit_tests_dbms builds no longer started; and 244 "Bug reproduced" reports on 66 PRs no longer emitted, none of which the gate read. The 7 events on 4 PRs where the unit arm is the gate are untouched. Validated by calling should_skip_job on the real base-diff file lists of 13 carrier PRs: 0 of 13 skip on pristine master, 9 of 13 with this change, and the 4 unit-only carriers keep running and keep refuting. The same matrix with the condition inverted flips every value, and judged against the as-implemented expectations it fails, so it is not vacuous. The repo has no test harness for ci/jobs/**.
Internal second-model review: 2 rounds, 0 findingsAn independent cold read of the diff plus a second-model pass over the full changed hook, its The two properties I checked hardest, since they are what could make this unsafe:
Filtering a Bugfix-validation arm is also not a new mechanism here: on every non-bugfix PR all five |
|
Workflow [PR], commit [c4ccd97] Summary: ✅ AI ReviewSummaryThis PR teaches Final Verdict✅ No blocking concerns. |
|
cc @maxknv, could you review this? |
3ed2990
Related: #117894
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
On a bug-fix PR whose reproducer is an SQL or integration test,
Bugfix validation (unit tests)reports a red check the author cannot clear when the PR also touches a gtest file for scoping:
Master's gtest suite is green, so such a file passes on the merge base by construction.
new_tests_check.checkis mutually exclusive on the functional/integration-vs-rest axis bydesign: it returns inside its
has_ft or has_itbranch (new_tests_check.py:230-242), so thebranch that reads the unit validator (
:251) is unreachable whenever the PR carries such a test.filter_job.should_skip_jobalready declines the functional arms when a PR changes no functionaltest, and the integration arms likewise, but had none for the unit one. So it scheduled a
merge-base
unit_tests_dbmsbuild whose verdict nothing reads, and aFAILthere exits 1.This adds the missing arm, reusing the predicates the consumer branches on.
Measured over 60 days of CI DB records:
unit_tests_dbmsbuilds no longer startedThose 244 are genuine reproductions, but the gate never reads them and each such PR is validated by
its functional or integration arm. The 7 events on 4 PRs where the unit arm is the gate are
untouched.
The repo has no test harness for
ci/jobs/**. Validation is a matrix callingshould_skip_jobon the real base-diff file lists of 13 carrier PRs: 9 skip, and the 4 unit-only ones keep
refuting.
If you would rather it kept running and abstained, that variant is ~12 lines in
ci/jobs/unit_tests_bugfix_validation_job.py, at the cost of a cacheable non-FAILrecord; yourcall.
Workflow [PR]
Sync PR [sync-upstream/pr/118108]