-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
80 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Mozilla Code Coverage Backend | ||
|
||
This project is a Python 3 REST API, powered by [Flask](https://palletsprojects.com/p/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 developpers | ||
|
||
```shell | ||
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: | ||
|
||
```shell | ||
pytest | ||
flake8 | ||
``` | ||
|
||
## Run a redis instance through docker | ||
|
||
```shell | ||
docker run -v /tmp/ccov-redis:/data -p 6379:6379 redis | ||
``` | ||
|
||
## Run the webserver | ||
|
||
The development webserver will run on **http://localhost:8000** | ||
|
||
Using default secret `project-relman/code-coverage/dev`: | ||
|
||
```shell | ||
./run.sh | ||
``` | ||
|
||
You can specify any other secret as: | ||
|
||
```shell | ||
TASKCLUSTER_SECRET=path/to/secret ./run.sh | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
|
||
responses | ||
aresponses | ||
fakeredis | ||
flake8 | ||
flake8-isort | ||
pytest==4.3.1 | ||
pytest | ||
responses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/bin/bash | ||
export TASKCLUSTER_SECRET="project/relman/code-coverage/dev" | ||
if [[ ! $TASKCLUSTER_SECRET ]]; then | ||
export TASKCLUSTER_SECRET="project/relman/code-coverage/dev" | ||
echo 'Using dev secret' | ||
fi | ||
gunicorn --bind localhost:8000 --reload --reload-engine=poll --log-file=- code_coverage_backend.flask:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters