{"id":20414524,"url":"https://github.com/codecov/worker","last_synced_at":"2025-03-02T14:19:17.733Z","repository":{"id":184019769,"uuid":"665728948","full_name":"codecov/worker","owner":"codecov","description":"Code for Background Workers of Codecov","archived":false,"fork":false,"pushed_at":"2025-02-25T09:34:37.000Z","size":8354,"stargazers_count":53,"open_issues_count":25,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T10:04:23.765Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-12T21:38:48.000Z","updated_at":"2025-02-25T00:23:44.000Z","dependencies_parsed_at":"2023-12-18T13:53:14.789Z","dependency_job_id":"eff38143-2b57-44e9-b2f0-5a7a83367c3e","html_url":"https://github.com/codecov/worker","commit_stats":null,"previous_names":["codecov/worker"],"tags_count":438,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fworker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fworker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fworker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fworker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecov","download_url":"https://codeload.github.com/codecov/worker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241516013,"owners_count":19975143,"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","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-15T06:10:52.845Z","updated_at":"2025-03-02T14:19:17.727Z","avatar_url":"https://github.com/codecov.png","language":"Python","readme":"# worker\n\n![Actions](https://github.com/codecov/worker/actions/workflows/ci.yml/badge.svg)\n[![worker](https://codecov.io/github/codecov/worker/coverage.svg?branch=master\u0026token=BWTOrjBaE5)](https://codecov.io/github/codecov/worker)\n\n\u003e We believe that everyone should have access to quality software (like Sentry), that’s why we have always offered Codecov for free to open source maintainers.\n\u003e\n\u003e By making our code public, we’re not only joining the community that’s supported us from the start — but also want to make sure that every developer can contribute to and build on the Codecov experience.\n\nCode for Background Workers of Codecov. This is built on top of the `celery` async framework\n\n## Quickstart\n\n### Setting Virtual Env\n\nThis repo is set up with `direnv`, which will automatically\ncreate a virtualenv in `.venv` and activate the environment\nwhen you `cd` into the directory in your console.\n\nPlease take a look at [direnv](https://github.com/direnv/direnv/blob/master/docs/installation.md)\nfor more installation information.\n\n### Installing dependencies\n\nMake sure to:\n\n- Install rust. See https://www.rust-lang.org/tools/install\n- Have access to any private codecov repos listed in the requirements.txt file. See [here](https://codecovio.atlassian.net/wiki/spaces/ENG/pages/1270743045/Setup) for help on getting that set up.\n\nTo install the dependencies, run\n\n```\nuv sync\n```\n\n### Environment variables\n\nIn order to successfully run `make push`, you'll need to define the `CODECOV_WORKER_GCR_REPO_BASE` variable. See its use in [`Makefile`](Makefile) to understand what it's used for. An example is `gcr.io/your-project-here/codecov`. Codecov internal users, see [the env setup documentation](https://www.notion.so/sentry/Environment-variables-for-building-pushing-Docker-images-locally-3159e90c5e6f4db4bfbde8800cdad2c0?pvs=4) for our canonical defaults.\n\n### Running Tests Locally\n\nSimply:\n\n```\nmake test_env\n```\n\nWhat this does is start a few dependent databases with `docker-compose`,\nthen it runs the tests in the `worker` docker container.\n\n### Linting and Import Sorts\n\nInstall/run `black` and `isort` using\n\n```\nmake lint\n```\n\n### Getting into docker\n\nTo build this into a docker image:\n\n```\nmake build.base\nmake build\n```\n\nTo run this as part of the whole infrasctructure, you will be better served by getting the main codebase and running `docker-compose up` from there\n\n### Getting into enterprise mode\n\nTo generate an enterprise build, do\n\n```\nmake build.enterprise\n```\n\n## Versioning\n\nThe source of truth on which version we use is in the file `VERSION`. Every script that tags things with versions will consult that file to see what version it is.\n\nThat file is manually updated. We use semantic versioning.\n\nIf you are unsure whether you need to change that version at a given moment, the answer is that you probaby don't then. We have multiple deploys on the same version, and only change it when we want to cut a version to enterprise.\n\n## Upgrading Dependencies\n\nThis repository uses `uv` to manage dependencies.\nMake your dependency updates to `pyproject.toml` then run:\n\n```\nuv sync\n```\n\nto update the `uv.lock` file.\n\n### After deploying\n\nIf you are deploying or helping with a deploy, make sure to:\n\n1. Watch logs (on datadog and sentry)\n2. Monitor error rates and timing graphs on the dashboards we have set up\n\nAs the deployer, it is your responsibility to make sure the system is working as expected post-deploy. If not, you might need to do a rollback.\n\n## Code Structure\n\nBefore getting into changing the code, try to use the following structure (feel free to suggest changes.Some bits of it are based on our experience)\n\n- `helpers` - Those are the \"low\" level pieces of code, that don't depend on database models or any other heavy business logic. Those shouldn't depend on anything else on the codebase, preferrably\n- `database` - Those contain database models. They can use logic from `helpers` and other models, but nothing else. Try to avoid any heavy logic in this code.\n- `services` - Those are heavier pieces of logic, that don't talk to the external world. They can use `helpers` and `database` logic, and among themselves. But make sure that if a service _bravo_ depends on service _alpha_, then _alpha_ should not depend on any part of _bravo_\n- `tasks` - Those are the parts of the code that talk to the external world: it has the tasks that are triggered by external containers. They can depend on `helpers`, `models` and `services`, but NEVER depend on another task (except to schedule them). If some code is common to two tasks, try to put it in a `service` or somewhere else.\n\nYou will also notice some usage of the package https://github.com/codecov/shared for various things. The logic that is there is used by both here and `codecov/api` codebase. So feel free to make changes there, but dont do anything that will break compatibility too hard.\n\n## Contributing\n\nThis repository, like all of Codecov's repositories, strives to follow our general [Contributing guidlines](https://github.com/codecov/contributing). If you're considering making a contribution to this repository, we encourage review of our Contributing guidelines first.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecov%2Fworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fworker/lists"}