fix(github_graphql): remove stale local issue rows when an issue no longer resolves#8820
Open
squatboy wants to merge 3 commits intoapache:mainfrom
Open
fix(github_graphql): remove stale local issue rows when an issue no longer resolves#8820squatboy wants to merge 3 commits intoapache:mainfrom
squatboy wants to merge 3 commits intoapache:mainfrom
Conversation
klesh
reviewed
Apr 1, 2026
|
|
||
| func cleanupMissingGithubIssue(db dal.Dal, issue missingGithubIssueRef) errors.Error { | ||
| deleteByIssueId := func(model any, table string) errors.Error { | ||
| err := db.Delete(model, dal.From(table), dal.Where("connection_id = ? AND issue_id = ?", issue.ConnectionId, issue.GithubId)) |
Contributor
There was a problem hiding this comment.
Is it possible to move an issue from one repository to another when both repos are already configured in Apache DevLake?
Author
There was a problem hiding this comment.
Do you mean a case where an issue is transferred from repo A to repo B while both repositories are already configured in Apache DevLake?
If so, then yeah I think that is possible. In that case, deleting by connection_id and issue_id alone could be too broad
Author
There was a problem hiding this comment.
@klesh Should I update this change so that it covers the github issue transfer case?
Author
There was a problem hiding this comment.
I just updated to make the issue cleanup repo-scoped, so it handles transferred issues more safely.
…tory boundaries The previous missing-issue cleanup only keyed deletes by connection and issue identifiers, which could reach too broadly when an issue was transferred between repositories under the same DevLake connection. This change scopes cleanup to the source repository by carrying RepoId through the refresh path and requiring the source RawDataOrigin parameters before deleting stale tool rows. Constraint: Keep the fix inside the existing github_graphql collector path without schema changes Rejected: Continue deleting by connection_id + github_id only | could remove destination-repository rows after transfers Rejected: Disable stale cleanup for all missing issues | would leave deleted-issue failures recurring Confidence: medium Scope-risk: moderate Directive: Preserve source-scope guards if future cleanup paths touch transferred issues again Tested: go test ./plugins/github_graphql/tasks; go build ./helpers/pluginhelper/api ./plugins/github_graphql/tasks Not-tested: End-to-end transfer scenario against a live GitHub repository
6a37b18 to
b60faec
Compare
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.
pr-type/bug-fix,pr-type/feature-development, etc.Summary
This is a follow-up to #8637.
#8637stopped failing the GraphQL collector immediately when GitHub returnedCould not resolve to an Issue, but the missing issue could still remain in DevLake's local issue and raw tables.This patch keeps the GraphQL collector tolerant of that missing-issue data error and also removes the stale local rows that keep the missing issue in the GitHub GraphQL
refresh OPEN issuespath.What changed:
ResponseParserwhen the only GraphQL data errors are ignorableCould not resolve to an Issueerrors_tool_github_issues_tool_github_issue_comments_tool_github_issue_events_tool_github_issue_labels_tool_github_issue_assignees_tool_github_pull_request_issuesRawDataOriginWhy:
refresh OPEN issuescollector pathDoes this close any open issues?
Closes #8819
Screenshots
N/A
Other Information
Tests and validation:
go test ./plugins/github_graphql/tasksgo build ./helpers/pluginhelper/apiScope note: