Skip to content

Add support for --minimal-changes with full updates - #12349

Merged
Seldaek merged 2 commits into
composer:mainfrom
Seldaek:full_update_minimal
May 13, 2025
Merged

Seldaek merged 2 commits into
composer:mainfrom
Seldaek:full_update_minimal

Conversation

@Seldaek

@Seldaek Seldaek commented Mar 24, 2025

Copy link
Copy Markdown
Member

Refs #12341

@Seldaek Seldaek added this to the 2.9 milestone Mar 24, 2025
@Seldaek
Seldaek requested a review from naderman March 24, 2025 12:53
@naderman

Copy link
Copy Markdown
Member

Looks good, just wonder if there should be an error/warning if --minimal-changes is used on a full update and the composer.json is unmodified, which will never result in any modifications?

@Seldaek

Seldaek commented Mar 24, 2025

Copy link
Copy Markdown
Member Author

Well.. you ask for minimal updates you get minimal updates :p

{ "name": "dependency/pkg", "version": "2.0.0" },
{ "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "dependency/pkg2", "version": "2.0.0" },

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.

I suggest having both 2.0.0 and 2.1.0 (which would both match the requirement), to cover that --minimal-changes will still update to 2.1.0 and not to 2.0.0 (i.e. it is not the --minimal-deviation that was suggested in the discussion)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 12221a3 (I think that's what you meant anyway)

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.

yes

@Seldaek
Seldaek merged commit 6b55179 into composer:main May 13, 2025
@Seldaek
Seldaek deleted the full_update_minimal branch May 13, 2025 12:20
@dkarlovi

Copy link
Copy Markdown

IIUC this update: if you didn't update composer.json by say requesting some version bump, it will not update anything? And if you did update say 1.0 to 1.1, it will only bump stuff required for that change (which might be nothing)?

In that case I do agree with @naderman about unmodified composer.json producing an error, it will help with UX since it makes clear to users nothing will happen unless they make something happen.

@Seldaek

Seldaek commented May 14, 2025

Copy link
Copy Markdown
Member Author

Yes, I'll see if we can easily add a warning or not.

Seldaek added a commit to Seldaek/composer that referenced this pull request May 23, 2025
Seldaek added a commit that referenced this pull request May 23, 2025
…h lock file (#12418)

* Add warning when --minimal-changes is used without package and a fresh lock file

Refs #12349
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.

4 participants