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

SAST errors in the cron aren't cleared between repos #2892

Closed
spencerschrock opened this issue Apr 20, 2023 · 0 comments · Fixed by #2893
Closed

SAST errors in the cron aren't cleared between repos #2892

spencerschrock opened this issue Apr 20, 2023 · 0 comments · Fixed by #2893
Assignees
Labels
check/SAST cron-job kind/bug Something isn't working

Comments

@spencerschrock
Copy link
Contributor

Describe the bug
The checkruns client doesn't reset errSetup error

func (handler *checkrunsHandler) init(ctx context.Context, repourl *repoURL, commitDepth int) {
handler.ctx = ctx
handler.repourl = repourl
handler.commitDepth = commitDepth
handler.logger = log.NewLogger(log.DefaultLevel)
handler.checkData = new(checkRunsGraphqlData)
handler.setupOnce = new(sync.Once)
handler.checkRunsByRef = checkRunsByRef{}
}

So once a cron worker encounters a SAST error, any repo it processes afterwards will short-circuit the SAST check:

func (handler *checkrunsHandler) listCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
if err := handler.setup(); err != nil {
return nil, fmt.Errorf("error during graphqlHandler.setupCheckRuns: %w", err)
}

Expected behavior
An error in one repo in the cron shouldn't affect the results for another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
check/SAST cron-job kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant