Sandbox reviewboard.hostingsvcs.service.HostingService
Review Request #6652 — Created Nov. 28, 2014 and discarded
Extensions that create a HostingService subclass (using the HostingServiceHook) can throw exceptions inside Reviewboard. The parts of Reviewboard that call those methods have been sandboxed.
Now when a HostingService subclass from an extension throws an exception; Reviewboard logs the errors with enough information to find which method in the HostingService subclass threw the exception.
Unit tests have been written to make sure that functions from a Widget subclass have been called, and when an exception is thrown it gets logged.
The tests fail without the sanboxing, and succeed with it.
Description | From | Last Updated |
---|---|---|
'SCMTool' imported but unused |
reviewbot | |
This will make it fail silently rather than reporting any errors to the user. |
david | |
This is still making it fail silently (reporting zero branches). Before it would tell the user about an error occurring. … |
david | |
Same here. |
david | |
And here. |
david |
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/tests.py reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/hostingsvcs/tests.py reviewboard/hostingsvcs/service.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/hostingsvcs/tests.py reviewboard/hostingsvcs/service.py
- Commit:
-
c215ebf8eaec7fe59b43cfad08464d92f6a720d3bd973dd408f9899d7e73899249c2cd1b06d5e153
- Diff:
-
Revision 4 (+237 -7)
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py
- Summary:
-
[WIP] Sandbox reviewboard.hostingsvcs.service.HostingServiceSandbox reviewboard.hostingsvcs.service.HostingService
- Testing Done:
-
Unit tests have been written to make sure that functions from a Widget subclass have been called, and when an exception is thrown it gets logged.
The tests fail without the sanboxing, and succeed with it.
- - TODO:
- Finish sandboxing the rest of the functions. - Finish testing the rest of the functions. - Commit:
-
bd973dd408f9899d7e73899249c2cd1b06d5e153e584dd2b6299cff6bd19e481185f7ac11c378d0e
- Diff:
-
Revision 5 (+238 -9)
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/scmtools/admin.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/scmtools/admin.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py
- Commit:
-
e584dd2b6299cff6bd19e481185f7ac11c378d0e6378c304d910fadea3e80d260ccff0a9919bdc63
- Diff:
-
Revision 6 (+253 -14)
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/scmtools/admin.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/models.py reviewboard/scmtools/models.py reviewboard/webapi/resources/remote_repository.py reviewboard/scmtools/tests.py reviewboard/scmtools/admin.py reviewboard/webapi/tests/test_remote_repository.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/tests.py
-
In your testing done, you say "Unit tests have been written to make sure that functions from a Widget subclass have been called, and when an exception is thrown it gets logged." That doesn't seem correct for this change.
-
This is still making it fail silently (reporting zero branches). Before it would tell the user about an error occurring.
These methods here should probably not be wrapped at all, because we expect them to throw exceptions and the proper error handling is already in place.