Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop when there are multiple pages of vulnerabilities or dependencies #13

Open
jorge-abarca opened this issue Jan 12, 2023 · 0 comments

Comments

@jorge-abarca
Copy link

The function getPaginatedQuery in GitHubDependencies.ts enters into an infinite loop when there is another page since the cursor is updated in the variable queryParameters while graphqlParameters - used for the query - uses the variable parameters.

This issue affects repositories that have more than one page of vulnerabilities or dependencies, since both getAllVulnerabilities and getAllDependencies rely on getPaginatedQuery.

I have a PR open that addresses this, but if you don't feel comfortable with it or you are in the middle of some refactoring, please fix getPaginatedQuery. This will cause workflows to keep running until the access token expires, returning a Bad credentials error that masks the actual issue.

Here is an example of code that would address this issue:

      const graphqlParameters = buildGraphQLParameters(query, queryParameters, headers)
        , queryResult = await octokit.graphql(graphqlParameters)
      ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant