Skip to content

fix: merge unfiltered runs into filtered run search - #432

Merged
dawidd6 merged 1 commit into
masterfrom
fix/filtered-run-search
Sep 29, 2026
Merged

dawidd6 merged 1 commit into
masterfrom
fix/filtered-run-search

Conversation

@dawidd6

@dawidd6 dawidd6 commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Refs #428

Problem

When branch, event or commit is used, listWorkflowRuns is queried with filters, which GitHub serves from a search index (docs: "up to 1,000 results for each search when using … branch, … event, head_sha, status"). That index intermittently returns a random subset of the matching runs. The subset is still sorted, total_count equals the truncated length, and there is no next link, so neither the response order nor pagination shows the gap. The action then picks the newest run in the subset, which can be months old.

Measured on Panzerschrek/U-00DC-Sprache (main.yml, newest master run #5170):

Query Calls Newest run missing
branch=master 98 6
status=success 20 3
repo-wide + branch=master 20 2
no filter 56 0

A bad response looked like 18/18 runs (#5169, 5118, 5108, 5018 … 4950) against a real total of 114. The debug log in #428 shows the extreme case: a page containing 1 run out of hundreds.

Fix

When a search filter is set, also fetch the latest 100 runs without filters, match them locally (head_branch, event, head_sha), and merge any that are missing into the first filtered page before sorting. Cost: one extra request, only when those filters are used. This only helps when the newest matching run is among the workflow's latest 100 runs. If it isn't, behavior is unchanged.

Testing

Dry runs against the public repo above, through a local proxy that returns the recorded truncated response for the filtered query:

  • with fix: picks #5170 (2026-09-13)
  • without fix: picks #5169 (2026-08-02)

During testing, the live API also returned a truncated page once, and the merge picked up the missing run.

🤖 Generated with Claude Code

Queries using branch/event/head_sha are served by GitHub's search index,
which intermittently returns a random subset of matching runs, with
total_count and pagination matching the truncated result. The action
then picks an arbitrarily old run.

Fetch the latest unfiltered page as well, match those runs locally and
merge them into the first filtered page before sorting.

Refs #428

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saltymv

saltymv commented Oct 8, 2026

Copy link
Copy Markdown

👍🏼

centosinfra-prod-github-app Bot pushed a commit to ansible-collections/amazon.aws that referenced this pull request Oct 8, 2026
…ates (#3148)

Bumps the github-actions group with 2 updates in the / directory: dawidd6/action-download-artifact and SonarSource/sonarqube-scan-action.
Updates dawidd6/action-download-artifact from 25 to 27

Release notes
Sourced from dawidd6/action-download-artifact's releases.

v27
What's Changed

fix: merge unfiltered runs into filtered run search by @​dawidd6 in dawidd6/action-download-artifact#432

Full Changelog: dawidd6/action-download-artifact@v26...v27
v26
Full Changelog: dawidd6/action-download-artifact@v25...v26



Commits

eab87c9 fix: merge unfiltered runs into filtered run search (#432)
27e4ae6 feat: log skipped workflow runs in debug mode
See full diff in compare view



Updates SonarSource/sonarqube-scan-action from 8.2.2 to 8.3.0

Release notes
Sourced from SonarSource/sonarqube-scan-action's releases.

v8.3.0
What's Changed

Fix GPG key retrieval through HTTPS proxies by @​Torbjorn-Svensson in SonarSource/sonarqube-scan-action#265
Configure Renovate by @​renovate[bot] in SonarSource/sonarqube-scan-action#267
SQSCANGHA-168 Update actions/cache action to v5.1.0 by @​renovate[bot] in SonarSource/sonarqube-scan-action#269
Update npm dependencies by @​renovate[bot] in SonarSource/sonarqube-scan-action#268
Update dependency @​actions/exec to v3 by @​renovate[bot] in SonarSource/sonarqube-scan-action#270
Update GitHub Actions dependencies (major) by @​renovate[bot] in SonarSource/sonarqube-scan-action#271

New Contributors

@​Torbjorn-Svensson made their first contribution in SonarSource/sonarqube-scan-action#265
@​renovate[bot] made their first contribution in SonarSource/sonarqube-scan-action#267

Full Changelog: SonarSource/sonarqube-scan-action@v8.2.2...v8.3.0



Commits

d209202 Update GitHub Actions dependencies (major) (#271)
0333cb3 Update dependency @​actions/exec to v3 (#270)
da4450e Update npm dependencies (#268)
c5094d1 SQSCANGHA-168 Update actions/cache action to v5.1.0 (#269)
001613f SQSCANGHA-162 Configure Renovate (#267)
6abe0a7 SQSCANGHA-165 Fix GPG key retrieval through HTTPS proxies (#265)
See full diff in compare view



Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
@dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
@dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
@dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
@dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

Reviewed-by: Don Naro <dnaro@redhat.com>
Reviewed-by: Bikouo Aubin
veprbl added a commit to eic/EICrecon that referenced this pull request Oct 10, 2026
Workflow run queries filtered by head_sha or status are served by a
search index that intermittently returns a random subset of the matching
runs, with total_count and pagination matching the truncated result.
This can select an older run for a commit, or none at all.

As in action-download-artifact (dawidd6/action-download-artifact#432),
also fetch the latest 100 runs of the workflow without filters, and merge
them with the filtered results before selecting. Match status locally
instead of in the query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants