fix(circleci): skip HTTP 500 errors and apply TimeAfter window on full sync#8956
Merged
Conversation
… time range * Skip 500 (corrupt CircleCI Server records) alongside 404 in AfterResponse hook so a single bad pipeline does not abort the entire subtask * Apply SyncPolicy.TimeAfter to workflow and job DB iterators on full sync to avoid calling the API for every historical tool-layer row Signed-off-by: Joshua Smith <jbsmith7741@gmail.com>
klesh
approved these changes
Jun 25, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
Thanks for your contribution.
BTW. I would like to know if you are interested in becoming an Apache Committer of the project? I would like to nominate you, please send me email: klesh@apache.org if you are interested. https://community.apache.org/contributors/becomingacommitter.html
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
Two bug fixes for the CircleCI workflow and job collectors:
1. Skip HTTP 500 responses from corrupt CircleCI Server records
CircleCI Server occasionally returns
500 Internal Server Errorfor pipelines whose internal records are corrupt or stuck (e.g. a pipeline exists in the DB but its/workflowendpoint errors). Previously, this causedignoreDeletedBuildsto fall through and abort the entire collector subtask. Both the workflow and job collectors now use a renamedignoreDeletedOrBrokenBuildshook that treats500the same as404(data-retention deletion) — a non-fatal, per-item skip so collection continues past broken entries.2. Apply
SyncPolicy.TimeAfterwindow on full syncThe DB iterator clause that limits which pipelines/workflows trigger downstream API calls previously only activated when
isIncremental == true. This meant a full sync with aTimeAfterpolicy still iterated every historical tool-layer row and issued an API request for each one. The condition is nowif createdAfter != nil, so both incremental and windowed full syncs skip rows outside the time window.The boundary condition also changed from
>to>=so the exact bookmark timestamp is not silently dropped.Does this close any open issues?
Closes #8948
Screenshots
N/A — no UI changes.
Other Information