Skip to content

feat: add package registration logic for path repositories in install…#13

Merged
roble merged 2 commits into
mainfrom
dev
May 21, 2026
Merged

feat: add package registration logic for path repositories in install…#13
roble merged 2 commits into
mainfrom
dev

Conversation

@roble

@roble roble commented May 21, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Updated install and update methods in Installer.php to 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:

  • Added tests to ModuleInstallerTest.php to verify that path repository packages are registered in the repository only when not already present during both install and update operations. [1] [2]

Copilot AI review requested due to automatic review settings May 21, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 during install() and update() when the package isn’t already registered.
  • Add PHPUnit tests asserting addPackage() is called (or not called) for path-repo packages depending on hasPackage().

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 thread src/Installer.php
Comment on lines +487 to +490
if (! $repo->hasPackage($target)) {
$repo->addPackage(clone $target);
}

$installer = new TestableInstaller($io, null);
$installer->update($repo, $initial, $target);
}

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@roble roble merged commit b8143e4 into main May 21, 2026
3 checks passed
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.

2 participants