Skip to content
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

two fixes for [packagist] schemas #7782

Merged
merged 3 commits into from
Mar 28, 2022
Merged

Conversation

chris48s
Copy link
Member

closes #7779

@chris48s chris48s added bug Bugs in badges and the frontend service-badge New or updated service badge labels Mar 27, 2022
@shields-ci
Copy link

shields-ci commented Mar 27, 2022

Warnings
⚠️ This PR modified service code for packagist but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @chris48s!

Generated by 🚫 dangerJS against 9a1652c

@shields-cd shields-cd temporarily deployed to shields-staging-pr-7782 March 27, 2022 23:06 Inactive
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

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

lgtm, no objections to merging as is so have approved though left a few inline questions too

Joi.object({
php: Joi.string(),
}).required(),
Joi.string().valid('__unset')
Copy link
Member

Choose a reason for hiding this comment

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

I'm not terribly familiar with the PHP ecosystem, but are there any other well known values we could potentially see here or is __unset essentially it based on what we know today?

Copy link
Member

Choose a reason for hiding this comment

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

I gather adding a live test would probably be overkill, but would it be worth leaving an inline comment with a link to the issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

__unset is a special value. It gets applied in packagist's JSON 'compression' process:
https://github.com/composer/metadata-minifier/blob/c549d23829536f0d0e984aaabbf02af91f443207/src/MetadataMinifier.php#L76-L82
..but just thinking about that to answer this question has made me realise that there might be another problem here.
I'm going to leave this unmerged for now and come back to have another look at this later this evening.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right - having looked at it, we are running the validation on the uncompressed response which is why the __unset values are still in there at the point we validate. I misremembered that we had done something like I suggested in #6508 (comment) but we never did.
I think I'd like to revisit this code as I don't think what we are doing now is the best solution but I don't think I want to shave this specific yak tonight 🐄 . I'm going to merge this and punt that to an issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've written it up in #7783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packagist invalid response data for package version, but only on one repo
4 participants