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

Add GitHub annotations for lint #625

Merged
merged 98 commits into from
Nov 6, 2021
Merged

Add GitHub annotations for lint #625

merged 98 commits into from
Nov 6, 2021

Conversation

samchungy
Copy link
Contributor

@samchungy samchungy commented Oct 23, 2021

Features:

  • Adds GitHub Annotations for lint to pull requests via the Check Runs API. (test will come in another PR as this PR is already relatively big)

Changes:

  • Expose raw Error and Warning results via Eslint adapter
  • Added new GitHub Annotations to Lint
  • Added new GitHub API

Screenshots

Status View

image

Check Run Page View

image

Files Changed View

image

@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2021

🦋 Changeset detected

Latest commit: 21dfb66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samchungy samchungy linked an issue Oct 23, 2021 that may be closed by this pull request
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

I'll take a closer look next week but this looks seriously impressive! Thanks a bunch 🤩

docs/deep-dives/github.md Outdated Show resolved Hide resolved
src/api/github/checkRun.ts Outdated Show resolved Hide resolved
src/api/github/checkRun.ts Outdated Show resolved Hide resolved
@samchungy samchungy changed the title feat: add Github Annoations for lint feat: add GitHub Annoations for lint Oct 23, 2021
@72636c 72636c changed the title feat: add GitHub Annoations for lint Add GitHub annotations for lint Oct 24, 2021
docs/cli/lint.md Outdated Show resolved Hide resolved
docs/cli/lint.md Outdated Show resolved Hide resolved
docs/cli/lint.md Outdated Show resolved Hide resolved
yarn.lock Show resolved Hide resolved
src/utils/batch.ts Outdated Show resolved Hide resolved
src/cli/lint/annotate/github/index.ts Outdated Show resolved Hide resolved
src/cli/lint/annotate/buildkite/tsc.ts Outdated Show resolved Hide resolved
const tools = [
...(eslint.ok ? [] : ['ESLint']),
...(prettier.ok ? [] : ['Prettier']),
...(tscOk ? [] : ['tsc']),
];

const summary = `${tools.join(', ')} found issues that require triage.`;
await createAnnotations(eslint, prettier, tscOk, tscOutputStream, summary);
Copy link
Member

Choose a reason for hiding this comment

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

This is for a separate PR, but any thoughts on error handling for annotations? I'm thinking that we should log and continue, rather than failing the command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was thinking it should log a warning/error - we shouldn't fail the whole test if we simply fail to report

src/api/github/index.ts Outdated Show resolved Hide resolved
src/api/github/checkRun.ts Outdated Show resolved Hide resolved
72636c added a commit that referenced this pull request Oct 26, 2021
Moves the Buildkite annotation refactoring logic out of #625.

This will enable us to add different types of annotations and aid in
writing unit tests without cluttering the external file.

Co-authored-by: Ryan Ling <ryan@outlook.com.au>
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

:shipit: thank you!

@72636c 72636c merged commit a34efe5 into master Nov 6, 2021
@72636c 72636c deleted the github-lint-annotations branch November 6, 2021 06:29
@github-actions github-actions bot mentioned this pull request Nov 6, 2021
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.

Support for GitHub Annotations
2 participants