I'm having problems at work where we are trying to split our legacy codebase into smaller composer projects to decouple the code and refactor in a controlled way.
We host our code on bitbucket and have a satis repo with "require-all": true
and all of our repos listed. This has been working really well.
The problem we are having is when we come to tag new versions of our projects, we have to update all of the other projects which depend on it to point to the exact version number we just tagged. We started to use wildcards to try and alleviate this pain and then just setting a specific version number in our 'core' application, however, we get errors like could not be found in any version
even though if we change back to have all the version numbers statically set the same, it works fine.
Project A composer.json
...
"require": {
"doctrine/dbal": "2.4"
}
...
Project B composer.json
...
"require": {
"acmeco/project_a": "1.0.*"
},
...
Project C composer.json
...
"minimum-stability": "stable",
"require": {
"acmeco/project_a": "1.0.4"
"acmeco/project_b": "1.0.9"
}
...
When running composer update
we get the following:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package acmeco/project_a could not be found in any version, there may be a typo in the package name.
Problem 2
- acmeco/project_b 1.0.9 requires acmeco/project_a 1.0.4 -> no matching package found.
- acmeco/project_b 1.0.9 requires acmeco/project_a 1.0.* -> no matching package found.
- Installation request for acmeco/project_b 1.0.9 -> satisfiable by acmeco/project_b[1.0.9].
If I change Project C's composer.json to use 1.0.* or Project B's composer to use 1.0.4, all is right with the world.
Maybe I'm not using composer as intended but I'd have thought it would see that Project B just wants 1.0.* of project_a and Project C wants the specific 1.0.4 so it should just go ahead and install project_a 1.0.4 because everyone is happy with that.
Any help/suggestions is much appreciated.