hiqdev / composer-ci-deps-plugin
Composer plugin for installing dependencies from the PRs
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: ^8.1
- composer-plugin-api: ^2.0
- cweagans/composer-patches: 2.*
- guzzlehttp/guzzle: ^7.8
- http-interop/http-factory-guzzle: ^1.2
- m4tthumphrey/php-gitlab-api: ^11.13
Requires (Dev)
- composer/composer: ^2.0
This package is auto-updated.
Last update: 2025-01-29 08:55:14 UTC
README
This plugin is designed for CI/CD pipelines of a multi-repository project. When a project consists of multiple repositories, it is often necessary to test the changes in the dependencies of the project before merging them. This plugin helps to automate this process.
It allows to automatically patch the dependencies of the project based on the list of pull requests that are currentto be used inly being tested.
Limitations
- Currently, the plugin supports pull requests from:
- Public GitHub repositories
- Private GitLab repositories
- Only pull requests against the installed dependency versions are supported. It means that the plugin will not work if the pull request is against the feature branch, and you have the main repo branch installed as a dependency.
- If you already use cweagans/composer-patches, in your project, you should install this plugin with caution, as it was not tested in such an environment and may cause conflicts.
Supported environment variables
Installation
composer require --dev hiqdev/composer-ci-deps-plugin
Usage
-
Create a
pull-requests.txt
in the root of your project with the list of pull requests, one per line, for example:https://gitlab.com/ultimateretro/ultimateretro/-/merge_requests/49 https://github.com/hiqdev/php-billing/pull/94
The plugin will automatically detect the type of the pull requests.
-
Run
composer prp
– this will download patches from the pull requests and apply them to the dependencies.
Development
The easiest way to test the plugin is to create a new project and require the plugin from the local path:
{ "repositories": [ { "type": "path", "url": "/path/to/composer-ci-deps-plugin" } ], "require-dev": { "hiqdev/composer-ci-deps-plugin": "*" } }
Then you can run the plugin with the following command and enjoy the debugging with XDebug:
export XDEBUG_TRIGGER=1 export COMPOSER_ALLOW_XDEBUG=1 export GITLAB_REPO_ACCESS_TOKEN=<your GitLab access token> composer prp