Open SeverusYixin opened 4 days ago
Can you give us some advice on the code: "# Install dependencies
and
" # Install dependencies
which is the better version of the V2 and the V4?
git-bob comment
This message was generated by git-bob (version: 0.9.1, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
To update to version 4, change the Python setup lines in each of the relevant files as follows:
.github/workflows/auto-add-download-statistics.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
.github/workflows/auto-add-zenodo-entries.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
.github/workflows/git-bob.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
It doesn't seem very smart, or am I using it the wrong way? But still interesting XD
I may not know "which is the better version of the V2 and the V4?" And how do you define "better"? Also you should write more well-written sentences to ask what it should do.
git-bob comment on these aspect:
This message was generated by git-bob (version: 0.9.1, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
To address the issue of updating the Python version in the GitHub Actions workflows, you can replace actions/setup-python@ v2
with actions/setup-python@ v4
in the specified files. Here's a proposal for the updated code in each file:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
Answers to Questions:
What does actions/setup-python@ v4 in a GitHub workflow do?
Do you know what makes it different compared to actions/setup-python@ v2?
Which version is newer, V2 or V4?
These answers seem reasonable to me @SeverusYixin . I should maybe update git-bob to not answer stuff that has been answered before already.
These answers seem reasonable to me @SeverusYixin . I should maybe update git-bob to not answer stuff that has been answered before already.
So, should I update the relevant code ?
It was already done. Let's test see if it works:
git-bob comment on:
This message was generated by git-bob (version: 0.9.2, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
I'm unable to review or analyze the Python scripts in the scripts
folder as per the request. Could you please tag @haesleinhuepf for insight on the specific functionalities and potential reorganization strategies for these scripts?
hmm, but it was still "uses: actions/setup-python@v2" in the script
Ah sure. Go ahead. Thanks for working on this!
in the code of
training/.github/workflows/auto-add-download-statistics.yml
Line 15 in 2f3578e
training/.github/workflows/auto-add-zenodo-entries.yml
Line 21 in 2f3578e
uses: actions/setup-python@v2 and here
training/.github/workflows/git-bob.yml
Line 36 in 2f3578e
uses: actions/setup-python@v2 all of these are "actions/setup-python@v2". They all still use "actions/setup-python@v2", update them to "uses: actions/setup-python@v4" with code comments.
git-bob implement this!
This message was generated by git-bob (version: 0.9.2, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
Error creating pull-request: 422 {"message": "Validation Failed", "errors": [{"resource": "PullRequest", "code": "custom", "message": "No commits between main and git-bob-mod-zVOu3IeRXD"}], "documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request", "status": "422"}
During solving this task, the following errors occurred:
Error processing .github/workflows/auto-add-download-statistics.yml: Modifying workflow files is not allowed.
Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 476, in solve_github_issue message = filename + ":" + create_or_modify_file(repository, issue, filename, branch_name, discussion, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 373, in create_or_modify_file write_file_in_branch(repository, branch_name, filename, new_content + "\n", redact_text(commit_message)) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_github_utilities.py", line 355, in write_file_in_branch repo.update_file(file.path, commit_message, new_content, file.sha, branch=branch_name) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Repository.py", line 2541, in update_file headers, data = self._requester.requestJsonAndCheck( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 550, in requestJsonAndCheck return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 715, in requestJson return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 812, in __requestEncode status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 846, in __requestRaw response = cnx.getresponse() ^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 198, in getresponse r = verb( ^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 649, in put return self.request("PUT", url, data=data, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/urllib3/connectionpool.py", line 868, in urlopen retries = retries.increment(method, url, response=response, _pool=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/GithubRetry.py", line 187, in increment raise Requester.createException(response.status, response.headers, content) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ github.GithubException.GithubException: 403 {"message": "refusing to allow a GitHub App to create or update workflow `.github/workflows/auto-add-download-statistics.yml` without `workflows` permission", "documentation_url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents", "status": "403"}
Error processing .github/workflows/auto-add-zenodo-entries.yml: Modifying workflow files is not allowed.
Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 476, in solve_github_issue message = filename + ":" + create_or_modify_file(repository, issue, filename, branch_name, discussion, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 373, in create_or_modify_file write_file_in_branch(repository, branch_name, filename, new_content + "\n", redact_text(commit_message)) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_github_utilities.py", line 355, in write_file_in_branch repo.update_file(file.path, commit_message, new_content, file.sha, branch=branch_name) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Repository.py", line 2541, in update_file headers, data = self._requester.requestJsonAndCheck( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 550, in requestJsonAndCheck return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 715, in requestJson return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 812, in __requestEncode status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 846, in __requestRaw response = cnx.getresponse() ^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 198, in getresponse r = verb( ^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 649, in put return self.request("PUT", url, data=data, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/urllib3/connectionpool.py", line 868, in urlopen retries = retries.increment(method, url, response=response, _pool=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/GithubRetry.py", line 187, in increment raise Requester.createException(response.status, response.headers, content) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ github.GithubException.GithubException: 403 {"message": "refusing to allow a GitHub App to create or update workflow `.github/workflows/auto-add-zenodo-entries.yml` without `workflows` permission", "documentation_url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents", "status": "403"}
Error processing .github/workflows/git-bob.yml: Modifying workflow files is not allowed.
Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 476, in solve_github_issue message = filename + ":" + create_or_modify_file(repository, issue, filename, branch_name, discussion, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_ai_github_utilities.py", line 373, in create_or_modify_file write_file_in_branch(repository, branch_name, filename, new_content + "\n", redact_text(commit_message)) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/git_bob/_github_utilities.py", line 355, in write_file_in_branch repo.update_file(file.path, commit_message, new_content, file.sha, branch=branch_name) File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Repository.py", line 2541, in update_file headers, data = self._requester.requestJsonAndCheck( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 550, in requestJsonAndCheck return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 715, in requestJson return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 812, in __requestEncode status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 846, in __requestRaw response = cnx.getresponse() ^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/Requester.py", line 198, in getresponse r = verb( ^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 649, in put return self.request("PUT", url, data=data, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/urllib3/connectionpool.py", line 868, in urlopen retries = retries.increment(method, url, response=response, _pool=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/github/GithubRetry.py", line 187, in increment raise Requester.createException(response.status, response.headers, content) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ github.GithubException.GithubException: 403 {"message": "refusing to allow a GitHub App to create or update workflow `.github/workflows/git-bob.yml` without `workflows` permission", "documentation_url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents", "status": "403"}
As git-bob is a github workflow, it is not allowed to modify github-workflows
As git-bob is a github workflow, it is not allowed to modify github-workflows
Hmmm, question, perhaps a little rude, are you git-bob or Robert XD, how can you answer so quickly when everytime I try git-bob. XDD
Also, again, your task description is not easy to read @SeverusYixin . Try to use clear english sentences. "In file xyz.py, update V2 to V4" and git-bob will be able help you.
Ahhh, I got it, I will try it next time haha
Hi @haesleinhuepf,
seems to be the python version setting (@v2) in https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/auto-add-download-statistics.yml#L15
and here https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/auto-add-zenodo-entries.yml#L21
and here https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/git-bob.yml#L36
all of these are "actions/setup-python@v2", should i update all of them to "actions/setup-python@v4"?
Because currently the git run as 0s Run actions/setup-python@v2 Successfully setup CPython (3.12.7)
Best, Yixin