Conversation
… and update methods
There was a problem hiding this comment.
Pull request overview
This PR adjusts how the custom Installer handles Composer path repository packages so they are reflected in the installed repository tracking without running the normal install/update workflows (which would be unsafe for path-based sources). It also adds tests around this repo-registration behavior.
Changes:
- Add conditional
InstalledRepositoryInterface::addPackage()calls for path-repo packages duringinstall()andupdate()when the package isn’t already registered. - Add PHPUnit tests asserting
addPackage()is called (or not called) for path-repo packages depending onhasPackage().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Installer.php |
Adds installed-repo registration for path-repo packages in install() and update() skip branches. |
tests/ModuleInstallerTest.php |
Adds tests covering path-repo registration behavior during install/update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+487
to
+490
| if (! $repo->hasPackage($target)) { | ||
| $repo->addPackage(clone $target); | ||
| } | ||
|
|
| $installer = new TestableInstaller($io, null); | ||
| $installer->update($repo, $initial, $target); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the handling of path repository packages during installation and update, ensuring they are properly registered in the installed repository only if not already present. It also adds comprehensive tests to verify this behavior.
Installer logic improvements:
installandupdatemethods inInstaller.phpto check if a path repository package is already present in the installed repository before adding it. If not present, the package is cloned and added; otherwise, it is skipped. [1] [2]Test coverage enhancements:
ModuleInstallerTest.phpto verify that path repository packages are registered in the repository only when not already present during both install and update operations. [1] [2]