-
Notifications
You must be signed in to change notification settings - Fork 7
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
1st_version of the github_auto_add #235
base: main
Are you sure you want to change the base?
Conversation
I changed it according to auto-add-zenodo-entry.py, in theory it should work, I can't test it locally. So there is a problem, for example, when I give it this URL 'https://github.com/guiwitz/Python_image_processing', which should be the name 'Python_image_processing' or 'Image processing with Python'. |
Why can I not write this link like you did "
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SeverusYixin ,
awesome, thanks for this! Two things:
- Before sending a PR, please check if the tool works as you describe it in the documentation.
- I just tested it and received an error message. That's the command I ran:
python scripts/auto-add-github-resources.py nfdi4bioimage/training 236
And that's the error:
-> get_conversation_on_issue(nfdi4bioimage/training, 236)
Request GET /repos/rmassei/ymia_python_event_series_material/collaborators?per_page=1 failed with 403: Forbidden
Traceback (most recent call last):
File "C:\structure\code\training\scripts\auto-add-github-resources.py", line 139, in <module>
main()
File "C:\structure\code\training\scripts\auto-add-github-resources.py", line 34, in main
github_data_dict = complete_github_data(github_repo_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\structure\code\training\scripts\auto-add-github-resources.py", line 97, in complete_github_data
if collaborators.totalCount > 0:
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\PaginatedList.py", line 192, in totalCount
headers, data = self.__requester.requestJsonAndCheck(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\Requester.py", line 550, in requestJsonAndCheck
return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\Requester.py", line 715, in requestJson
return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\Requester.py", line 812, in __requestEncode
status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\Requester.py", line 846, in __requestRaw
response = cnx.getresponse()
^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\Requester.py", line 198, in getresponse
r = verb(
^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\requests\sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\urllib3\connectionpool.py", line 934, in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\miniforge3\envs\devbio-napari-env\Lib\site-packages\github\GithubRetry.py", line 187, in increment
raise Requester.createException(response.status, response.headers, content) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
github.GithubException.GithubException: 403 {"message": "Must have push access to view repository collaborators.", "documentation_url": "https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators", "status": "403"}
Let me know if I should try again!
And thanks again for working on this. This will be cool to have!
Best,
Robert
The problem is that I can not test it, it told me the scads.ai clould refuse me XD |
What is "scads.ai clould" in this context? What was the exact error message? |
I have found another way to test. The "scads.ai cloud" problem is if I use my own github to test, I think my own github can not edit the thing on our repositories, e.g. create a PR. |
The error above is not about our repository:
The error happens when accessing the other repository. I'd say we will not be able to read out collaborators from remote repositories. |
Yes, I used the code snippet to check locally that the link to our repository is no problem, it show me as PS C:\Users\huang\Documents\GitHub\training\scripts> & 'c:\Users\huang\AppData\Local\Programs\ Python\Python312\python. exe' 'c:\Users\huang.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\adapter/ ... /... \debugpy\launcher' "51870" "--" "C:\Users\huang\Documents\GitHub\training\scripts\test.py" I'm trying to see if this can be avoided, but nothing I've seen so far seems to work! Or maybe not with github token, I'm not sure |
Yes, it is possible that this will not work. Do you have an overview about which meta data we can access and which not? |
At the moment, it looks like the request will be denied when you try to access it with github token. |
Can you please try "repo.get_contributors()" instead of "repo.get_collaborators()"? |
Let me try |
Did it work? |
no |
Please do not merge. There are still some details to discuss :)
|
I would use whatever the github returns as
If there are no tags, we should not have a "tag:" in our yaml. |
Consider posting an error message, in case you wish that I assist you. |
Already solved, thank you if I need that I will post a error message. Thank you again :) |
4cbfbbb
to
6e41ca0
Compare
This reverts commit 6e41ca0.
…IOIMAGE/training into auto_add_github_resources
Are there any news here @SeverusYixin ? Shall I test it agian? |
Seems like you didn't see issues #185. I asked you how should we define the type and tag for a github repositorie. Except for type and day, all other functions are implemented. |
write something for the tags like "Dear users, please add tags" |
And never have empty strings like tags:"" |
Co-authored-by: Robert Haase <[email protected]>
Hi @haesleinhuepf, please review again, if everything is ok then we can close and merge this. Thank you :) |
Hi @haesleinhuepf, would you mind helping me review it?
This PR relates to #185 #246
This PR closes #185 #246