You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/12/21 06:26:45 UTC

[GitHub] [incubator-devlake] hezyin opened a new issue, #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens

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

   ### 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
   
   A user reported in Slack that git extractor failed to clone repos when the GitHub data connection was created with GitHub's new fine-grained tokens. I was able to reproduce the issue on v0.14.2. See below for how to reproduce:
   
   1. Create a fine-grained token that has read access to a private repo's actions, discussions, issues, metadata, and pull requests.
   2. Create a GitHub connection with the fine-grained token
   3. Create a GitHub blueprint to collect that private repo's data
   4. See the pipeline created from that blueprint fails
   5. Create a new GitHub data connection with a classic PAT that has access to the private repo (with `repo` access)
   6. Create a GitHub blueprint for the private repo with the new classic PAT
   7. See the pipeline created from the 2nd blueprint succeeds
   
    
   <img width="840" alt="Screen Shot 2022-12-20 at 2 12 52 PM" src="https://user-images.githubusercontent.com/2908155/208836135-33d26981-fb18-4236-857f-3359e22b177a.png">
   <img width="2265" alt="Screen Shot 2022-12-20 at 2 05 09 PM" src="https://user-images.githubusercontent.com/2908155/208836150-8fe5631c-9d25-4b1e-9bbe-68ff942ec1c8.png">
   <img width="2263" alt="Screen Shot 2022-12-20 at 2 04 57 PM" src="https://user-images.githubusercontent.com/2908155/208836162-b2d729f2-00db-4a6d-a8ef-cca15a2bdb75.png">
   
   ## Cause
   
   It seems when using the fine-grained tokens, you have to prefix the token with `oauth2:`. See this [StackOverflow answer](https://stackoverflow.com/questions/74532852/github-clone-repo-with-fine-grained-personal-access-tokens-pat).
   
   
   ### What do you expect to happen
   
   I expect the pipeline execution to succeed.
   
   ### How to reproduce
   
   See above
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   v0.14.2
   
   ### Are you willing to submit PR?
   
   - [ ] 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: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] hezyin commented on issue #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens

Posted by GitBox <gi...@apache.org>.
hezyin commented on issue #3996:
URL: https://github.com/apache/incubator-devlake/issues/3996#issuecomment-1362577579

   @mindlesscloud Good catch! After I added `Content` permission to my fine-grained token, my git extractor task indeed succeeded without 403. So this is more of a documentation issue instead of a bug then. Do you think you could update docs regarding GitHub's fine-grained token to let users know what permission they need to give? 


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on issue #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on issue #3996:
URL: https://github.com/apache/incubator-devlake/issues/3996#issuecomment-1362582811

   @hezyin OK, I will update the docs to reflect this issue


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] Startrekzky closed issue #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens

Posted by GitBox <gi...@apache.org>.
Startrekzky closed issue #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens
URL: https://github.com/apache/incubator-devlake/issues/3996


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on issue #3996: [Bug][GitHub] Git extractor failed to clone repos with GitHub's new fine-grained tokens

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on issue #3996:
URL: https://github.com/apache/incubator-devlake/issues/3996#issuecomment-1361197010

   Besides actions, discussions, issues, metadata, and pull requests, the fine-grained token should have read access to **Content**. Without the read permission, a 403 error occurred when cloning a private repo.


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org