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
Add option to run bump after update #11942
base: main
Are you sure you want to change the base?
Add option to run bump after update #11942
Conversation
6903fb0
to
cc20ff5
Compare
I can see that the PHP 8.4 tests are failing but the failures seem unrelated to these changes and they also seem to happen in the main branch |
0d8312d
to
0d9f1b9
Compare
{ | ||
$this->initTempComposer($composerJson); | ||
|
||
if ($createLock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bump command needs that a lock file exists, so when testing the bump-after-update
version we need to create one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, after a quick review just one comment but I'll need to take a closer look when I'm back at my desk :)
doc/06-config.md
Outdated
@@ -476,4 +476,9 @@ throw, but you can set this config option to `["example.org"]` to allow using sv | |||
URLs on that hostname. This is a better/safer alternative to disabling `secure-http` | |||
altogether. | |||
|
|||
## bump-after-update | |||
|
|||
Defaults to false. If set to true, Composer will run the Bump command after running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be a string|bool that also accepts "no-dev" and "dev" as values to configure the *-only
flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion sounds good. I'll wait until you come back and are able to take a deeper look. If you still feel this is the way to go, I'll modify the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please :) Definitely feel like this would be an improvement.
src/Composer/Command/BumpCommand.php
Outdated
bool $noDevOnly, | ||
bool $dryRun, | ||
array $packagesFilter, | ||
bool $calledFromUpdate = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unused and unnecessary?
|
||
if ($bumpAfterUpdate) { | ||
if ($result === 0) { | ||
$io->writeError('<info>Running Bump after Update.</info>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$io->writeError('<info>Running Bump after Update.</info>'); | |
$io->writeError('<info>Bumping dependencies</info>'); |
} else { | ||
$io->writeError('<warning>Not running Bump after Update because the update command did not finish successfully.</warning>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed.
} else { | |
$io->writeError('<warning>Not running Bump after Update because the update command did not finish successfully.</warning>'); |
0d9f1b9
to
1d13727
Compare
bump-after-update
config parameterbump-after-update
option to the update commandIf the
bump-after-update
config parameter is set or thebump-after-update
option is passed to theupdate
command, it will run thebump
command after finishing the update. This command will only be run if the update finishes successfullyIf the config parameter or the option are set to
dev
orno-dev
then only the corresponding dependencies will be bumped.The
dry-run
option passed to theupdate
command will also be used for thebump
commandIf any packages are listed in the
update
command, this same package list will be used by thebump
command.Includes updates to the documentation and new tests
Fixes #11906