Repository navigation
refactor(circleci): make job and workflow extractors incremental (#9305) - #9313
Merged
klesh merged 1 commit intoNov 6, 2026
Merged
Conversation
…che#9305) Use api.NewStatefulApiExtractor for extractJobs and extractWorkflows, so an incremental run reads only the raw rows added since the previous run.
klesh
approved these changes
Nov 6, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thanks for your contribution.
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
extractJobsandextractWorkflowsusedapi.NewApiExtractor, which reads all rows of the raw table on every run. This PR changes them toapi.NewStatefulApiExtractor, the same as the GitHub, GitLab, Jira and YouTrack extractors:A job or workflow can have more than one raw row (the "unfinished details" collectors add a new row when its status changes). The rows are read in
idorder, so the newest row wins, as before.On the first run after the upgrade, the state manager starts from the collector state of the same raw table, so the extractor does not do a full sync again.
Tests
TestCircleciJobExtractorIncrementalandTestCircleciWorkflowExtractorIncremental: a full run, then an incremental run after a new raw row is added, then a full sync. They check that the incremental run reads only the new row and that the newest row wins.Result on real data (one instance, 2 CircleCI projects, last nightly run, before #9309 is deployed):
_raw_circleci_api_jobs, project A_raw_circleci_api_jobs, project B_raw_circleci_api_workflows, project A_raw_circleci_api_workflows, project BThe raw params in
_devlake_collector_latest_stateare the same as the extractor params, so the first run after the upgrade is incremental.Does this close any open issues?
Closes #9305
Other Information
Follows #9309 (#9304). With both changes, an incremental run in our instance reads about 24k new job rows, not the full raw table (about 10.4M rows).