Skip to content
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 "--dry-run" to bump command #11047

Merged
merged 3 commits into from
Sep 19, 2022
Merged

Add "--dry-run" to bump command #11047

merged 3 commits into from
Sep 19, 2022

Conversation

kubawerlos
Copy link
Contributor

With this flag it would be possible to run composer bump --dry-run as a part of CI - to keep synced composer.json and composer.lock.

When run on this repo:

$ php ./bin/compile 
$ php composer.phar bump --dry-run
Warning: Bumping dependency constraints is not recommended for libraries as it will narrow down your dependencies and may cause problems for your users.
./composer.json would be updated with:
 - require.composer/ca-bundle: ^1.3.3
 - require.composer/semver: ^3.3.2
 - require.justinrainbow/json-schema: ^5.2.12
 - require.psr/log: ^1.1.4 || ^2.0 || ^3.0
 - require.seld/jsonlint: ^1.9
 - require.seld/phar-utils: ^1.2.1
 - require.symfony/console: ^5.4.12 || ^6.0.11
 - require.symfony/filesystem: ^5.4.12 || ^6.0
 - require.symfony/finder: ^5.4.11 || ^6.0
 - require.symfony/process: ^5.4.11 || ^6.0
 - require.react/promise: ^2.9
 - require.symfony/polyfill-php73: ^1.26
 - require.symfony/polyfill-php80: ^1.26
 - require.seld/signal-handler: ^2.0.1
 - require-dev.symfony/phpunit-bridge: ^6.1.3
 - require-dev.phpstan/phpstan: ^1.8.3
 - require-dev.phpstan/phpstan-phpunit: ^1.1.1
 - require-dev.phpstan/phpstan-strict-rules: ^1.4.3
 - require-dev.phpstan/phpstan-symfony: ^1.2.13
$ echo $?
1

I've swapped the order of if (!$input->getOption('dev-only')) and if (!$input->getOption('no-dev-only')), so when there are packages in both to update then require is shown first.

@cafferata
Copy link
Contributor

Nice! I also played with this idea so that my colleagues can guarantee the Composer bump (from CI)

@Seldaek Seldaek added this to the 2.5 milestone Sep 14, 2022
@Seldaek
Copy link
Member

Seldaek commented Sep 14, 2022

Looks good overall, thanks, just the couple nitpicks :)

kubawerlos and others added 2 commits September 18, 2022 20:41
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
@Seldaek
Copy link
Member

Seldaek commented Sep 19, 2022

Thanks

@kubawerlos kubawerlos deleted the bump-dry-run branch September 19, 2022 06:48
Shredz00 pushed a commit to Shredz00/composer that referenced this pull request Sep 26, 2022
…resent for custom domains, fixes composer#11062

Add "--dry-run" to bump command (composer#11047)
Seldaek pushed a commit that referenced this pull request Oct 25, 2022
emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants