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

Warn the user when patches.lock is not up to date #479

Open
5 tasks done
cweagans opened this issue Feb 14, 2023 · 4 comments
Open
5 tasks done

Warn the user when patches.lock is not up to date #479

cweagans opened this issue Feb 14, 2023 · 4 comments
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.

Comments

@cweagans
Copy link
Owner

Verification

  • I have updated Composer to the most recent stable release (composer self-update)
  • I have updated Composer Patches to the most recent stable release (composer update cweagans/composer-patches)
  • I am using one of the supported PHP versions (8.0+)
  • I have searched existing issues and discussions for my problem.
  • My problem is not addressed in the troubleshooting guide.

What were you trying to do (and why)?

#472 (comment)

Trying to change a patch/setting.

What happened? What did you expect to happen?

The plugin did nothing and ignored all changes. It should have warned when the resolved patches/settings were different from the ones that generated the lock file.

Contents of composer.json

-

Contents of patches.lock

-

Full output of composer patches-doctor

-

Full output of relevant Composer command with the -vvv flag added

-
@cweagans cweagans added the bug Inconsistencies or issues which will cause a problem for users or implementors. label Feb 14, 2023
@stale
Copy link

stale bot commented Mar 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 16, 2023
@stale stale bot closed this as completed Mar 23, 2023
@cweagans cweagans reopened this Jun 30, 2023
@github-actions github-actions bot removed the stale label Jul 2, 2023
@rajeshreeputra
Copy link

rajeshreeputra commented Feb 21, 2024

In patchPackage if we check hash for the current patches.lock.json file and if there is any change then execute command to relock the patches.lock.json, then I guess this problem will be fixed.
Screenshot 2024-02-21 at 2 56 28 PM

@cweagans
Copy link
Owner Author

No, relock should always be an explicit operation. We should never automatically do this.

@cweagans
Copy link
Owner Author

You can call isFresh() on the Locker class to check this. If there's a hash mismatch, emit a warning to the console. Def shouldn't relock automatically though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants