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

Bash CI CI-KILL label added #2358

Conversation

TerrenceMcGuinness-NOAA
Copy link
Collaborator

@TerrenceMcGuinness-NOAA TerrenceMcGuinness-NOAA commented Feb 29, 2024

Description

This PR adds a kill label CI-Kill that will cancel all pending jobs and builds of a bash CI that has all ready proceeded passed the Ready state.

Previously one could only "reset" a CI Bash run but a typical use case is the user wants to stop/kill a CI test and restart it later. Just add the CI-Kill label to any CI job in progress.

  • CI checks to see if any Bash CI is passed Ready (if it still just Ready simply remove it)
  • If the CI state is Building or Running it will quit the build and/or cancel all pending scheduled jobs
  • Completely deletes the PR directory
  • Removes the Kill and all other CI labels
  • Reports actions in comments to user in PR

Resolves #2067

Type of change

  • New feature (adds functionality)
  • Maintenance (adds CI functionality)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO

How has this been tested?

Ran Bash CI in development space and CI-KILL'ed several runs at different stages

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • I have made corresponding changes to the documentation if necessary

Copy link
Contributor

@WalterKolczynski-NOAA WalterKolczynski-NOAA left a comment

Choose a reason for hiding this comment

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

What happens if one PR is marked ready and another is marked kill in the same polling interval? If I'm understanding this code, the kill label would be ignored until the next poll.

Additionally, if you remove the kill label you create a race condition among all CI platforms and only one will see it. Not an issue if we're only using bash on one platform (as Orion right now, or WCOSS in the future), but a problem if there are multiple.

I'm also not sure about interweaving the kill functionality throughout the code that kicks off PRs. It violates the single responsibility principle. Can the kill be in a separate script (or at least separate function)? If there are places where the two share code, those pieces can be abstracted out to functions that both call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Issue related to CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Kill Switch (Label) to CI
2 participants