Skip to content

Add workflow-watch command#9224

Open
allisonkarlitskaya wants to merge 1 commit into
mainfrom
workflow-watch
Open

Add workflow-watch command#9224
allisonkarlitskaya wants to merge 1 commit into
mainfrom
workflow-watch

Conversation

@allisonkarlitskaya

@allisonkarlitskaya allisonkarlitskaya commented Jun 24, 2026

Copy link
Copy Markdown
Member

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.

Comment thread lib/github.py Dismissed
@mvollmer

Copy link
Copy Markdown
Member

Nice! What about only listing failures by default, and having a "--all" option to list everything?

@mvollmer

Copy link
Copy Markdown
Member

(I think this is still blocked on #9226, no?)

@allisonkarlitskaya

Copy link
Copy Markdown
Member Author

Nice! What about only listing failures by default, and having a "--all" option to list everything?

I actually had that and took it out to simplify things a bit. Happy to put it back though.

@mvollmer

Copy link
Copy Markdown
Member

Nice! What about only listing failures by default, and having a "--all" option to list everything?

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.

mvollmer
mvollmer previously approved these changes Jun 26, 2026
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.
@allisonkarlitskaya

Copy link
Copy Markdown
Member Author

This created these:

@jelly jelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires new token permissions which is not documented(!)

projects: write
steps:
- name: Clone repository
uses: actions/checkout@v5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its v7 now.

Comment thread workflow-watch

ISSUE_TITLE_PREFIX = "Scheduled workflow failing: "

# cockpit-project/projects/4 "Status" field

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread workflow-watch

for repo in repo_names:
print(f"{repo}:")
body = api.get_obj(f"repos/{args.org}/{repo}/actions/runs?event=schedule&per_page=100")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need 100 runs, surely only the last failing one is interesting?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALso event=schedule is an unofficial API? And maybe you want status=failure for filtering as well?

Comment thread workflow-watch

project_id, existing_titles = get_project_items(api, args.org, args.project)

repos = api.get_objv(f"orgs/{args.org}/repos?per_page=100")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please skip archived repositories like https://github.com/cockpit-project/term.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants