Skip to content
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

Prevent scheduled workflow from being automatically disabled #112

Open
joverlee521 opened this issue Sep 10, 2024 · 11 comments
Open

Prevent scheduled workflow from being automatically disabled #112

joverlee521 opened this issue Sep 10, 2024 · 11 comments

Comments

@joverlee521
Copy link
Contributor

joverlee521 commented Sep 10, 2024

Context

The GitHub workflow docs state:

In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days.

List of affected workflows

Possible solution

  1. Keep manually re-enabling affected workflows as they are noticed to be disabled
  2. Use the Keepalive Workflow action on affected workflows
  3. Create our own workflow that runs some activity as the Nextstrain bot. I'm not entirely sure what counts as "repository activity" but a couple options:
    • Push dummy commit to main
    • Push dummy commit to a long term "keep-alive" branch
    • Create and delete a new branch
    • Create and close a new issue
    • Other ideas?
  4. Make a central keep-alive workflow that uses the GitHub REST API to disable/enable affected workflows every <60 days
  5. ⛔️ Use Terraform run regularly to control this. The official GitHub provider for Terraform doesn't expose the endpoint we need.
@joverlee521
Copy link
Contributor Author

Manually re-enabled the workflow for now and it will run as scheduled in ~5mins

@tsibley
Copy link
Member

tsibley commented Sep 27, 2024

Similarly, I just re-enabled the dengue ingest-to-phylo workflow which got disabled due to repo inactivity.

@tsibley
Copy link
Member

tsibley commented Sep 27, 2024

Maybe also worth pointing out that I noticed the dengue workflow being disabled thanks to the status page's time-relative layout.

image

@genehack
Copy link
Contributor

Any objection to adding a keepalive step to these workflows to avoid this?

@victorlin
Copy link
Member

^ that was one of the proposed solutions in nextstrain/project-board#5. I've copied all the relevant parts of that issue's description into this issue's descrpition.

@victorlin
Copy link
Member

victorlin commented Oct 14, 2024

We should find a solution that doesn't require modifications to individual workflow files. Ideally, there would be an org-wide setting provided by GitHub to customize the amount of days of inactivity before automatic disabling. I wouldn't be surprised if they provide that in the future, at which point we would have to go back and undo modifications to individual workflows if we were to use something like gautamkrishnar/keepalive-workflow.

I think there is a solution that uses the GitHub REST API for enabling/disabling workflows. There can be a central workflow (e.g. nextstrain/.github/.github/workflows/keep-alive.yml) that has a list of scheduled workflows we want to keep alive and will periodically invoke the REST API to disable/enable each workflow. I imagine this list will also change over time, so having this central list will make this easier. Of course, we may still run into the issue of that central workflow being disabled, but in that case it makes sense to use gautamkrishnar/keepalive-workflow for just the one workflow.

@joverlee521
Copy link
Contributor Author

@victorlin I like the idea of a central workflow! Looks like gautamkrishnar/keepalive-workflow@v2 started using the GitHub API to enable workflows under the hood. Maybe we can just use gautamkrishnar/keepalive-workflow@v2 in a single action matrix to keep multiple repo workflows enabled?

@tsibley
Copy link
Member

tsibley commented Oct 14, 2024

I would avoid third-party code here. It feels like a risk that's not worth it.

I like Victor's idea of centralizing control over this rather than modifying each workflow.

A previous thought I'd had here, though it seems like I didn't express it, was to use Terraform run regularly to control this. (Although the official GitHub provider for Terraform doesn't expose the endpoint we need.)

@victorlin
Copy link
Member

The API seems simple enough that we can call it directly and not through third-party code.

If folks are on board with the proposed approach (option 4), I'll move this issue to nextstrain/.github and make a PR there.

@genehack
Copy link
Contributor

I'm mostly implementation-agnostic and generally agree a self-owned central workflow is probably better — the best overall solution is the one that will allow the issue to be closed 😉

@joverlee521 joverlee521 transferred this issue from nextstrain/status Oct 29, 2024
@victorlin
Copy link
Member

Thanks for transferring @joverlee521, I dropped the ball on this one. Probably not going to do this over the next few weeks so if anyone wants to take it, feel free.

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

No branches or pull requests

4 participants