Skip to content

[FrameworkBundle]  terminate with non-zero exit code when a secret could not be read #57797

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

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE-7.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Read more about this in the [Symfony documentation](https://symfony.com/doc/7.2/

If you're upgrading from a version below 7.1, follow the [7.1 upgrade guide](UPGRADE-7.1.md) first.

FrameworkBundle
---------------

* [BC BREAK] The `secrets:decrypt-to-local` command terminates with a non-zero exit code when a secret could not be read

Security
--------

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CHANGELOG
* Derivate `kernel.secret` from the decryption secret when its env var is not defined
* Make the `config/` directory optional in `MicroKernelTrait`, add support for service arguments in the
invokable Kernel class, and register `FrameworkBundle` by default when the `bundles.php` file is missing
* Add `exit` option for `secrets:decrypt-to-local` command
* [BC BREAK] The `secrets:decrypt-to-local` command terminates with a non-zero exit code when a secret could not be read

7.1
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function __construct(
protected function configure(): void
{
$this
->addOption('exit', null, InputOption::VALUE_NONE, 'Returns a non-zero exit code if any errors are encountered')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force overriding of secrets that already exist in the local vault')
->setHelp(<<<'EOF'
The <info>%command.name%</info> command decrypts all secrets and copies them in the local vault.
Expand All @@ -48,10 +47,6 @@ protected function configure(): void
When the <info>--force</info> option is provided, secrets that already exist in the local vault are overridden.

<info>%command.full_name% --force</info>

When the <info>--exit</info> option is provided, the command will return a non-zero exit code if any errors are encountered.

<info>%command.full_name% --exit</info>
EOF
)
;
Expand Down Expand Up @@ -100,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$io->note($this->localVault->getLastMessage());
}

if ($hadErrors && $input->getOption('exit')) {
if ($hadErrors) {
return 1;
}

Expand Down
Loading