Skip to content

command to delete backends#73

Merged
jirkasemmler merged 5 commits into
mainfrom
jirka/command-to-delete-backends
Jun 3, 2026
Merged

command to delete backends#73
jirkasemmler merged 5 commits into
mainfrom
jirka/command-to-delete-backends

Conversation

@jirkasemmler

@jirkasemmler jirkasemmler commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Changes:

  • add new command to delete backends by batch

Additional notes

⚠️ Don't forget to release new version after merge

just command to delete backends due https://keboola.atlassian.net/browse/CT-2079

@jirkasemmler jirkasemmler force-pushed the jirka/command-to-delete-backends branch from 0d73e49 to 41f8bc3 Compare July 29, 2025 13:35
@jirkasemmler

Copy link
Copy Markdown
Contributor Author

@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

@romanbracinik

Copy link
Copy Markdown

@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 romanbracinik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

davam len komentar ak to nebudes mergovat, nech mi to nesvieti na review dik

@jirkasemmler jirkasemmler force-pushed the jirka/command-to-delete-backends branch from c97d634 to ef9136e Compare June 2, 2026 12:23
jirkasemmler and others added 2 commits June 2, 2026 14:28
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-backend command 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()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — added : void to configure() to match the rest of the codebase. Fixed in aeb1aaf.

Comment on lines +43 to +47
foreach (explode(',', $ids) as $id) {
if (!array_key_exists($id, $allBackendsAssociative)) {
$output->writeln(sprintf('Backend with ID "%s" does not exist, skipping...', $id));
continue;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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>
@jirkasemmler

Copy link
Copy Markdown
Contributor Author

@romanbracinik zase to potrebuju, tak bych to asi rovnou dostal do masteru. pls review

@jirkasemmler jirkasemmler merged commit a1c420e into main Jun 3, 2026
1 check passed
@jirkasemmler jirkasemmler deleted the jirka/command-to-delete-backends branch June 3, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants