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

Simplify comments to use logging instead of the Github API #5

Merged
merged 12 commits into from
Jul 21, 2021

Conversation

doriable
Copy link
Member

@doriable doriable commented Jul 21, 2021

This PR does the following:

  • Converts previous comments into workflow annotations instead, removing the need to use the Github API
  • This also removes the dependency on the github.token (so users no longer need to provide a Github token) and does not require the Github Action to extract owner, repository, and pullRequestNumber from github.context
  • Lint errors no longer show up as comments/conversations, but are instead annotations that only show up in the Files tab of a pull request
  • Allows us to use the "Unchanged files with check annotations" feature, which shows annotations for lint errors, even for files outside of the PR -- this was testing on an internal repository

We plan to make a similar change to buf-breaking-action

Copy link

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, much simpler!

Copy link
Contributor

@amckinney amckinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, I'm so happy to get rid of all this GitHub API code 👏

src/run.ts Outdated
Comment on lines 121 to 122
// All file annotations in the result have been processed, return an empty error.
return {message: ""};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great, but consider including a more meaningful message rather than an empty error.

    return {
        message: `buf found ${result.fileAnnotations.length} lint failures.\n
    };

@doriable doriable merged commit f0b4ff5 into master Jul 21, 2021
@doriable doriable deleted the simplify_comments branch July 21, 2021 21:46
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

Successfully merging this pull request may close these issues.

3 participants