code-coverage/backend
Marco Castelluccio e2d1a5a043 Version 1.3.35 2024-11-12 12:14:09 +01:00
..
code_coverage_backend Run prettier on the whole repo 2024-10-21 17:22:32 +02:00
tests
tools
Dockerfile build(deps): bump python from 3.12.4-slim to 3.12.6-slim in /backend (#2459) 2024-09-18 16:01:00 +02:00
MANIFEST.in
README.md Run prettier on the whole repo 2024-10-21 17:22:32 +02:00
VERSION Version 1.3.35 2024-11-12 12:14:09 +01:00
requirements-dev.txt build(deps-dev): bump fakeredis from 2.25.1 to 2.26.1 in /backend (#2523) 2024-11-12 11:29:30 +01:00
requirements.txt build(deps): bump redis from 5.1.1 to 5.2.0 in /backend (#2524) 2024-11-12 11:29:21 +01:00
run.sh
settings.py
setup.py

README.md

Mozilla Code Coverage Backend

This project is a Python 3 REST API, powered by Flask that serves code coverage data aggregated by the bot project.

The production instance of this service is hosted on https://api.coverage.moz.tools

We currently have several endpoints implemented:

  • /v2/extensions lists all the file extensions supported by the code coverage suite,
  • /v2/latest lists the 10 latest code coverage reports ingested on the backend and available to query,
  • /v2/history shows the code coverage progression for a specific path in a repository,
  • /v2/path provides the code coverage information for a directory or file in a repository, at a given revision.

Setup instructions for developers

mkvirtualenv -p /usr/bin/python3 ccov-backend
cd backend/
pip install -r requirements.txt -r requirements-dev.txt
pip install -e .

You should now be able to run tests and linting:

pre-commit run -a

Run a redis instance through docker

docker run -v /tmp/ccov-redis:/data -p 6379:6379 redis

Run the webserver

The development webserver will run on http://localhost:8000

You need to setup a local YAML configuration file, with the following content:

---
common:
  APP_CHANNEL: dev
  GOOGLE_CLOUD_STORAGE: null

Using your local configuration:

LOCAL_CONFIGURATION=/path/to/code-coverage-conf.yml ./run.sh

You can specify a firefox-ci Taskcluster secret (e.g. project-relman/code-coverage/dev) instead using:

TASKCLUSTER_SECRET=path/to/secret ./run.sh

Help

You can reach us on our Matrix instance: #codecoverage:mozilla.org