Skip to content

forwardport PR#110 #232

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

Closed
wants to merge 2 commits into from
Closed

forwardport PR#110 #232

wants to merge 2 commits into from

Conversation

Tyrael
Copy link

@Tyrael Tyrael commented Jul 14, 2015

this PR is basically the same as #110 but it should apply to the current master without any conflicts.

@samifruit514
Copy link

I don't understand why this change is not merged yet. It is very useful when we push new tags into a git repo.

@mbrodala
Copy link

mbrodala commented Sep 2, 2015

@Seldaek What's your opinion on this one?

Given the fact that webhooks from Github/Bitbucket only contain Git repository URLs and not Composer package names, this change would be very useful to trigger updates for single packages.

@naderman
Copy link
Member

naderman commented Sep 6, 2015

Why doesn't this use the merging of packages as the package filter does, see https://github.com/Tyrael/satis/blob/partial_update/src/Composer/Satis/Command/BuildCommand.php#L195 - is the cache file really needed?

@Tyrael
Copy link
Author

Tyrael commented Sep 7, 2015

#110 was created before the packages filter was added (originally with 4e9780a then later renamed) and I did not realize that new helper method when porting the original PR.

@naderman
Copy link
Member

naderman commented Sep 7, 2015

@Tyrael I realize the history, but would be nice to update this now then if possible?

@Tyrael
Copy link
Author

Tyrael commented Sep 7, 2015

sure, and I will update the PR, I was just answering your question why was this not done that way in the first place :)

@Tyrael
Copy link
Author

Tyrael commented Sep 24, 2015

@naderman any chance you had the time to review this?

if (($singleRepositoryUrl = $input->getOption('repository-url')) !== null) {
$singleRepositoryConfig = null;
foreach ($config['repositories'] as $r) {
if ($r['url'] == $singleRepositoryUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should use strict comparison

@Tyrael
Copy link
Author

Tyrael commented Sep 24, 2015

while going through the comments from @stof I've just realized that @naderman suggestion in #232 (comment) was probably that we should instead extend selectPackages() and loadDumpedPackages() with a $repositoriesFilter similarly how it was done for $packagesFilter.
@naderman if that's what you wanted just let me now and I can do that.

@realshadow
Copy link
Contributor

How does it look? I could really use this, I have patched satis for now

@alcohol
Copy link
Member

alcohol commented Nov 4, 2015

It needs to be rebased unfortunately.

@realshadow
Copy link
Contributor

@Tyrael Can you please try to move this forward if you have time?

Or I can try it if you are busy.

@Tyrael
Copy link
Author

Tyrael commented Nov 4, 2015

originally I just forwardported the quick and dirty solution but then I realized/was suggested a better approach but then got swamped with work at my dayjob and couldn't finish it.
I'm not given up on this but I don't think I can work on it for like another 2-3 weeks.

@realshadow
Copy link
Contributor

Just for clarification...

I assume combining --repository-url and package in one command is reduntant (and currently breaks packages). Should they be handled as mutually exclusive?

Wouldn't it be better/easier to reuse package for repository URL as well and then based on argument type (repository URL, package name) get correct repository? Even though that might be a bit confusing as far as arguments go.

@realshadow
Copy link
Contributor

I looked at the latest code and it moved miles ahead...

After a bit of searching I found that this could be easily solved with just changing findPackages in Composer\Repository\ArrayRepository to include comparison of $package->getSourceurl("") (or create a separate method for that) and then it could be used together with package filter, e.g.

php bin\satis build satis.json public psr/log https://github.com/realshadow/serializers.git

Although I am not sure if it should go there. Any thoughts @alcohol, @Tyrael ?

@alcohol
Copy link
Member

alcohol commented Nov 20, 2015

@realshadow you mean you want to introduce changes to Composer for a feature in Satis? That is unlikely to happen unless you have a really good reason. Also I kind of lost track of what this PR was trying to accomplish since it's a port of a port (and I don't use Satis myself).

@realshadow
Copy link
Contributor

@alcohol Not really. Just saying :)

It was trying to accomplish building of a single/multiple repositories with repository url instead of package name. The original proposal was for --repository-url argument. @Tyrael then wanted to do like suggested in #232 (comment), but since then satis moved miles ahead and both mentioned methods do not exist anymore, instead the filtering is handled by composer itself via findPackages (thus my comment above).

Although on second thought, the original code, with slight alterations should be enough to cover this use case...

@alcohol
Copy link
Member

alcohol commented Nov 20, 2015

The code was mostly broken into smaller manageable pieces. It should still exist to some extend.

@realshadow
Copy link
Contributor

I have created a new PR #266 which uses PackageSelection for filtering.

@JamesRezo
Copy link
Contributor

I guess it can be closed ;)

@alcohol alcohol closed this Nov 20, 2015
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.

8 participants