8000 feature #57797 [FrameworkBundle]  terminate with non-zero exit code w… · symfony/symfony@450113c · GitHub
[go: up one dir, main page]

Skip to content

Commit 450113c

Browse files
committed
feature #57797 [FrameworkBundle]  terminate with non-zero exit code when a secret could not be read (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- [FrameworkBundle]  terminate with non-zero exit code when a secret could not be read | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | | License | MIT The fix for #42038 did a bit too much. Not only did it fix the PHP error that wasn't caught before, but also changed the exit code of the command. With this change the PHP error will still be prevented, but the command will terminate with a non-zero exit code to indicate the failure that occurred while reading the stored secrets. Commits ------- 1d1ab26 terminate with non-zero exit code when a secret could not be read
2 parents 9f2133f + 1d1ab26 commit 450113c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

UPGRADE-7.2.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Read more about this in the [Symfony documentation](https://symfony.com/doc/7.2/
88

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

11+
FrameworkBundle
12+
---------------
13+
14+
* [BC BREAK] The `secrets:decrypt-to-local` command terminates with a non-zero exit code when a secret could not be read
15+
1116
Security
1217
--------
1318

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

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

1313
7.1
1414
---

src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function __construct(
3838
protected function configure(): void
3939
{
4040
$this
41-
->addOption('exit', null, InputOption::VALUE_NONE, 'Returns a non-zero exit code if any errors are encountered')
4241
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force overriding of secrets that already exist in the local vault')
4342
->setHelp(<<<'EOF'
4443
The <info>%command.name%</info> command decrypts all secrets and copies them in the local vault.
@@ -48,10 +47,6 @@ protected function configure(): void
4847
When the <info>--force</info> option is provided, secrets that already exist in the local vault are overridden.
4948
5049
<info>%command.full_name% --force</info>
51-
52-
When the <info>--exit</info> option is provided, the command will return a non-zero exit code if any errors are encountered.
53-
54-
<info>%command.full_name% --exit</info>
5550
EOF
5651
)
5752
;
@@ -100,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
10095
$io->note($this->localVault->getLastMessage());
10196
}
10297

103-
if ($hadErrors && $input->getOption('exit')) {
98+
if ($hadErrors) {
10499
return 1;
105100
}
106101

0 commit comments

Comments
 (0)
0