Add base support for code safety checkers.
Review Request #11904 — Created Jan. 4, 2022 and submitted
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.
Summary | ID |
---|---|
22e7af692bbf34511d35ef76a0ba3979a7fbde4b |
Description | From | Last Updated |
---|---|---|
E501 line too long (94 > 79 characters) |
reviewbot | |
F401 'reviewboard.codesafety.checkers.trojan_source.TrojanSourceCodeSafetyChecker' imported but unused |
reviewbot | |
F811 redefinition of unused 'test_render_file_alert_html' from line 38 |
reviewbot | |
E501 line too long (94 > 79 characters) |
reviewbot | |
Seems like "unicode" probably shouldn't be capitalized here? |
david | |
And here. |
david | |
Seems like an edit got messed up here. |
david | |
E501 line too long (94 > 79 characters) |
reviewbot | |
SafeString instead of SafeText? |
maubin | |
SafeString instead of SafeText? |
maubin | |
Just a thought--do we want to make this use an EntryPointRegistry instead? |
david |
- Change Summary:
-
- Removed a duplicate unit test.
- Removed an import that should have been in the next change in this series.
- Commits:
-
Summary ID 8e538985f072f2dfea5d740cf31bfa78e4042d8c fe0dbeb83b9ef724e9c1cd3b05d8f5262dbe8343 - Diff:
-
Revision 2 (+750)
- Change Summary:
-
Updated for release-5.0.x:
- Changed version numbers in docstrings
- Changed docs to use
Keys
andstr
. - Removed
six
usage - Removed
__future__
imports
- Commits:
-
Summary ID fe0dbeb83b9ef724e9c1cd3b05d8f5262dbe8343 2e025b3d97869424457f9dca7897d63837635d70 - Branch:
-
release-4.0.xrelease-5.0.x
- Diff:
-
Revision 3 (+730)
- Change Summary:
-
Update another docstring to use
Keys
. - Commits:
-
Summary ID 2e025b3d97869424457f9dca7897d63837635d70 28120f5a718e57cecc12c70c5fef231a5e52951d - Diff:
-
Revision 4 (+734)
Checks run (2 succeeded)
- Change Summary:
-
Changed
ugettext_lazy
togettext_lazy
. - Commits:
-
Summary ID 28120f5a718e57cecc12c70c5fef231a5e52951d d0544db2e6101d30bff7e94660d937f6d302650e - Diff:
-
Revision 5 (+734)
Checks run (2 succeeded)
- Change Summary:
-
Changed
SafeText
toSafeString
in docs. - Commits:
-
Summary ID d0544db2e6101d30bff7e94660d937f6d302650e 22e7af692bbf34511d35ef76a0ba3979a7fbde4b - Diff:
-
Revision 6 (+734)