-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add dispatchable workflow for deleting test model runs #60
Merged
Merged
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a35baca
Add delete-model-runs workflow
jeancochrane c5c2404
Temporarily run a readonly version of the delete-model-runs workflow…
jeancochrane 3f0b8c1
Install libgit2-dev for git2r in delete-model-runs.yaml
jeancochrane d70deea
Fix R styler error in delete_current_year_model_runs.R
jeancochrane 26c61bb
Clean up docstrings and test against 2023-11-14-frosty-jacob model
jeancochrane 3297673
Satisfy pre-commit
jeancochrane 51843f3
Revert to workflow_dispatch event trigger for delete-model-runs.yaml
jeancochrane 49ea1a6
Revert "Revert to workflow_dispatch event trigger for delete-model-ru…
jeancochrane 85bfcf8
Fix typo in Delete model runs step of delete-model-runs workflow
jeancochrane 61b9352
Test obviously bogus value for run-ids to delete-model-runs workflow
jeancochrane a3a28fa
Raise an error in delete_current_year_model_runs.R if no objects were…
jeancochrane 5c9ddf6
Disable renv sandbox to speed up install/run times
jeancochrane a090cc1
Run delete_current_year_model_runs.R on all run IDs at once
jeancochrane c624b0b
Check for validity of run IDs before issuing delete operations in del…
jeancochrane 17fcf90
Refactor run ID validity check in delete_current_year_model_runs to b…
jeancochrane b6e695d
Try deleting multiple invalid run IDs
jeancochrane 0e56190
Refactor delete_current_year_model_runs.R to accept a comma-delimited…
jeancochrane cf4ff3c
Test a delete-model-runs workflow where one run is valid and one isn't
jeancochrane e23d34c
Test a delete-model-runs workflow where all run IDs are valid
jeancochrane 6cdb449
Revert to workflow_dispatch trigger for delete-model-runs.yaml
jeancochrane b02de7d
Remove extraneous print statement from delete_current_year_model_runs.R
jeancochrane a4895c2
Clean up delete-model-runs and associated script in response to review
jeancochrane 09cfa5b
Temporarily run delete-model-runs on pull_request event for testing
jeancochrane 759550d
Revert "Temporarily run delete-model-runs on pull_request event for t…
jeancochrane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,13 @@ on: | |
inputs: | ||
run-ids: | ||
description: > | ||
Comma-delimited list of IDs of model runs to delete (no spaces). Note | ||
Run IDs: Space-delimited list of IDs of model runs to delete. Note | ||
that the workflow assumes these IDs correspond to model runs for the | ||
current upcoming assessment cycle, and if that's not the case the | ||
deletion script will raise an error. | ||
current assessment cycle, and if that's not the case the deletion | ||
script will raise an error. | ||
required: true | ||
type: string | ||
default: 2024-01-01-foo-bar 2024-01-02-bar-baz | ||
|
||
jobs: | ||
delete-model-runs: | ||
|
@@ -52,7 +53,7 @@ jobs: | |
aws-region: us-east-1 | ||
|
||
- name: Delete model runs | ||
run: Rscript ./R/delete_current_year_model_runs.R "$RUN_IDS" | ||
run: Rscript ./R/delete_current_year_model_runs.R "${RUN_IDS// /,}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: Good thinking! |
||
shell: bash | ||
env: | ||
RUN_IDS: ${{ inputs.run-ids }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: IMO it'd be really helpful here to have a default input showing an example (nonexistent) run ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, done in a4895c2! Note that the trade-off here is that default arguments are populated as actual values in the workflow input form, rather than placeholder text, so there's a chance of a caller misinterpreting the form and submitting it with the (fake) default values. This should just raise an error and not actually delete any data, however, so the risk is worth it in my view.