-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
No token could be found with access #103
Comments
Can you confirm if this is github.com, or Github server and - if it's server - what the version number is please? |
It's github.com. |
I suspect https://developer.github.com/v3/#pagination is causing issues. All my tests cases have been against organisations/users with a low number of repositories which is why I wouldn't have seen this. The code isn't checking for the The only work-around I can see for now is specifying a small list of repositories that the application is allowed to access as per your current approach. |
This is also an issue for our case, where we have ~600 repos in our org, and we'd like to scan all of them :) |
Are either of you able to install a snapshot build to test with if I manage to create an appropriate fix? I could try and create lots of repositories just for testing, but a real-world test would be preferable. |
@mc1arke Sure thing! |
I'm having the same issue I think, happy to help testing as well. |
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one if found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present.
I've pushed a proposed fix to issue/103. Could one of you build and install from that branch and see if it allow for your repository to be found when allowing access to all your repositories in the application configuration? |
I have tested it and now it works fine in my case! |
👍 here.. works with latest fix |
Thanks for testing. I'll get an MR containing that change raised and merged later today if possible. |
Hey, sorry to bother... but... any news on this? Anything I can do to help? |
You can checkout the https://github.com/mc1arke/sonarqube-community-branch-plugin/tree/issue/103 and build it locally. With this fix it works fine! |
If anyone else needs it, built: https://jars.caarlos0.dev/sonarqube-community-branch-plugin-1.3.1-SNAPSHOT.jar |
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one if found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one if found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one if found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one if found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one is found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
When trying to find authentication tokens for accessing a repository, the list of repositories attached to a token are currently iterated over until one is found with a matching name, or the end of the retrieved list is reached. However, this search is not taking into account pagination in the response from Github, so any list of repositories that is greater than the default page size fails to find a matching authentication token if the repository is not present on the first page of the repository list. To resolve this, the response is checked for a `Link` header with a `rel="next"` element, with the link in this header being followed for each response until a matching repository is found, or the header is not present. Includes a drive-by-change to allow correct reporting of test coverage to SonarCloud.
…ty-branch-plugin * 'master' of https://github.com/mc1arke/sonarqube-community-branch-plugin: mc1arke#103: Handle pagination on repositories response Submit analysis to SonarCloud during Travis build
Released in version 1.3.1 |
Describe the bug
I got the following exception if I have configured my app to have access to all my repositories and also new created ones. If I configure it to have access only to specific ones, no error occurs.
My organization has 60+ repositories.
To Reproduce
Configure your GitHub Application to have access to all repositories and new created ones.
Expected behavior
That the error not occurs.
Screenshots
Software Versions
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: