{"id":18603342,"url":"https://github.com/numberly/gitlab2sentry","last_synced_at":"2025-07-14T17:13:32.494Z","repository":{"id":41110268,"uuid":"466162033","full_name":"numberly/gitlab2sentry","owner":"numberly","description":"Our automation to ship a Sentry DSN for any Gitlab project ","archived":false,"fork":false,"pushed_at":"2024-10-08T13:10:41.000Z","size":183,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T22:33:42.402Z","etag":null,"topics":["gitlab","sentry"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numberly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-04T14:51:33.000Z","updated_at":"2025-03-30T00:49:05.000Z","dependencies_parsed_at":"2024-09-12T19:55:31.206Z","dependency_job_id":null,"html_url":"https://github.com/numberly/gitlab2sentry","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberly%2Fgitlab2sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberly%2Fgitlab2sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberly%2Fgitlab2sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberly%2Fgitlab2sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numberly","download_url":"https://codeload.github.com/numberly/gitlab2sentry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281404,"owners_count":21077423,"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":["gitlab","sentry"],"created_at":"2024-11-07T02:14:15.141Z","updated_at":"2025-04-10T19:31:35.531Z","avatar_url":"https://github.com/numberly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitlab2sentry\n\nGetting a Sentry project for each of your Gitlab repositories is just one MR merge away!\n\nGitlab2Sentry will create a Sentry project associated to each of your Gitlab repositories using a Merge Request based automated workflow.\n\nAny new Gitlab repository you create will be offered a Sentry project if you accept (merge the proposal MR) it with respect to the Gitlab group owning it!\n\n## Two-Steps process\n\n1. After creating your new project on Gitlab, `gitlab2sentry` will create a first Merge Request asking if you want it to create an associated Sentry project for it. This Merge Request will contain the creation of a `.sentryclirc` file which, if you merge it, will be contributed back the newly created Sentry project `DSN` for this project.\n\n2. If you merged the first Merge Request, `gitlab2sentry` will create a second one to update the newly created `.sentryclirc` file with the `DSN` of the sentry project. Moreover, after the merge of the first Merge Request `gitlabsentry` will create a new `sentry project`, update its rate limit and save the `DSN` inside `.sentryclirc`. Once you have merged this second Merge Request everything will be set up!\n\n**NOTE**: `Gitlab2Sentry` looks only for group projects and searches for MRs having specific keyword inside (check \"Configuration\" section)\n\n## Run locally\n\nYou can install all requirements for this project with:\n\n```bash\npython3 -m venv venv\npip3 install -r requirements.txt\nsource venv/bin/activate\n```\n\nAfter the installation of all requirements you have to:\n\n```bash\nexport SENTRY_URL=\u003cyour sentry's url\u003e\nexport SENTRY_TOKEN=\u003cyour sentry token\u003e\nexport SENTRY_ENV=\u003cyour environment - default production\u003e\nexport GITLAB_TOKEN=\u003cyour gitlab token\u003e\nexport GITLAB_URL=\u003cyour gitlab url\u003e\npython3 run.py\n```\n\n## Deployment\n\nWe prefer to deploy and manage `gitlab2sentry` with `helm`. Inside `helm/` folder you can find an example deployment.\n\nYou can upgrade your deployment with:\n\n```bash\nmake upgrade\n```\n\n## Configuration\n\n`Gitlab2Sentry` requires some configuration in 3 specific files.\n\n**[All configuration variables here](./docs/configuration.md)**\n\n1. First of all you have to configure the `helm/values-production.yaml` file where everything is configured for the `gitlab2sentry` service. Here you can find a description for every field:\n\n```yaml\n# Sentry values\n- name: SENTRY_TOKEN\n  valueFrom:\n    secretKeyRef:\n      key: SENTRY_TOKEN\n      name: gitlab2sentry-production\n- name: SENTRY_DSN\n  value: your-sentry-dsn\n- name: SENTRY_URL\n  value: your-sentry-url\n- name: SENTRY_ORG_SLUG\n  value: your-sentry-organization-slug\n# Gitlab values\n- name: GITLAB_TOKEN\n  valueFrom:\n    secretKeyRef:\n      key: GITLAB_TOKEN\n      name: your-secret\n- name: GITLAB_URL\n  value: your-gitlab-url\n  # DSN MR (1) values\n- name: GITLAB_DSN_MR_CONTENT\n  value: the content of your dsn mr\n- name: GITLAB_DSN_MR_DESCRIPTION\n  value: the description of your dsn mr\n- name: GITLAB_DSN_MR_BRANCH_NAME\n  value: your-branch-name\n- name: GITLAB_DSN_MR_TITLE\n  value: \"your-dsn-mr-title\"\n  # Sentryclirc MR (2) values\n- name: GITLAB_SENTRYCLIRC_MR_CONTENT\n  value: your-sentryclirc-mr-content\n- name: GITLAB_SENTRYCLIRC_MR_DESCRIPTION\n  value: your-sentryclirc-mr-description\n- name: GITLAB_SENTRYCLIRC_MR_BRANCH_NAME\n  value: your-sentryclirc-mr-branch-name\n- name: GITLAB_SENTRYCLIRC_MR_FILEPATH\n  value: .sentryclirc\n- name: GITLAB_SENTRYCLIRC_MR_COMMIT_MSG\n  value: your-commit-msg\n- name: GITLAB_SENTRYCLIRC_MR_TITLE\n  value: \"your sentryclirc mr title\"\n  # Gitlab configuration values\n- name: GITLAB_AUTHOR_NAME\n  value: author-name\n- name: GITLAB_AUTHOR_EMAIL\n  value: your-author-email\n- name: GITLAB_GRAPHQL_SUFFIX\n  value: api/graphql\n# - name: GITLAB_MENTIONS\n#   value:\n#     - \"@all\"\n- name: GITLAB_MENTIONS_ACCESS_LEVEL\n  value: 40 # maintainer\n- name: GITLAB_CREATION_DAYS_LIMIT\n  value: 60 # Max days old per project\n- name: GITLAB_MR_KEYWORD\n  value: sentry # key word for searching mrs\n- name: GITLAB_REMOVE_SOURCE\n  value: true # If the mr will remove the source branch\n- name: GITLAB_GROUP_IDENTIFIER\n  value: your-group-identifier # will look only for group projects having this identifier\n- name: GITLAB_AIOHTTP_TIMEOUT\n  value: 60\n- name: GITLAB_GRAPHQL_PAGE_LENGTH\n  value: 100\n- name: GITLAB_MR_LABEL_LIST\n  value: \"sentry,your-label\" # comma separated list of labels for the mr\n```\n\n2. If you want to follow the `helm` deployment process you will have to fill your details into the `helm/values-production.yaml` and `helm/Chart.yaml`.\n\n3. You can update `REG ?= your-registry` and `NS\t?= your-namespace` values inside `Makefile`.\n\n## Manual run\n\nIf you want to update a specific project (for example if the project has a very big name or is older than the `GITLAB_CREATION_DAYS_LIMIT` value), you can run the `gitlab2sentry` manually.\n\n- First, you have to `export` all env variables which are listed above in the `helm/values-production.yaml` file.\n\n- Next you can run the following commands:\n\n```python\n\u003e\u003e\u003e from gitlab2sentry import Gitlab2Sentry\n\u003e\u003e\u003e g2s = Gitlab2Sentry()\n\u003e\u003e\u003e g2s.update(full_path=\"projects_full_path\", custom_name=\"optional_custom_name\")\n```\n\n## Contributions \u0026 comments welcomed\n\nNumberly decided to Open Source this project because it saves a lot of time internally to all our developers and helped foster the mass adoption of Sentry in all our Tech teams. We hope this project can benefit someone else.\n\nFeel free to ask questions, suggest improvements and of course contribute features or fixes you might need!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberly%2Fgitlab2sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumberly%2Fgitlab2sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberly%2Fgitlab2sentry/lists"}