Details
-
Type:
Bug
-
Status: In Review (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Component/s: blueocean-plugin
-
Labels:
-
Similar Issues:
-
Sprint:Blue Ocean - Candidates, Blue Ocean 1.6 - beta 2
Description
I am attempting to link a github repository from my company to Blue Ocean. Note that I have my personal github and repositories for the company I work for (see blueocean hang.png). When I get to the "Which organization does the repository belong to", if I just click my personal one it shows all my repositories with no problem. If I select my work organization, it hangs on the next step (see blueocean hang.png screenshot). I've attached the jenkins.log file which shows the following error: "Github accessToken does not have required scopes. Expected scopes 'user:email, repo'"
But if you look at the blueocean github token.png, you'll see the appropriate scope is set. Also I have no problem if I select my personal "organization".
Any help would be much appreciated.
Alex Kravetz,
Glad you found the problem.
> I am happy to contribute this bug fix.
That will be awesome.
> Where should I implement the error checking? Is it githubscm::connect?
Code at https://github.com/jenkinsci/blueocean-plugin/blob/4201a1ac9675e6ecf752c83e449d46682d386b34/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScm.java#L307 sends back 428 (precondition required) when 403 error is received. The generic message `Github accessToken does not have required scopes. Expected scopes 'user:email, repo'` is unclear given it could be github enterprise integrated with different auth systems, like SAML in your case. Please open a PR with your fix, it will be great to get your contribution!
As mentioned in my previous comment, front end code throws error in the absence of repoData.repositories field. It should do it only if its 200 response.