Skip to content
Clara
Esc
↑↓navigate↵open⌘Jpreview
On this page

Code scanning

Clara opens a pull request with the smallest fix for a real code scanning alert, and dismisses false positives with an explanation.

When a code scanning alert, such as one from CodeQL, fires on your default branch, Clara decides whether it’s real.

The alert is Clara
A real vulnerability Opens a pull request with the smallest fix that removes it, without changing behavior anyone relies on
A false positive, or in code that only runs in tests Dismisses it, with an explanation
Something she couldn’t fix safely Leaves it open

On a pull request

Code scanning checks pull requests too. When a pull request’s code raises a new alert, GitHub comments on the flagged line, and its check fails until the alert is fixed or dismissed. Clara answers that comment the way she answers a review bot’s.

The alert is Clara
A real vulnerability Pushes the smallest fix to the pull request’s branch
A false positive, or in code that only runs in tests Dismisses it, and says why in her reply
Something she couldn’t fix safely Leaves it open, and says what’s in the way

Whichever it is, she replies to the comment and resolves its thread. She only dismisses an alert GitHub lists as open on that pull request, and at most five in one pass.

Dismissing takes two readings

Dismissing an alert hides it from everyone, and nothing reviews a dismissal the way a pull request reviews a fix. So Clara dismisses an alert only when two separate readings of the code agree it can’t be exploited. If they don’t agree, the alert stays open.

A comment in the code that says the input is safe isn’t evidence. She reads what it refers to.

If you reopen an alert she dismissed, she won’t dismiss it again.

When an alert closes another way

If an alert is fixed or dismissed before you merge her fix, she closes her pull request with a comment saying why. The branch stays, so you can reopen it. Turn this off with security.closeStaleFixes.

Good to know

  • She reviews her own fix before she opens its pull request, like every pull request she opens.
  • She keeps at most five code scanning fixes open on a repository. A new query suite can raise hundreds of alerts at once; the rest wait until you merge or close one.
  • With security.codeScanning off, she still answers code scanning’s comments on a pull request and fixes what’s real, but dismisses nothing.

Was this page helpful?