Skip to content

Commit

Permalink
feat(pkg/reporter): make the pro reporter exit early if there are no …
Browse files Browse the repository at this point in the history
…verdicts to forward

Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido committed Mar 26, 2024
1 parent 759d76a commit 9531229
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pkg/reporter/pro/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ func New(ctx context.Context, opts ...reporter.Option) (reporter.Reporter, error

func (r *rep) Run(res listen.Response) error {
verdicts := res.Verdicts()
// if len(verdicts) == 0 {
// Assuming we have problems...
// FIXME: signal if a package has a problem (yet to analyse) ?
// }
if len(verdicts) == 0 {
return nil
}

// Spawn API calls in parallel
type wrap struct {
Expand Down Expand Up @@ -122,12 +121,8 @@ func (r *rep) WithContinuousIntegrationInfo(info *ci.Info) {
r.info = info
}

// TODO: impl (only for tests/mocks?)
func (r *rep) WithProClientBaseURL() {
}

func attachAuthBearer(r *rep) apispec.RequestEditorFn {
return func(ctx context.Context, req *http.Request) error {
return func(_ context.Context, req *http.Request) error {
if req == nil {
return fmt.Errorf("request is nil")
}
Expand Down

0 comments on commit 9531229

Please sign in to comment.