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

[Bug]: How to delete or rename after singularity prep create #292

Closed
distora-w3 opened this issue Sep 11, 2023 · 3 comments · Fixed by #309
Closed

[Bug]: How to delete or rename after singularity prep create #292

distora-w3 opened this issue Sep 11, 2023 · 3 comments · Fixed by #309
Assignees
Labels
bug Something isn't working

Comments

@distora-w3
Copy link

distora-w3 commented Sep 11, 2023

Description

Accidentally created a "prep" with default name
- how to delete?
- how to rename?

Steps to Reproduce

Use prep and forget to use --name

singularity prep create 2023nameofdataset

singularity prep list
ID  Name            DeleteAfterExport  MaxSize      PieceSize
1   gifted_catalog  false              33822867456  34359738368

The only options available seem to be

   Preparation Management:
     create         Create a new preparation
     list           List all preparations
     attach-source  Attach a source storage to a preparation
     attach-output  Attach a output storage to a preparation
     detach-output  Detach a output storage to a preparation
     explore        Explore prepared source by path

Version

singularity v0.4.0-36ecfc5

Operating System

Linux

Database Backend

SQLite

Additional context

No response

@distora-w3 distora-w3 added bug Something isn't working triage labels Sep 11, 2023
@xinaxu
Copy link
Contributor

xinaxu commented Sep 13, 2023

Deletion is a less common use case so it may come in the future. In fact different people has different expectation for deletion, i.e. a shallow deletion, delete with all metadata, delete with all metadata tracking, delete with all exported car files, etc. I'm going to leave such complexity to future.

Renaming is, however, very easy to add

@xinaxu xinaxu removed the triage label Sep 13, 2023
@github-project-automation github-project-automation bot moved this to 🍇 Backlog in ActionArena Sep 13, 2023
@xinaxu xinaxu moved this from 🍇 Backlog to 👨‍💻 In Progress in ActionArena Sep 13, 2023
@xinaxu
Copy link
Contributor

xinaxu commented Sep 13, 2023

Proposing below

singularity storage rename old new
singularity prep rename old new

@distora-w3
Copy link
Author

That works!

xinaxu added a commit that referenced this issue Sep 14, 2023
This adds support for belwo commands
```
singularity prep rename old new
singularity storage rename old new
```

Also updated `CONTRIBUTING.md` for how to do this correctly as listed
below

resolves #292 

- [x] Create a handler implementation under `handler/*` directory
- [x] Make proper godoc comments for the implementation
- [x] Add the handler function to the interface under
`handler/*/interface.go`
- [x] Update the MockHandler under `handler/*/interface.go`
- [x] Create unit tests for this handler implementation
- [x] Create a function to document the swagger API `func _(){}`
- [x] Create corresponding API route handler in `api/api.go`
- [x] Create a CLI command under `cmd/*` directory
- [x] Update `cmd/app.go` to register the new command
- [x] Add the CLI command unit test in one of `cmd/*_test.go`
- [ ] Optionally add CLI command integration tests in
`cmd/functional_test.go`
- [x] Run `make generate` or `go generate ./...`
- [x] Add the swagger API unit test in `api/api_test.go`
- [ ] Optionally add swagger API integration tests in `cmd/api_test.go`
@github-project-automation github-project-automation bot moved this from 👨‍💻 In Progress to 🚢 Done in ActionArena Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🚢 Done
Development

Successfully merging a pull request may close this issue.

2 participants