Skip to content

Conversation

@summerguo-protectai
Copy link

@summerguo-protectai summerguo-protectai commented Apr 1, 2025

Implement the ability to add status into the filter for get workflow runs. The purpose is to be able to alert on github action failures through Grafana.
This change is NOT tested.

@summerguo-protectai summerguo-protectai requested a review from a team as a code owner April 1, 2025 00:56
@CLAassistant
Copy link

CLAassistant commented Apr 1, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@itsmylife itsmylife left a comment

Choose a reason for hiding this comment

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

@summerguo-protectai Thanks for the contribution. Could you please resolve the conflicts?

Copy link
Contributor

@itsmylife itsmylife left a comment

Choose a reason for hiding this comment

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

There are some issues in the code.
I commented one of them and the other is in models/client.go
GetWorkflowRuns's signature must be

GetWorkflowRuns(ctx context.Context, owner, repo, workflow string, branch string, status string, timeRange backend.TimeRange) ([]*googlegithub.WorkflowRun, error)

var workflowRuns []*googlegithub.WorkflowRun
var err error
workflowRuns, page, err = client.getWorkflowRuns(ctx, owner, repo, workflow, "", timeRange, page)
workflowRuns, page, err = client.getWorkflowRuns(ctx, owner, repo, workflow, "", timeRange, page, runStatusCompleted)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
workflowRuns, page, err = client.getWorkflowRuns(ctx, owner, repo, workflow, "", timeRange, page, runStatusCompleted)
workflowRuns, page, err = client.getWorkflowRuns(ctx, owner, repo, workflow, "", runStatusCompleted, timeRange, page)

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants