A developer pushes an application change, then spots a typo in the documentation and pushes a correction. The pull request still contains the application change. Should its latest revision run backend tests?
In a local check of a MetaboliQ CI rule, the answer depended on which two commits the selector compared. Given the previous push and the current head, it saw only documentation and skipped the backend suite. Given the full branch diff, it selected the suite. All 22 of the rule’s existing test cases had passed.
There was a good reason to make the selector more precise. Documentation changes were queuing a backend job on a shared runner. In an earlier case, a change to a standalone tool had sent an end-to-end job looking for a local model. The runner could not reach it, and the job stopped before its first test. Running every suite for every push has a cost. So does skipping the one that exercises a change still under review.
The simplest regression case takes two pushes. Start a temporary branch, change application code, commit, and run the selector. Then change only a Markdown file and commit again. Keep the original branch point. At the second head, run the selector against both the previous commit and that branch point. The file lists should differ. If this result will stand for the pull request, assert that the backend suite is selected for the application change still in it. Add a separate docs-only branch to check that the intended saving survives.
Both the original rule and its correction merged. The correction uses the merge base, the most recent commit shared by the working branch and the default branch. In an independent local check, all 25 supplied cases passed. A separate test then replayed the two pushes above. This time the selector requested backend tests after the documentation edit. That result tells us which job the rule selected. To find out whether the job started and passed on a hosted revision, look up the job receipt for that commit.
← All engineering articles