KEMBAR78
Repo jacking protection and cleanups by Seldaek · Pull Request #1411 · composer/packagist · GitHub
Skip to content

Conversation

@Seldaek
Copy link
Member

@Seldaek Seldaek commented Jan 10, 2024

Replaces #1402

@private-packagist
Copy link
Contributor

composer.lock

Package changes

Package Operation From To About
phpstan/phpdoc-parser upgrade 1.24.2 1.25.0 diff

Dev Package changes

Package Operation From To About
phpstan/phpstan upgrade 1.10.39 1.10.55 diff
phpstan/phpstan-doctrine upgrade 1.3.43 1.3.54 diff
phpstan/phpstan-symfony upgrade 1.3.4 1.3.6 diff

Settings · Docs · Powered by Private Packagist

@Seldaek Seldaek requested a review from naderman January 10, 2024 15:01
use Composer\Util\HttpDownloader;
use DateTimeInterface;

enum PackageFreezeReason: string
Copy link
Contributor

Choose a reason for hiding this comment

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

why defining it inline instead of making it autoloadable ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it belongs together with the class, and is much more readable to me than having tiny enum files lingering around, and there is no reason to use it without package instance, so the package class will be loaded when you need it.


public function translationKey(): string
{
return 'freezing_reasons.' . $this->value;
Copy link
Contributor

Choose a reason for hiding this comment

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

if you want to make those translations extractable, a solution would be to make a method returning a TranslatableMessage object (that you would still use in Twig by passing it to the trans filter), using a match() statement instead of concatenation (as dynamic keys cannot be extracted by the tooling)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks that's good to know but I don't really care about extractability here.

</form>
{% endif %}
</div>
{% if package.isFrozen() %}
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be displayed only for package maintainers and admins (as done right now by being inside the {% if has_actions %}) or to all users ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should open it to everyone, I don't expect this to be too frequent anyway.. And it'd be valuable to see the warning for the gone packages.

@Seldaek Seldaek merged commit 5c7c82e into composer:main Jan 11, 2024
@Seldaek Seldaek deleted the repojack branch January 11, 2024 16:11
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.

4 participants