-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Wildcard branch alias support #7847
Comments
Normally if you're on a feature branch Composer will try to match it to a real branch, e.g. you branch off dev-master to dev-foo-bar, it should figure out that this branch is based on dev-master, then figure out that master is aliased to 1.x or whatever. If this doesn't work maybe we should have a look at why this fails in your case. You can have a look at the VersionGuesser class. An alternative is to provide COMPOSER_ROOT_VERSION to pin the version to something, but I don't think this works with Path repo packages. |
|
I think I understand things now, and I propose that there is a valid use case for a wildcard branch alias, namely a CI workflow in which there may be no other branches in the repository for "extra": {
"branch-alias": {
"@dev": "1.0.x-dev"
}
} |
This is what |
@TravisCarden the problem with this "carpet bomb" approach you suggest is that when you do have multiple branches available e.g. with a vcs repository the branch-alias would resolve many branches to the same 1.0.x-dev alias and then the solver will have to pick one branch to install at random between all your dev branches, which sounds sub-optimal. It might help for your particular use case but I think in the bigger picture it'll be a mess. |
That makes sense, @Seldaek. I'll see if |
Summary: I want the ability to specify a wildcard branch alias that matches any branch--something like
dev-*
or@dev
.Details: I use branch aliases with path repositories to allow me to test changes to members of a network of interdependent packages, and the strategy works well for the small number of common, known branches that contributors submit pull requests to. However, some of my contributors like to test their changes by simply pushing a topic branch to trigger a build, resulting in path repositories with versions like
dev-issue-12345
ordev-trying-something
that can't possibly be predicted. So the path repositories don't resolve to packages that actually get installed, and my builds don't actually include the system under test. To solve this problem, I'd really like to have some kind of wildcard branch alias that doesn't require me to know or specify specific branch names ahead of time--something likedev-*
, e.g.,"dev-*": "1.0.x-dev"
, or simply@dev
, e.g.,"@dev": "1.0.x-dev"
.Workaround: In the absence of such a feature I've been using the following workaround: I begin my builds by ensuring that the checked out Git branch matches my alias, e.g.:
Request: Does such a feature already exist? If so, it should be documented. If not, could one be added? In either case I would be open to sending a pull request if the change would be welcome, but as it would be my first contribution to this project I might need a little guidance. Thanks!
The text was updated successfully, but these errors were encountered: