api.repos.create_fork not finding repo but curl command working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the call in scripts/e2e/main.py and trace it through ghapi/core.py and fastcore/net.py, comparing the generated request with the working curl request to the GitHub forks endpoint. Done means identifying why the two requests differ and documenting or correcting the behavior so the Python call succeeds for this repository.
Written by the indexing model from the issue text.
Description
I ran api.repos.create_fork(owner="WebGoat", repo="WebGoat"), and got an error:
Traceback (most recent call last):
File "/Users/iulspop/Development/github-app/scripts/e2e/main.py", line 15, in <module>
api.repos.create_fork(owner="WebGoat", repo="WebGoat")
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ghapi/core.py", line 61, in __call__
return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ghapi/core.py", line 120, in __call__
res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=debug, return_headers=True,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastcore/net.py", line 218, in urlsend
return urlread(req, return_json=return_json, return_headers=return_headers)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastcore/net.py", line 119, in urlread
if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp, msg=e.msg) from None
fastcore.net.HTTP404NotFoundError: HTTP Error 404: Not Found
====Error Body====
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-fork"
}
But when I run the curl command directly:
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer X" \
https://api.github.com/repos/WebGoat/WebGoat/forks
It just works.
Any ideas why the ghapi isn't working here?
- Dominant language
- Python
- Stars
- 687
- Forks
- 69
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AnswerDotAI/ghapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AnswerDotAI/ghapi#158 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AnswerDotAI/ghapi#120 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
AnswerDotAI/ghapi#208 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
AnswerDotAI/ghapi#201 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
AnswerDotAI/ghapi#186 ·
All issues in AnswerDotAI/ghapi
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100