-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
two fixes for [packagist] schemas #7782
Conversation
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.
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') |
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'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?
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 gather adding a live test would probably be overkill, but would it be worth leaving an inline comment with a link to the issue?
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.
__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.
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.
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.
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've written it up in #7783
closes #7779