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
Artifact support ? #2313
Comments
Github workflow runs produce downloadable artifacts, add a class to represent them.
Hi @lexa Thanks a lot for the prompt improvement, much appreciated. I have a few questions. To give you an idea of what is done, the script I would like to update is here: https://github.com/tsduck/tsduck/blob/master/.github/maintenance/purge-artifacts.py This script still uses the The required methods for the artifacts script are (with links to the API docs): Quickly browsing through the changes in your PR, I do not see the way to achieve this.
Thanks for your help. |
Github workflow runs produce downloadable artifacts, add a class to represent them.
Add a method to delete a stored artifact from Github Actions.
Implement calls for listing Github Actions artifacts linked to a repository. The test runs on an external repository because PyGithub doesn't have any artifacts in its CI.
Thanks @lelegard for checking out my PR.
added in the commit lexa@b07bdf3
added in the commit lexa@fc4e77f Unfortunately I can't test it, because I don't have any artifacts to delete. Could you please test if for me? To run the test you need to amend 36f7fef#diff-290729c59eb604d2187e1aa53a36ad692922094ca021239df18330436df52429R45 to set
It should pass. As the result of the run you will get a recording file
I think that is enought to have |
Hi @lexa I will have a look at the update.
Functionally, you are right. This was just a suggestion. In principle, it would match the REST API where there is a call on the repo, specifying the id of the artifact to delete. But you may consider that the class structure in PyGithub is designed to hide this functional approach. In practice, this is a way to simplify the code structure when you have to browse through all artifacts of a repo and delete some of them. There is a pitfall in the Github API about "paginated" lists. When you iterate page by page (say 100 items per page), reading the "next page" is not "starting after the last returned item", this is "page number 2", meaning "starting at item number 101". If you iterate on items without deleting or creating any, it does not make a difference. However, when you list all "items" (artifacts for instance), decide which should be deleted and delete them, then you have a problem. Let's take an example: in the first page (items 1 to 100), you decide to delete 10 of them. Then, moving to "next page" means "start at item 101, after the deletion, meaning that items which were numbered 101 to 110 before deletion are missed because they are now numbered 91 to 100. The problem is real, I ran into it with the REST API and with PyGithub So, in practice, you need a first pass where you read the items to delete, store their id in some list. Then, during a second pass, you delete the items by id. This is what my script does and now it always works at the first run. I also had the issue, initially, with this script which closes issues with a certain label (and then remove the label). Since the issues are browsed using This is a particularly nasty behaviour that I haven't seen documented anywhere, neither in the Github API doc nor in the PyGithub doc. Once you understand it, it makes sense. But it may take some time to understand it. If is perfectly possible to build and store a list of instances of However, this is just the rationale for my suggestion. We can live without it and feel free to ignore it if you do not like it. |
Hi @lexa, I have converted my purge-artifact script here. It works perfectly. Forget about the suggestion to provide a delete_artifact method by id in the Currently, I keep the two versions of the scripts, one using the REST API and one using your updated Thanks again @lexa for the update. |
No idea, but considering that the last activity on this repo was in december 2021 you shouldn't expect that it will ever reach the upstream. |
Too bad... Any idea on who is managing the project these days ? |
Github workflow runs produce downloadable artifacts, add a class to represent them.
Add a method to delete a stored artifact from Github Actions.
Implement calls for listing Github Actions artifacts linked to a repository. The test runs on an external repository because PyGithub doesn't have any artifacts in its CI.
Github workflow runs produce downloadable artifacts, add a class to represent them.
Add a method to delete a stored artifact from Github Actions.
Implement calls for listing Github Actions artifacts linked to a repository. The test runs on an external repository because PyGithub doesn't have any artifacts in its CI.
Github workflow runs produce downloadable artifacts, add a class to represent them.
Add a method to delete a stored artifact from Github Actions.
Implement calls for listing Github Actions artifacts linked to a repository. The test runs on an external repository because PyGithub doesn't have any artifacts in its CI.
Github workflow runs produce downloadable artifacts, add a class to represent them.
Add a method to delete a stored artifact from Github Actions.
Implement calls for listing Github Actions artifacts linked to a repository. The test runs on an external repository because PyGithub doesn't have any artifacts in its CI.
I noticed that the WorkflowRun.pyi file is still missing the description of |
Hello,
Is there any support for artifacts? Meaning request
/repos/{owner}/{repo}/actions/artifacts
. I could not find anything and I would like to rewrite an existing script which purges artifacts using modulerequests
into one using modulegithub
.The text was updated successfully, but these errors were encountered: