yamoyamoto opened a new issue, #8853:
URL: https://github.com/apache/incubator-devlake/issues/8853

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   In `v1.0.3-beta12` the second phase of `github_graphql` `Collect Issues` 
(the stale-local-issue cleanup added in 
[#8820](https://github.com/apache/incubator-devlake/pull/8820)) aborts the 
subtask with `Field 'requestedIssues' doesn't exist on type 'Query'`:
   
   ```
   [Collect Issues] ended Graphql collector execution with error
           Wraps: (2) Field 'requestedIssues' doesn't exist on type 'Query'
           Error types: (1) *hintdetail.withDetail (2) graphql.DataError
   ```
   
   The unexported `requestedIssues` field added to 
`GraphqlQueryIssueDetailWrapper` in 
[#8820](https://github.com/apache/incubator-devlake/pull/8820) 
([`issue_collector.go` 
L54-L62](https://github.com/apache/incubator-devlake/blob/v1.0.3-beta12/backend/plugins/github_graphql/tasks/issue_collector.go#L54-L62))
 is intended as Go-side per-request metadata — populated before the request 
(L198) and read in the response callback (L221, L231) to detect issues that 
disappeared upstream. The `merico-ai/graphql` marshaller appears not to skip 
unexported fields, so `requestedIssues` is emitted as a top-level selection on 
`Query` and GitHub rejects it.
   
   ### What do you expect to happen
   
   `Collect Issues` completes both phases when `_tool_github_issues` already 
has rows.
   
   ### How to reproduce
   
   1. `Collect Data` once so `_tool_github_issues` has rows for the scope.
   2. `Collect Data` again — phase 2 fails on the first request.
   
   A scope with an empty `_tool_github_issues` skips phase 2 and does not 
surface the bug.
   
   ### Anything else
   
   The right fix is to move `requestedIssues` out of 
`GraphqlQueryIssueDetailWrapper` and keep it on the closure or on 
`GithubTaskData`. `merico-ai/graphql`'s `writeQuery` ([`query.go` 
L111-L173](https://github.com/merico-ai/graphql/blob/master/query.go#L111-L173))
 does not special-case `graphql:"-"` (the tag value would just be rendered as 
the field name `-`) and does not skip unexported fields, so there is no 
struct-tag-only escape hatch on the wrapper as written.
   
   ### Version
   
   v1.0.3-beta12
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to