Validate metadata link keys#1834
Conversation
| # "bugs" => "https://example.com/user/bestgemever/issues" | ||
| # } | ||
| # | ||
| # These links will be used on your gem's page on rubygems.org amd must pass |
| # These links will be used on your gem's page on rubygems.org amd must pass | ||
| # validation against following regex. | ||
| # | ||
| # %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z} |
There was a problem hiding this comment.
Should we actually validate this in RubyGems are well as on .org ?
40716b1 to
1185830
Compare
Yes. I think we should validate both on client and the server. Doing it on client would provide immediate feedback and server side validation is for just in case (dealing with invalid links is painful). I think there is a flag which ignores the validation checks during |
|
Then let's validate the links instead of just documenting the valid format -- that way |
1185830 to
475faf6
Compare
| if link_keys.include? key | ||
| if value !~ url_validation_regex | ||
| raise Gem::InvalidSpecificationException, | ||
| "metadata['#{key}'] has invalid link: #{value}" |
|
👍 other than the one small comment (I hadn't realized you'd addressed my comment) |
475faf6 to
48dfc19
Compare
These keys will be validated on server and gem push will fail for invalid links.
48dfc19 to
4b7a695
Compare
|
Updated 💬 |
|
👌🏻 |
|
@homu r+ |
|
📌 Commit 4b7a695 has been approved by |
|
⚡ Test exempted - status |
Validate metadata link keys # Description: We intend to deprecate form used to edit linkset of gems. Metadata will be the only way to specify homepage, codebase, documentation, wiki, mailing list and issue tracker urls. Related: rubygems/rubygems.org#1234 rubygems/rubygems.org#1557 # Tasks: - [x] Describe the problem / feature - [ ] Write tests - [ ] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
Add changelog to metadata validation Ref: #1834 rubygems/rubygems.org#1553 # Description: We need to validate changelog link during `gem build`. # Tasks: - [x] Describe the problem / feature - [ ] Write tests - [x] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
Description:
We intend to deprecate form used to edit linkset of gems. Metadata will be the only way to specify homepage, codebase, documentation, wiki, mailing list and issue tracker urls.
Related: rubygems/rubygems.org#1234
rubygems/rubygems.org#1557
Tasks:
I will abide by the code of conduct.