-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add "How to Contribute" link and functionality #2042
Conversation
@zakame thanks for this. Could we squash this down into one commit as well? I know we had a misunderstanding with some of this when I last reviewed it. I apologize for not communicating more clearly initially and then communicating quite rudely subsequent to that. I need to do better than that and I hope that you'll accept my apology. My main concern is that if people are going to contribute, I don't want them to spend a lot of time going down a path that we might not be able to use, because that might discourage them from contributing again in future. That's what I was trying to express, but in a really terrible way. |
if ( !exists $file->{path} ) { | ||
my $release = join q{/}, @args; | ||
$c->stash( { | ||
message => 'Ask the author on how to contribute to this release.', |
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.
👍
@oalders no worries 😸 I certainly understand the potential additional effort if we maintain more code, and I appreciate your rigor for ensuring that every change counts for both improving the system and keeping it easy enough to hack on. 👍 |
c11b06d
to
bfdd894
Compare
This adds a new model class that requests from the backend API for the CONTRIBUTING/HACKING docs of a release, if any. c.f. metacpan/metacpan-api@088bd9e Add `/contribute-to/$author/$release` route This route uses API::ContributingDoc to request for the Contributing file, if available, and then redirects to the appropriate view (render HTML if its pod, or leave as source if otherwise.) Add `How to Contribute` link in release-info sidebar This generates the appropriate `/contributing-to/` link for a module/release, to enable metacpan#1779. :lipstick: `make_immutable` Use `interesting_files` instead of a new backend API Use metacpan/metacpan-api#803 instead of the new `contributing_doc` call in metacpan/metacpan-api#802 and just filter for CONTRIBUTING/HACKING files on the controller. :lipstick: Refactor for clarity Use API::Release->interesting_files instead of API::ContributingDoc The latter module seems not needed here anyway as the underlying `/contributing_doc` endpoint is gone. Just let the ContributingDoc controller do its thing instead. :lipstick: Remove obsolete API::ContributingDoc module :lipstick: Interpolate instead of concatenate Render *.pm variants of Contributing/Hacking as pod Take into account metacpan/metacpan-api@9749e00
bfdd894
to
b2c27f6
Compare
@oalders now squashed, I'll do the same for the corresponding -api PR as soon as I get feedback on metacpan/metacpan-api#803 (comment) (or sooner, if you prefer me making another PR later to improve on that.) Thanks! |
@zakame I think you can go ahead and squash the other one. If there turns out to be an issue, we can look at dealing with it. Ideally the API would already know which files are "interesting", so possibly this is something we should be figuring out at indexing time rather than on the fly. For now, I suspect it'll be fine. |
This implements a link to a release's
CONTRIBUTING
or similar files in its MetaCPAN page:Currently this will link to a new route
/contributing-to/$author/$release
which callsa new API implemented in metacpan/metacpan-api#802API::Release->interesting_files
and filters for Contributing/Hacking files, as implemented in metacpan/metacpan-api#803. If a Contributing file is found, it will use the appropriate renderer for it (e.g. HTML if it is in pod, source if otherwise.) If no file is found, it will show a 404 with a suggestion to contact the author.Fixes #1779.