Skip to content

[Bug][github_graphql] Extract Pull Requests, Issues, Deployments and Releases read and rewrite the full raw table on every run #9442

In review

Description

@shaynhornik

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Follow-up to #9421, which noted that job_extractor.go was not the only one left behind. Four more extractors of the github_graphql plugin are still built with api.NewApiExtractor:

  • Extract Pull Requests (pr_extractor.go)
  • Extract Issues (issue_extractor.go)
  • Extract Deployments (deployment_extractor.go)
  • Extract Releases (release_extractor.go)

Their collectors are stateful: each run only fetches what changed and appends it to the raw table. The extractors are not, so every run deletes the tool-layer rows of the scope and extracts every raw row again, however little was collected. The work grows with the history of the repository, and pull requests and issues are the largest tables of a GitHub scope.

Two side effects:

What do you expect to happen

The four extractors use api.NewStatefulApiExtractor, as the REST github plugin already does for pull requests and issues (plugins/github/tasks/pr_extractor.go, issue_extractor.go):

  • An incremental run extracts only the raw rows added since the previous run.
  • The label patterns of the scope config go into the subtask config, so a change triggers a full extraction.
  • The labels of a pull request, and the labels and assignees of an issue, are replaced when it is extracted again.

Extract Users (account_extractor.go) can stay as it is: its collector is not stateful and rewrites its raw table on every run.

How to reproduce

  1. Collect a GitHub repository with github_graphql twice, without full sync.
  2. In the second run, the log line get data from _raw_github_graphql_prs where params=... and got N reports the full raw table, not the rows collected in that run. The same holds for _raw_github_graphql_issues, _raw_github_graphql_deployment and _raw_github_graphql_release.
  3. Remove a label from a pull request between two runs: the label is still in _tool_github_pull_request_labels afterwards.

Anything else

Happens on every run.

Version

main

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. shaynhornik commented on Nov 24, 2026

    @shaynhornik
    ContributorAuthor

    PR: #9443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ Proxy