Add base support for code safety checkers.

Review Request #11904 — Created Jan. 4, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

Review Board's focus historically has been to provide tools for
automatically or manually catching problems with code before it goes
into a product. The automatic checks come by way of extensions like
Review Bot, and these can only check code once it's been published.

There are issues that are best caught before code goes up for review,
and there are also issues that are best caught by default without
needing to install a tool like Review Bot.

Two examples would be credentials accidentally left in code and
so-called "Trojan Source" attacks (where code is either accidentally or
intentionally added to a file that displays one way to a user but
executes another way).

This begins laying the foundation for code safety checkers, which can
look for suspicious content in code before it's ready for review,
flagging issues that are found.

This will be used in the diff validation API and the diff viewer to
highlight any issues that are found. Specific code safety checkers will
be implemented in future changes.

Unit tests pass.

Tested this along with a code checker implementation and the upcoming
diff viewer updates.

Diff Revision 6 (Latest)

orig
1
2
3
4
5
6

Commits

First Last Summary ID Author
Add base support for code safety checkers.
Review Board's focus historically has been to provide tools for automatically or manually catching problems with code before it goes into a product. The automatic checks come by way of extensions like Review Bot, and these can only check code once it's been published. There are issues that are best caught before code goes up for review, and there are also issues that are best caught by default without needing to install a tool like Review Bot. Two examples would be credentials accidentally left in code and so-called "Trojan Source" attacks (where code is either accidentally or intentionally added to a file that displays one way to a user but executes another way). This begins laying the foundation for code safety checkers, which can look for suspicious content in code before it's ready for review, flagging issues that are found. This will be used in the diff validation API and the diff viewer to highlight any issues that are found. Specific code safety checkers will be implemented in future changes.
22e7af692bbf34511d35ef76a0ba3979a7fbde4b Christian Hammond
reviewboard/codesafety/__init__.py
reviewboard/codesafety/checkers/__init__.py
reviewboard/codesafety/checkers/base.py
reviewboard/codesafety/checkers/registry.py
reviewboard/codesafety/tests/__init__.py
reviewboard/codesafety/tests/test_base_code_safety_checker.py
Loading...