These APIs should be used by the clients connecting to the server to store and get results.
Any new client should only interact with the database through these APIs.
Table of Contents
- Available APIs
- API versioning
The report server API should be used by any client to view or store analysis results.
The authentication layer is used for supporting privileged-access only access and permission management.
The product management layer is responsible for handling requests about the different products and their configuration.
CodeChecker supports some backward compatibility between API versions.
The API version is automatically encoded into the
POST request URLs made by
Thrift in the following format:
make thrift in the web folder of CodeChecker will automatically
build each API version to the
For minor changes, these changes should go into the existing API files,
with appropriate Thrift-based versioning for
structs where necessary.
Minor version changes should not change the behaviour and the invocation of already existing functions, only extend the API:
- After implementing the changes to the existing API files and handlers,
you need to increase the
codechecker_web/shared/version.py. This dict stores for each major version, which is the highest supported minor version. In this case, simply increase the number by
- Change the
web/server/www/scripts/version.jsfile to represent the newest version, e.g.
For major changes, a new API must be defined. Start by creating a full
copy of the previous version's API to a new folder, e.g.
NOTE! Make sure the
Authenticationservice API contains the
checkAPIVersionfunction. Each client is expected to call this function to test if the server accepts its version.
- The new API definition (
thrift) files must have the
namespacetag appropriately suffixed, e.g.
- Register a new major version in the
codechecker_web/shared/version.py, but do NOT change the previous major version's setting. The first minor version for every major version is
- Change the
server/www/scripts/version.jsto use the newest API,
7.0in this case.
- Change the imports used in
productlist) to load the API client from the new version. Do the same with the Python code everywhere (including the tests) where API clients are used (
- Implement requesting actions via the new API in the command-line and the Web client.
- In the server, implement the API handlers for the new version as separate Python modules.
importthese new API handlers to the server module, and in the
do_POSTmethod of the server, set up that API requests through major version
7are routed to be handled by these new handlers. (Keep the formatting of imported names akin to those already in the file.)
Only major API versions can be deleted.
- Remove the
thriftAPI definition's folder from under
- Delete the API handler code from the server's files, and the routing
declarations in the
- In the
version.py, remove this major version's entry from the