Skip to content

Commit

Permalink
fix: limit the number of annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlJi committed Aug 29, 2024
1 parent 3269168 commit 85c39d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/linters/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func CreateGithubChecks(ctx context.Context, a Agent, lintErrs map[string][]Lint
)

annotations := toGithubCheckRunAnnotations(lintErrs)
// limit the number of annotations to 50
// see: https://github.com/qiniu/reviewbot/issues/258
if len(annotations) > 50 {
annotations = annotations[:50]
}

check := github.CreateCheckRunOptions{
Name: linterName,
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (*LocalRunner) Run(ctx context.Context, cfg *config.Linter) (io.ReadCloser,
return io.NopCloser(bytes.NewReader(output)), execErr
}

// for easy mock
// for easy mock.
type DockerClientInterface interface {
ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error)
ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error)
Expand Down

0 comments on commit 85c39d8

Please sign in to comment.