command to delete backends#73
Conversation
0d73e49 to
41f8bc3
Compare
|
@romanbracinik asi to ani nechci mergovat, jen chci tvoje druhy oci, ze toto mazani backendu pro https://keboola.atlassian.net/browse/CT-2079 je v poradku |
@jirkasemmler pride mi to funkcne. Ked to nebudes mergovat tak cajk :) |
romanbracinik
left a comment
There was a problem hiding this comment.
davam len komentar ak to nebudes mergovat, nech mi to nesvieti na review dik
# Conflicts: # cli.php
c97d634 to
ef9136e
Compare
Add README section for the DeleteStorageBackend command and correct the copy-pasted command description and misleading argument help texts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add int return type and cast mixed input arguments so the command passes phpstan level 9. Also only print the DANGER warning in force mode. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Symfony Console command to delete storage backends from a stack (with dry-run default), and documents/registers it in the CLI entrypoint.
Changes:
- Introduces
manage:delete-backendcommand to list and (optionally) remove storage backends by ID. - Registers the new command in
cli.php. - Documents usage and behavior in
README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Keboola/Console/Command/DeleteStorageBackend.php |
New CLI command implementation for deleting storage backends (dry-run by default). |
cli.php |
Registers the new DeleteStorageBackend command in the application. |
README.md |
Adds a new section describing how to use manage:delete-backend. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| class DeleteStorageBackend extends Command | ||
| { | ||
| protected function configure() |
There was a problem hiding this comment.
Good catch — added : void to configure() to match the rest of the codebase. Fixed in aeb1aaf.
| foreach (explode(',', $ids) as $id) { | ||
| if (!array_key_exists($id, $allBackendsAssociative)) { | ||
| $output->writeln(sprintf('Backend with ID "%s" does not exist, skipping...', $id)); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Fixed in aeb1aaf. IDs are now trimmed and filtered with array_filter(array_map('trim', explode(',', $ids)), 'is_numeric') before processing, consistent with ProjectsRemoveFeature / DeletedProjectsPurge.
| $ids = $input->getArgument('ids'); | ||
| assert(is_string($ids)); | ||
| $force = (bool) $input->getOption('force'); | ||
| $output->writeln($force ? 'DANGER: Using force mode! Backend will be removed.' : 'DRY RUN'); |
There was a problem hiding this comment.
Leaving the banner wording as-is for this PR. The dry-run path already prints a clear DRY RUN banner and the force path is intentionally loud (DANGER: Using force mode!), so the destructive intent is explicit. Happy to revisit if we standardize the wording across commands.
- Declare configure(): void to match the rest of the codebase. - Trim and filter backend IDs with is_numeric before processing so that whitespace and empty entries (e.g. "123, 456,") no longer skip valid backends. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@romanbracinik zase to potrebuju, tak bych to asi rovnou dostal do masteru. pls review |
Changes:
Additional notes
just command to delete backends due https://keboola.atlassian.net/browse/CT-2079