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

Recursively delete from yaml #50

Merged
merged 5 commits into from
Oct 12, 2023
Merged

Conversation

ejseqera
Copy link
Member

@ejseqera ejseqera commented Oct 6, 2023

Adds support for a --delete flag where if supplied to twkit with YAML(s), will recursively delete all resources instead of create them. For example, if you create organization -> workspace -> team -> credentials -> compute-env -> pipeline. When supplying twkit file.yaml --delete, the tool will delete pipeline -> compute-env -> credentials -> team -> workspace -> organization.

Leverages existing functionality we had for deleting resources in overwrite.py, specifically the delete_resource() method called in handle_overwrite.

@ejseqera ejseqera added the enhancement New feature or request label Oct 6, 2023
@ejseqera ejseqera requested a review from adamrtalbot October 6, 2023 03:24
@ejseqera
Copy link
Member Author

ejseqera commented Oct 6, 2023

I still need to add tests :/

@@ -78,10 +78,10 @@ You will need to have an account on Nextflow Tower (see [Plans and pricing](http
twkit hello-world-config.yml
```

<b>Note</b>: The Tower CLI expects to connect to a Tower instance that is secured by a TLS certificate. If your Tower instance does not present a certificate, you will need to qualify and run your `tw` commands with the `--insecure` flag. For example:
<b>Note</b>: The Tower CLI expects to connect to a Tower instance that is secured by a TLS certificate. If your Tower instance does not present a certificate, you will need to qualify and run your `tw` commands with `--cli` followed by the `--insecure` flag. For example:
Copy link
Member Author

Choose a reason for hiding this comment

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

@adamrtalbot I think this is quite ugly to have to provide any additional tw cli options after --cli to twkit so it can parse these correctly to the _tw_run() method in the Tower() class and not confuse it with twkit specific arguments such as --delete and --dryrun but I am not sure how else to handle this. Any suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could quote after the --cli? So --cli '--insecure'. Not great. I'll have to think about this.

@ejseqera ejseqera merged commit 2851628 into dev Oct 12, 2023
2 checks passed
@ejseqera ejseqera deleted the 47-recursively-delete-from-yaml branch October 12, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants