Skip to content

Create summary comment for lintcheck runs #14816

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alexendoo
Copy link
Member

Previously rust-lang/triagebot#1985

After a lintcheck run a comment will be created in the PR thread with an overview of the changes, example here Alexendoo#18 (comment) (plus the normal GHA debugging experience)

It will only comment if there are some changes, if there's already an existing comment it will be updated for each run

Similar to https://github.com/rust-lang/team/blob/master/.github/workflows/dry-run.yml

The PR number is supplied by the lintcheck run, so technically someone could forge it to be annoying and edit the summaries in other threads, but that is pretty low impact and easy to deal with. There is a pull_requests field on the event but as @Kobzol pointed out to me it's not populated for PRs from forks

r? @flip1995

changelog: none

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 15, 2025
@samueltardieu
Copy link
Contributor

Great feature!

Since an existing comment will be edited, it might not be clear without also checking the status of the run (which might be far down if the PR has been re-pushed many times) that the lintcheck comment is up-to-date.

If this is not too complicated, it would be great if, at the beginning of a run, the existing lintcheck comment could be prefixed with a bold message saying something like "Results for the new lintcheck run should be available shortly". WDYT?

@Kobzol
Copy link
Contributor

Kobzol commented May 15, 2025

The comment being updated silently can be a bit opaque, so adding a note sounds like a good idea. I would suggest still doing the update rather than sending a new comment, though, as that would be super spammy :)

Workflow looks good, although I'm not sure if I understand the else branch in Create/update comment.

@Alexendoo Alexendoo force-pushed the lintcheck-comment branch from 686cf7e to 2dbaf1c Compare May 16, 2025 01:08
@Alexendoo
Copy link
Member Author

If this is not too complicated, it would be great if, at the beginning of a run, the existing lintcheck comment could be prefixed with a bold message saying something like "Results for the new lintcheck run should be available shortly". WDYT?

Not easy unfortunately, since we're stashing the PR number in an artifact we don't learn it until after lintcheck has already concluded. If the pull_requests field were populated we could do it in a separate step when the workflow run begins

Workflow looks good, although I'm not sure if I understand the else branch in Create/update comment.

Hopefully made the comment clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants