-
Notifications
You must be signed in to change notification settings - Fork 329
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
Provide a way to integrate/configure googleapis/code-suggester so openrewrite diff is displayed as GitHub PR suggestions #3891
Comments
It looks like Here's a screenshot from New fine-grained personal access token page: |
As far as I understand reviewdog, it supports diff as input, which should be enough to send the patch file to the API and then one has the suggestions? It can even made be more simpler - if the diff is existing in the working tree: https://github.com/reviewdog/action-suggester (I put that as TODO on my list; I wanted to share fast, because we made good experiences in the context of checkstyle with reviewdog) |
Thanks for the helpful link @koppor; hadn't come across reviewdog before, and seems a convenient option for other platforms than GitHub indeed. For now I'd started to work with code-suggester in these two PRs, and will expand that with recipe runs: That approach helpfully hides the implementation details in a shared workflow, such that we can always switch as needed. I'd for now considered this something to use on the OpenRewrite repositories itself, but we can look at opening that up as an action ourselves in the future as well. Input & help welcome. :) |
As part of openrewrite/gh-automation#45 we now have two new workflows that together review PRs:
An example of such automated review comments can be seen here openrewrite/rewrite-testing-frameworks#343 (review) We're likely to refine and expand this approach still, but I believe this is a good first step to show how this can be achieved. We don't yet insert accompanying comments, and that's perhaps indeed not supported by code-suggester, but good enough for use on our own PRs for now. Further input and suggestions welcome, but I think we've achieved enough to close this issue already; I'll monitor any comments that arrive still, and can reopen if needed. |
What problem are you trying to solve?
It would be nice if OpenRewrite suggestions could be displayed as PR suggestions in GitHub UI.
Describe the solution you'd like
on: workflow_run: types: completed
workflow picks up the attached patch artifact and calls https://github.com/googleapis/code-suggester to create code suggestionsA dedicated
on: workflow_run
workflow would be able to access secrets, so it would be relatively secure, and it would not allow PR builds to access secrets.Unfortunately, the current
googleapis/code-suggester
does not support comments for suggestions. In other words, it creates only```suggestion ... ```
comment, and it would probably be great to pass extra information like the rule name to the message.For instance, ErrorProne's messages include a link with detailed explanation and the summary:
OpenRewrite could probably add a link to the rule documentation so the users could know the intention behind the rule.
Additional context
The text was updated successfully, but these errors were encountered: