You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "yamoyamoto (via GitHub)" <gi...@apache.org> on 2026/04/26 13:48:15 UTC
[I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
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: dev-unsubscribe@devlake.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #8853:
URL: https://github.com/apache/incubator-devlake/issues/8853#issuecomment-4323326207
<!-- Answer -->
You're absolutely right, apologies for the confusion. I was indeed looking at the `main` branch (commit `2c15ad88`) which corresponds to the older `v1.0.3-beta2` lineage and doesn't have the stale-issue cleanup code from PR #8820.
I've now verified the [actual `v1.0.3-beta12` code at commit `1d21f199`](https://github.com/apache/incubator-devlake/blob/1d21f199783b24fc8486445337d922d8a58badd3/backend/plugins/github_graphql/tasks/issue_collector.go) and can confirm the bug: the unexported `requestedIssues map[int]missingGithubIssueRef` field is present on `GraphqlQueryIssueDetailWrapper` and `merico-ai/graphql`'s `writeQuery` will serialize it as a top-level `requestedIssues` selection on `Query`, causing GitHub's API to reject it.
Your proposed fix is correct — moving `requestedIssues` out of the struct and into a closure-scoped variable (or onto `GithubTaskData`) would prevent it from being serialized into the GraphQL query. The `BuildQuery` closure already has access to `reqData` and can populate a `map[int]missingGithubIssueRef` in the enclosing scope, and the `ResponseParser` closure can read it back — exactly the same pattern already used for the `issueUpdatedAt` map on [L162](https://github.com/apache/incubator-devlake/blob/1d21f199783b24fc8486445337d922d8a58badd3/backend/plugins/github_graphql/tasks/issue_collector.go#L162). Looking forward to your PR!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fincubator-devlake).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fincubator-devlake).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fincubator-devlake#message_id=6e8b2c6d-e6c0-4bf7-a933-11900540a5eb) [](https://github.dosu.com/apache/incubator-devlake?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fincubator-devlake) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fincubator-devlake)
--
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: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
Posted by "tomoya-kawaguchi-techtical (via GitHub)" <gi...@apache.org>.
tomoya-kawaguchi-techtical commented on issue #8853:
URL: https://github.com/apache/incubator-devlake/issues/8853#issuecomment-4323306059
@dosu
This looks like it's checking an older commit. On the current [`v1.0.3-beta12`](https://github.com/apache/incubator-devlake/tree/v1.0.3-beta12) tag (same SHA as `upstream/main` HEAD, `1d21f1997...`), `requestedIssues` is still a field on [`GraphqlQueryIssueDetailWrapper`](https://github.com/apache/incubator-devlake/blob/1d21f199783b24fc8486445337d922d8a58badd3/backend/plugins/github_graphql/tasks/issue_collector.go#L54-L62) and is populated/read by the second `Collect Issues` pass, so the GraphQL error from the report still reproduces there. The `2c15ad880` commit referenced earlier sits on the `v1.0.3-beta2` lineage, before #8820 introduced that wrapper field — that's likely why the diff looked already fixed from there.
--
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: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #8853:
URL: https://github.com/apache/incubator-devlake/issues/8853#issuecomment-4322190807
<!-- Answer -->
Thanks for the detailed bug report, @yamoyamoto! Your diagnosis is spot on.
Looking at the current `main` branch, the `GraphqlQueryIssueDetailWrapper` struct [does **not** contain](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/github_graphql/tasks/issue_collector.go#L50-L57) the `requestedIssues` field — it only has `RateLimit` and `Repository`. The tracking is done via a closure variable `issueUpdatedAt` (a `map[int]time.Time`) declared [at L162](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/github_graphql/tasks/issue_collector.go#L162), populated in the [BuildQuery closure](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/github_graphql/tasks/issue_collector.go#L174-L182), and read in the [ResponseParser closure](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/github_graphql/tasks/issue_collector.go#L190-L199).
So it appears the approach you recommended (moving the metadata out of the struct and into the closure) is already how the code looks on `main`. Could you double-check whether the version you're running actually contains the problematic `requestedIssues` field? The `v1.0.3-beta12` tag doesn't seem to exist in the repository — only `v1.0.3-beta1` and `v1.0.3-beta2` are present. It's possible you're running from a branch or build that includes the intermediate state from PR #8820 before it was corrected.
If you're still hitting this on a specific build, upgrading to the latest `main` should resolve it.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fincubator-devlake).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fincubator-devlake).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fincubator-devlake#message_id=e1e349da-e9bc-463c-962d-60e22a6d6c7a) [](https://github.dosu.com/apache/incubator-devlake?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fincubator-devlake) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fincubator-devlake)
--
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: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
Posted by "yamoyamoto (via GitHub)" <gi...@apache.org>.
yamoyamoto commented on issue #8853:
URL: https://github.com/apache/incubator-devlake/issues/8853#issuecomment-4323324919
@dosu
This looks like it's checking an older commit. On the current [v1.0.3-beta12](https://github.com/apache/incubator-devlake/tree/v1.0.3-beta12) tag, requestedIssues is still a field on [GraphqlQueryIssueDetailWrapper](https://github.com/apache/incubator-devlake/blob/1d21f199783b24fc8486445337d922d8a58badd3/backend/plugins/github_graphql/tasks/issue_collector.go#L54-L62) and is populated/read by the second Collect Issues pass, so the GraphQL error from the report still reproduces there. The 2c15ad880 commit referenced earlier sits on the v1.0.3-beta2 lineage.
--
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: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'` [incubator-devlake]
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh closed issue #8853: [Bug][github_graphql] `Collect Issues` fails on second phase with `Field 'requestedIssues' doesn't exist on type 'Query'`
URL: https://github.com/apache/incubator-devlake/issues/8853
--
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: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org