{"id":19307389,"url":"https://github.com/artefactory/github_tests_validator_app","last_synced_at":"2025-07-25T19:33:37.466Z","repository":{"id":206460709,"uuid":"513085624","full_name":"artefactory/github_tests_validator_app","owner":"artefactory","description":"github_tests_validator_app is a GitHub Application you can deploy on your own to retrieve test results from forked projects.","archived":false,"fork":false,"pushed_at":"2025-01-24T16:24:27.000Z","size":368,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T02:49:55.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artefactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-12T09:48:37.000Z","updated_at":"2025-01-30T17:13:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"60af2687-aad5-4e05-8ccc-edfcb8017e79","html_url":"https://github.com/artefactory/github_tests_validator_app","commit_stats":null,"previous_names":["artefactory/github_tests_validator_app"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/artefactory/github_tests_validator_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Fgithub_tests_validator_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Fgithub_tests_validator_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Fgithub_tests_validator_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Fgithub_tests_validator_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artefactory","download_url":"https://codeload.github.com/artefactory/github_tests_validator_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Fgithub_tests_validator_app/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267053009,"owners_count":24028030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:10:46.385Z","updated_at":"2025-07-25T19:33:37.369Z","avatar_url":"https://github.com/artefactory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github_tests_validator_app\n\n\u003cdiv align=\"center\"\u003e\n\n[![CI status](https://github.com/artefactory/github_tests_validator_app/actions/workflows/ci.yml/badge.svg?branch%3Amain\u0026event%3Apush)](https://github.com/artefactory/github_tests_validator_app/actions/workflows/ci.yml?query=branch%3Amain)\n[![CD status](https://github.com/artefactory/github_tests_validator_app/actions/workflows/cd.yml/badge.svg?event%3Arelease)](https://github.com/artefactory/github_tests_validator_app/actions/workflows/cd.yml?query=event%3Arelease)\n[![Python Version](https://img.shields.io/badge/Python-3.9-informational.svg)](#supported-python-versions)\n[![Releases](https://img.shields.io/badge/%F0%9F%9A%80-releases-informational.svg)](https://github.com/artefactory/github_tests_validator_app/releases)\n\n\n`github_tests_validator_app` is a GitHub Application you can deploy on your own to retrieve test results from forked projects.\n\nHere is how it works :\n\n![Architecture](docs/architecture.png)\n\nThe main purpose of this project is for education.\n\nOften, Computer Science teachers can have a main repository and ask their students to fork their repository to complete the courses from their repository.\n\nStudents never merge their repository into the main one, so it can be tedious for teachers to retrieve informations about the results from their exercices.\n\nBy deploying a GitHub App and asking their students to install this app on their GitHub forked projects, teachers can retrieve automatically the results from their tests (using [pytest](https://docs.pytest.org/en/7.1.x/)) into Google Sheets.\n\n\u003c/div\u003e\n\n## Prerequisites\n\n1) You need to [create a GitHub App](https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app) in your organization or personal account on GitHub\n2) For GCP cloud run deployment, you may need to install terraform and the gcloud CLI.\n\n## GitHub App\n\nYour GitHub App needs the following informations :\n\n### Repository permissions\n- Actions: RO\n- Checks: RW # create a check on PR\n- Issues: RW # comment the issue\n- Contents: RO\n- Pull requests: RW # comment the issue\n\n### Subscribe to events\n- Pull request\n- Push\n- Workflow job\n\n## Deploy locally\n\nYou first need to create a `.env` file by filling up the values from the `.env.template` file.\nMore details about each of these values [below](#environment-variables-details).\n\nYou can start the GitHub App backend locally with the following command :\n\n```bash\ndocker run -d --rm -p 127.0.0.1:8080:8080 --env-file .env ghcr.io/artefactory/github_tests_validator_app:latest\n```\n\nThen you can use [smee.io](https://smee.io/) or [ngrok](https://ngrok.com/) to serve your applications running locally.\n\n## Deploy in the cloud\n\nWith Cloud Run, you have an example terraform configuration [here](https://github.com/artefactory/github_tests_validator_app/blob/main/examples/cloud_run/).\n\nBut you can deploy the application on many Serverless Container services on any cloud by making sure that :\n- The secrets defined in the `.env` file are available for the container at runtime as environment variables\n- The container can receive HTTP requests\n- The container can login to any data warehouse with a SQLAlchemy Connection URI : [Bigquery](https://googleapis.dev/python/sqlalchemy-bigquery/latest/README.html#usage), [Snowflake](https://docs.snowflake.com/en/user-guide/sqlalchemy.html#connection-parameters), [Redshift](https://aws.amazon.com/fr/blogs/big-data/use-the-amazon-redshift-sqlalchemy-dialect-to-interact-with-amazon-redshift/) \n\n## Environment variables details\n\n- GH_APP_ID : Auto-generated ID of the GitHub App you created during the [`Prerequisites`](#prerequisites) step.\n- GH_APP_KEY : Private Key of the GitHub App you created during the [`Prerequisites`](#prerequisites) step.\n- GH_PAT : GitHub personal access token [you must create](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) that has access to the GitHub repository containing the tests and the original repository which was forked (both could be the same repository).\n- SQLALCHEMY_URI : Database URI with [SQLAlchemy format](https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls)\n- LOGGING : \"LOCAL\" if you are deploying locally, \"GCP\" if you are deploying on Google Cloud Run.\n- GH_TESTS_REPO_NAME : (Optional, only if you are using a git submodule for the tests folder) Name of the repository containing the tests (could be convenient if you have a repository with the exercices, and another one with the solutions and you want to have the same tests in both repositories by providing a submodule defined in a third repository).\n\n## Contributing\n\nCheck the guide here : [CONTRIBUTING](https://github.com/artefactory/github_tests_validator_app/blob/main/CONTRIBUTING.md)\n\n### Makefile usage\n\n[`Makefile`](https://github.com/artefactory/github_tests_validator_app/blob/main/Makefile) contains many functions for fast assembling and convenient work.\n\n\u003cdetails\u003e\n\u003csummary\u003e1. Download Poetry\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake download-poetry; export PATH=\"$HOME/.local/bin:$PATH\"\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e2. Install all dependencies and pre-commit hooks\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake install\n```\n\nIf you do not want to install pre-commit hooks, run the command with the NO_PRE_COMMIT flag:\n\n```bash\nmake install NO_PRE_COMMIT=1\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e3. Check the security of your code\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake check-safety\n```\n\nThis command launches a `Poetry` and `Pip` integrity check as well as identifies security issues with `Safety` and `Bandit`. By default, the build will crash if any of the items fail. But you can set `STRICT=0` for the entire build, and then you can configure strictness for each item separately.\n\n```bash\nmake check-safety STRICT=0\n```\n\nor only for `safety`:\n\n```bash\nmake check-safety STRICT=0 SAFETY_STRICT=1\n```\n\nmultiple\n\n```bash\nmake check-safety STRICT=0 PIP_STRICT=1 SAFETY_STRICT=1\n```\n\n\u003e List of flags for `check-safety` (can be set to `1` or `0`): `STRICT`, `POETRY_STRICT`, `PIP_STRICT`, `SAFETY_STRICT`, `BANDIT_STRICT`.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e4. Check the codestyle\u003c/summary\u003e\n\u003cp\u003e\n\nThe command is similar to `check-safety` but to check the code style, obviously. It uses `Black`, `Darglint`, `Isort`, and `Mypy` inside.\n\n```bash\nmake check-style\n```\n\nIt may also contain the `STRICT` flag.\n\n```bash\nmake check-style STRICT=0\n```\n\n\u003e List of flags for `check-style` (can be set to `1` or `0`): `STRICT`, `BLACK_STRICT`, `DARGLINT_STRICT`, `ISORT_STRICT`, `MYPY_STRICT`.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e5. Run all the codestyle formatters\u003c/summary\u003e\n\u003cp\u003e\n\nCodestyle uses `pre-commit` hooks, so ensure you've run `make install` before.\n\n```bash\nmake format-code\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e6. Run tests\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake test\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e7. Run all the linters\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake lint\n```\n\nthe same as:\n\n```bash\nmake test \u0026\u0026 make check-safety \u0026\u0026 make check-style\n```\n\n\u003e List of flags for `lint` (can be set to `1` or `0`): `STRICT`, `POETRY_STRICT`, `PIP_STRICT`, `SAFETY_STRICT`, `BANDIT_STRICT`, `BLACK_STRICT`, `DARGLINT_STRICT`, `PYUPGRADE_STRICT`, `ISORT_STRICT`, `MYPY_STRICT`.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e8. Build docker\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake docker\n```\n\nwhich is equivalent to:\n\n```bash\nmake docker VERSION=latest\n```\n\nMore information [here](https://github.com/artefactory/github_tests_validator_app}/tree/main/docker).\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e9. Cleanup docker\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake clean_docker\n```\n\nor to remove all build\n\n```bash\nmake clean\n```\n\nMore information [here](https://github.com/artefactory/github_tests_validator_app}/tree/main/docker).\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003e10. Activate virtualenv\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\npoetry shell\n```\n\nTo deactivate the virtual environment :\n\n```bash\ndeactivate\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e11. Deploy on GCP\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nmake deploy_gcp\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartefactory%2Fgithub_tests_validator_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartefactory%2Fgithub_tests_validator_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartefactory%2Fgithub_tests_validator_app/lists"}