Add workflow-watch command#9224
Conversation
e724889 to
7054070
Compare
|
Nice! What about only listing failures by default, and having a "--all" option to list everything? |
|
(I think this is still blocked on #9226, no?) |
I actually had that and took it out to simplify things a bit. Happy to put it back though. |
No strong opinion, just my first thought when trying it out. |
This checks the status of the latest run of each scheduled workflow in the `cockpit-project` (or other specified) org. It has two modes: - `--post-to-board`: add failures as draft items to the pilot board - `--dry-run`: show what would be done Add also a workflow to run the script daily to make sure we have an overview of failures on the board.
7054070 to
7ee45b8
Compare
|
This created these: |
jelly
left a comment
There was a problem hiding this comment.
This requires new token permissions which is not documented(!)
| projects: write | ||
| steps: | ||
| - name: Clone repository | ||
| uses: actions/checkout@v5 |
|
|
||
| ISSUE_TITLE_PREFIX = "Scheduled workflow failing: " | ||
|
|
||
| # cockpit-project/projects/4 "Status" field |
There was a problem hiding this comment.
|
|
||
| for repo in repo_names: | ||
| print(f"{repo}:") | ||
| body = api.get_obj(f"repos/{args.org}/{repo}/actions/runs?event=schedule&per_page=100") |
There was a problem hiding this comment.
Do we really need 100 runs, surely only the last failing one is interesting?
There was a problem hiding this comment.
ALso event=schedule is an unofficial API? And maybe you want status=failure for filtering as well?
|
|
||
| project_id, existing_titles = get_project_items(api, args.org, args.project) | ||
|
|
||
| repos = api.get_objv(f"orgs/{args.org}/repos?per_page=100") |
There was a problem hiding this comment.
Please skip archived repositories like https://github.com/cockpit-project/term.js
This will make it easier to check for failing workflows. We can add the periodic running of this script to the list of pilot tasks.