fix(github_graphql): remove stale local issue rows when an issue no longer resolves#8820
fix(github_graphql): remove stale local issue rows when an issue no longer resolves#8820squatboy wants to merge 1 commit intoapache:mainfrom
Conversation
| } | ||
|
|
||
| func findMissingGithubIssues(requestedIssues map[int]missingGithubIssueRef, resolvedIssues []GraphqlQueryIssue) []missingGithubIssueRef { | ||
| if len(requestedIssues) == 0 { |
There was a problem hiding this comment.
Should we return on len(requestedIssues) == len(resolvedIssues) as well?
There was a problem hiding this comment.
I considered that, but I left it out because the counts can still match even when one of the requested issues comes back as a zero-value entry with graphql-extend:"true". So comparing the actual issue numbers felt safer here.
|
|
||
| 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)) |
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?
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
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: