-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Added GitHub Post-Receive URL feature. #84
Conversation
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\HttpKernel\KernelInterface; | ||
use Symfony\Component\Finder\Finder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please clean all unused statements
Big refactoring. Moved code to |
|
||
// | ||
// We found the package that was referenced. | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should remove the 2 empty comment lines
So, we should get @Seldaek feedback on a few things that I don't have answers for:
|
use Packagist\WebBundle\Repository\Repository\RepositoryInterface; | ||
use Composer\Package\Version\VersionParser; | ||
use Composer\Repository\VcsRepository; | ||
use Composer\Package\PackageInterface; | ||
use Composer\Repository\RepositoryManager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the RepositoryManager still used ?
public function __construct(RegistryInterface $doctrine, \DateTime $start = null) | ||
{ | ||
$this->doctrine = $doctrine; | ||
$this->start = null !== $start ? $start : new \DateTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the start date should be a constructor argument. It is not more generate than the $clearExistingVersions
param which is specific to the update call here
Updated per @stof recent comments. |
you will need to update the PR once #93 is merged as the bug fix concerns the code moved to the updater in your PR. |
…used use statements.
return new Response(json_encode(array('status' => 'error', 'message' => 'Invalid credentials',)), 403); | ||
} | ||
|
||
if (! preg_match('~(github.com/[\w_\-\.]+/[\w_\-\.]+)$~', $payload['repository']['url'], $matches)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment (I'll fix while merging), dots don't have to be escaped in character classes, and hyphens either - as long as they're the last or first char of the char class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also _ is part of \w
This should resolve both #81 and #67. Sorta related to #58.
packagist:tokens:generate
command to generate tokensOnce in place, it should look like this:
Upgrade
Currently,
packagist:tokens:generate
is pretty basic and just regenerates tokens for users who are currently missing a token. This is useful for upgrading to support tokens (just needs to be run once). Eventually this command can be updated to have a few options:--missing
generate tokens for any user missing a token--for-user
regenerate a token for a specific userTODO
I had to copy a lot of functionality fromUpdatePackagesCommand
. This should eventually (sooner rather than later?) be refactored and extracted into its own class so that it can be better reused and tested.The shared functionality has been moved to
Package\Updater
.