JuliaDiff / JuliaDiff/ChainRulesCore.jl

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

Open
#489 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Formatter Action configuration and the linked check's reviewdog output, then reproduce formatting locally with the JuliaFormatter command shown in the issue. Trace how fork pull requests receive tokens and report results; done means determining a safe way to post clickable suggestions, or documenting the supported fallback if that is not possible.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, julia
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.