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

Formatter Action doesn't post comments when made from a fork #489

Open
oxinabox opened this issue Oct 11, 2021 · 3 comments
Open

Formatter Action doesn't post comments when made from a fork #489

oxinabox opened this issue Oct 11, 2021 · 3 comments

Comments

@oxinabox
Copy link
Member

oxinabox commented Oct 11, 2021

When a PR is made from a fork the Formatter failed by doesn't post comments with clickable suggestions:
see: https://github.com/JuliaDiff/ChainRulesCore.jl/pull/488/checks?check_run_id=3854350212#step:5:187

reviewdog: This GitHub token doesn't have write permission of Review API [1],
so reviewdog will report results via logging command [2] and create annotations similar to
github-pr-check reporter as a fallback.
[1]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target,
[2]: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#logging-commands

I am not sure if we can raise the permission on the GITHUB_TOKEN on a fork,
or if we can issue another token that has that permission?

But checks that fail without being easy to act upon suck.
This isn't super hard to do locally, I think it is just

using Pkg: @pkg_str
pkg"activate --temp"
pkg"add JuliaFormatter"
using JuliaFormatter; format("."; verbose=true)

But that is still work.

And especially for PR from newcomers (not @mcabbott 😂 ) who will always be making a PR from a fork, we want things to be smooth.

@st--
Copy link
Contributor

st-- commented Oct 12, 2021

In case it's not easy to figure out how to get the suggestions on fork PRs: how about providing Makefiles for this - e.g. to allow make format (make is available on any unix-style system) to simplify the process ... would that be something you could see helping new contributors? (if not I'll be forevermore quiet on this topic; I've previously&elsewhere suggested this and it did not seem well-received - "just use VSCode" ...:))

@devmotion
Copy link
Member

Didn't want to chime in here initially, but I still think it's more accessible if one provides instructions for how to format the code with Julia (and possibly the most common editor for Julia): not everyone uses a unix system or is familiar with the commandline or make but I think one can assume that every contributor knows how to start Julia (or the editor) and run Julia code.

(BTW I assume you saw that the required changes are still displayed in a somewhat nice way in the "Files" tab, although of course it's still not possible to just accept these changes)

@devmotion
Copy link
Member

I wonder if it would be sufficient to use https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#pull_request_target instead of pull_request or if this would break the reviewdog action. If it doesn't work it would be useful if reviewdog would add support for pull_request_target if possible.

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

No branches or pull requests

3 participants