{"id":13527491,"url":"https://github.com/loblaw-sre/backstage-plugin-gitlab","last_synced_at":"2025-05-09T00:02:37.139Z","repository":{"id":36975113,"uuid":"397365457","full_name":"loblaw-sre/backstage-plugin-gitlab","owner":"loblaw-sre","description":"Backstage plugin for Gitlab","archived":false,"fork":false,"pushed_at":"2023-04-24T05:13:09.000Z","size":1143,"stargazers_count":53,"open_issues_count":25,"forks_count":31,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-11T15:11:10.949Z","etag":null,"topics":["backstage","backstage-plugin","gitlab","gitlabci"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/loblaw-sre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-17T19:10:16.000Z","updated_at":"2024-11-05T05:05:59.000Z","dependencies_parsed_at":"2024-01-13T22:53:36.170Z","dependency_job_id":"24bb1a85-3143-4194-98c0-144b9b3d3df1","html_url":"https://github.com/loblaw-sre/backstage-plugin-gitlab","commit_stats":{"total_commits":75,"total_committers":18,"mean_commits":4.166666666666667,"dds":0.6666666666666667,"last_synced_commit":"8bb4808a121c189d39941451f5702675c8451bd7"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loblaw-sre%2Fbackstage-plugin-gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loblaw-sre%2Fbackstage-plugin-gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loblaw-sre%2Fbackstage-plugin-gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loblaw-sre%2Fbackstage-plugin-gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loblaw-sre","download_url":"https://codeload.github.com/loblaw-sre/backstage-plugin-gitlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166502,"owners_count":21864475,"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":["backstage","backstage-plugin","gitlab","gitlabci"],"created_at":"2024-08-01T06:01:49.225Z","updated_at":"2025-05-09T00:02:37.045Z","avatar_url":"https://github.com/loblaw-sre.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","others"],"sub_categories":[],"readme":"# Backstage GitLab Plugin\n\n[![Version](https://img.shields.io/npm/v/@loblaw/backstage-plugin-gitlab.svg)](https://www.npmjs.com/package/@loblaw/backstage-plugin-gitlab)\n![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)\n[![Downloads](https://img.shields.io/npm/dm/@loblaw/backstage-plugin-gitlab.svg)](https://www.npmjs.com/package/@loblaw/backstage-plugin-gitlab)\n[![License](https://img.shields.io/badge/license-Apache_License_2.0-blue.svg)](https://opensource.org/licenses/Apache_License_2.0)\n![Stars Badge](https://img.shields.io/github/stars/loblaw-sre/backstage-plugin-gitlab)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/loblaw-sre/backstage-plugin-gitlab)\n\n![Build Status](https://github.com/loblaw-sre/backstage-plugin-gitlab/workflows/Node.js%20Package/badge.svg)\n![](https://img.shields.io/github/commit-activity/m/loblaw-sre/backstage-plugin-gitlab)\n![](https://img.shields.io/github/contributors/loblaw-sre/backstage-plugin-gitlab)\n![](https://img.shields.io/github/last-commit/loblaw-sre/backstage-plugin-gitlab)\n\n![Language](https://img.shields.io/github/languages/top/loblaw-sre/backstage-plugin-gitlab?color=green\u0026logo=typescript\u0026logoColor=blue)\n![](https://img.shields.io/github/issues/loblaw-sre/backstage-plugin-gitlab)\n![](https://img.shields.io/github/issues-closed/loblaw-sre/backstage-plugin-gitlab)\n[![Repo Size](https://img.shields.io/github/repo-size/loblaw-sre/backstage-plugin-gitlab)](https://github.com/loblaw-sre/backstage-plugin-gitlab)\n[![](https://img.shields.io/github/languages/code-size/loblaw-sre/backstage-plugin-gitlab)](https://github.com/loblaw-sre/backstage-plugin-gitlab)\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Floblaw-sre%2Fbackstage-plugin-gitlab\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=Visitors\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n\n\nWebsite: [https://gitlab.com/](https://gitlab.com/)\n\n\u003cimg src=\"https://raw.githubusercontent.com/loblaw-sre/backstage-plugin-gitlab/main/src/assets/Backstage_Gitlab_Pipeline_Information.png\"  alt=\"Contributors Languages Pipeline Status\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/loblaw-sre/backstage-plugin-gitlab/main/src/assets/Backstage_Gitlab_Merge_Request_information.png\"  alt=\"Merge Request Information\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/loblaw-sre/backstage-plugin-gitlab/main/src/assets/Backstage_Gitlab_Issue_Information.png\"  alt=\"Issue Information\"/\u003e\n\n## Setup\n\n1. If you have a standalone app (you didn't clone this repo), then do\n\n```bash\n# From your Backstage root directory\ncd packages/app\nyarn add @loblaw/backstage-plugin-gitlab\n```\n\n\n2. Add a new GitLab tab to the entity page.\n\n```tsx\n// packages/app/src/components/catalog/EntityPage.tsx\n\nimport { isGitlabAvailable, EntityGitlabContent } from '@loblaw/backstage-plugin-gitlab';\n\n// Farther down at the serviceEntityPage declaration\nconst serviceEntityPage = (\n  \u003cEntityLayout\u003e\n    {/* Place the following section where you want the tab to appear */}\n    \u003cEntityLayout.Route if={isGitlabAvailable} path=\"/gitlab\" title=\"Gitlab\"\u003e\n       \u003cEntityGitlabContent /\u003e\n    \u003c/EntityLayout.Route\u003e\n  \u003c/EntityLayout\u003e\n);\n```\n3. Add the GitLab cards to the Overview tab on the entity page(Optional).\n\n```tsx\n// packages/app/src/components/catalog/EntityPage.tsx\n\nimport {\n  isGitlabAvailable,\n  EntityGitlabContent,\n  EntityGitlabLanguageCard,\n  EntityGitlabContributorsCard,\n  EntityGitlabMergeRequestsTable,\n  EntityGitlabMergeRequestStatsCard,\n  EntityGitlabPipelinesTable\n} from '@loblaw/backstage-plugin-gitlab';\n\n//Farther down at the overviewContent declaration\n//You can add only selected widgets or all of them.\nconst overviewContent = (\n  \u003cGrid container spacing={3} alignItems=\"stretch\"\u003e\n    \u003cEntitySwitch\u003e\n      \u003cEntitySwitch.Case if={isGitlabAvailable}\u003e\n        \u003cGrid item md={6}\u003e\n          \u003cEntityGitlabContributorsCard /\u003e\n          \u003cEntityGitlabLanguageCard /\u003e\n          \u003cEntityGitlabMergeRequestStatsCard /\u003e\n          \u003cEntityGitlabPipelinesTable /\u003e\n          \u003cEntityGitlabMergeRequestsTable /\u003e\n        \u003c/Grid\u003e\n      \u003c/EntitySwitch.Case\u003e\n    \u003c/EntitySwitch\u003e\n  \u003c/Grid\u003e\n);\n```\n\n4. Add integration:\nIn `app-config.yaml` add the integration for gitlab:\n```\nintegrations:\n  gitlab:\n    - host: gitlab.com\n      token: ${GITLAB_TOKEN}\n```\n\n5. Add proxy config:\n\n```\n  '/gitlabci':\n    target: '${GITLAB_URL}/api/v4'\n    allowedMethods: ['GET']\n    headers:\n      PRIVATE-TOKEN: '${GITLAB_TOKEN}'\n```\n\n* Default GitLab URL: `https://gitlab.com`\n* GitLab Token should be with of scope `read_api` and can be generated from this [URL](https://gitlab.com/-/profile/personal_access_tokens)\n\n5. Add a `gitlab.com/project-id` annotation to your respective `catalog-info.yaml` files, on the [format](https://backstage.io/docs/architecture-decisions/adrs-adr002#format)\n\n```yaml\n# Example catalog-info.yaml entity definition file\napiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n  # ...\n  annotations:\n      gitlab.com/project-id: 'project-id' #1234. This must be in quotes and can be found under Settings --\u003e General\n      or\n      gitlab.com/project-slug: 'project-slug' # group_name/project_name\nspec:\n  type: service\n  # ...\n```\n\n**Note:** `spec.type` can take values in ['website','library','service'] but to render GitLab Entity, Catalog must be of type `service`\n\n## Features\n\n- List top 20 builds for a project\n- List top 20 Merge Requests for a project\n- List top 20 Issues for a project\n- View Contributors for a project\n- View Languages used for a project\n- View Pipeline status for a project\n- Works for both project and personal tokens\n- Pagination for builds\n- Pagination for Merge Requests\n- Merge Requests Statistics\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floblaw-sre%2Fbackstage-plugin-gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floblaw-sre%2Fbackstage-plugin-gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floblaw-sre%2Fbackstage-plugin-gitlab/lists"}