Repository navigation
fix(github_graphql): extract only new raw rows in Extract Jobs - #9427
Open
shaynhornik wants to merge 1 commit into
Open
shaynhornik wants to merge 1 commit into
shaynhornik wants to merge 1 commit into
Conversation
Extract Jobs used api.NewApiExtractor, which deletes and saves again every job of the repo on every run. The run time grew with the CI history, and because every job got a new updated_at, the incremental Convert Jobs converted all of them again as well. Use api.NewStatefulApiExtractor, like the REST plugin does, so an incremental run reads only the raw rows that the collector added since the previous run. A full sync, the first run after the upgrade and a change of the deployment or production pattern still extract every row. Generated-by: Claude Code (Claude Fable 5.2) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2 of 3 tasks
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
Extract Jobsin github_graphql was built withapi.NewApiExtractor, which deletes and saves again every job of the repo on every run. The run time grew with the CI history, and because every_tool_github_jobsrow got a newupdated_at, the incrementalConvert Jobsconverted all of them again too (#9421).It now uses
api.NewStatefulApiExtractor, likeplugins/github/tasks/cicd_job_extractor.go, so an incremental run reads only the raw rows the collector added since the previous run. The field mapping is unchanged.One addition compared with the REST extractor:
SubtaskConfig: data.RegexEnricher.PlainMap(). A job'sTypeandEnvironmentcome from the scope config's deployment and production patterns, so a change of those patterns extracts every job again. Without it, a re-transform after a pattern change would leave old jobs classified the old way.When every row is still extracted:
Why incremental is safe here:
Collect Jobsis a stateful GraphQL collector that only deletes raw rows on a non-incremental run and otherwise inserts a new raw row for a changed job. Rows are read in id order and upserted, so the newest raw row wins.Does this close any open issues?
Closes #9421
Tests
New e2e test
TestGithubGraphqlJobExtractorIncrementalwith a raw fixture of 5 check runs:updated_at.Environmentchanges on an old job.Against the old extractor the test fails on the
updated_atchecks.Run locally:
go test ./plugins/github_graphql/e2e/...on MySQL 8.4 and PostgreSQL 18, and the new test 10 times on each.go test ./plugins/github_graphql/tasks/... ./plugins/github_graphql/impl/... ./helpers/pluginhelper/api/...go vetandgolangci-lintv2.15.0 on the plugin.Not run: the full unit and e2e suites, and a real collection against GitHub.
Other Information
Extract Jobs. Releases and deployments look like the same one-step change; issues and pull requests write child rows and need more than that. I can follow up if you want them.Generated-by: Claude Code (Claude Fable 5.2). I reviewed and tested the change.
🤖 Generated with Claude Code