GitLab
GitLab REST API v4 di gitlab.com atau self hosted (GITLAB_BASE_URL), project, issue, merge request, pipeline, file repository. Penulisan oleh agent harus diizinkan, merge dan commit hanya lewat node, variabel CI tidak pernah bisa dijangkau tool
Tentang
Plugin Graphrt untuk GitLab REST API v4 di gitlab.com atau GitLab self hosted. Plugin ini membaca project, issue, merge request, pipeline dan file repository, serta menulis issue, komentar dan merge request. Dibuat dengan lapisan REST deklaratif (definition.mjs) ditambah kebijakan tool agent, yaitu daftar path yang diizinkan untuk api_request (lib/tool-path-policy.mjs) dan daftar project yang boleh ditulis tool (lib/tool-call-policy.mjs).
Yang bisa dilakukan
- User and projects: get_current_user, list_projects, get_project
- Issues: list_issues, get_issue, create_issue, update_issue (incl. close/reopen), delete_issue (node only), list_issue_notes, create_issue_note
- Merge requests: list_merge_requests, get_merge_request, list_merge_request_diffs, create_merge_request, list_merge_request_notes, create_merge_request_note, merge_merge_request (node only)
- Pipelines: list_pipelines, get_pipeline, list_pipeline_jobs, retry_pipeline, cancel_pipeline, create_pipeline (node only)
- Repository files: get_file, list_repository_tree, create_file and update_file (node only)
- api_request: any other v4 endpoint (agents: GET only, on an allowlist of non-secret read paths)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Current user
gitlab.get_current_user - List projects
gitlab.list_projects - Get project
gitlab.get_project - List issues
gitlab.list_issues - Get issue
gitlab.get_issue - Create issue
gitlab.create_issue - Update issue
gitlab.update_issue - Delete issue
gitlab.delete_issue - List issue comments
gitlab.list_issue_notes - Comment on issue
gitlab.create_issue_note
Tampilkan semua 28 aksi
- List merge requests
gitlab.list_merge_requests - Get merge request
gitlab.get_merge_request - List merge request diffs
gitlab.list_merge_request_diffs - Create merge request
gitlab.create_merge_request - List MR comments
gitlab.list_merge_request_notes - Comment on merge request
gitlab.create_merge_request_note - Merge merge request
gitlab.merge_merge_request - List pipelines
gitlab.list_pipelines - Get pipeline
gitlab.get_pipeline - List pipeline jobs
gitlab.list_pipeline_jobs - Retry pipeline
gitlab.retry_pipeline - Cancel pipeline
gitlab.cancel_pipeline - Run pipeline
gitlab.create_pipeline - Get file
gitlab.get_file - List repository tree
gitlab.list_repository_tree - Commit a new file
gitlab.create_file - Commit a file change
gitlab.update_file - GitLab REST API request
gitlab.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
GITLAB_TOKENWajibPersonal, project or group access token (sent as Authorization: Bearer), or an OAuth token -
GITLAB_BASE_URLOpsionalInstance URL for self-hosted GitLab, e.g. https://gitlab.example.com (default https://gitlab.com) -
GITLAB_TOOL_ALLOW_WRITEOpsional1 lets agent tools create/update issues and merge requests and comment -
GITLAB_TOOL_ALLOW_CIOpsional1 lets agent tools retry and cancel pipelines -
GITLAB_TOOL_ALLOWED_PROJECTSFor tool writesComma-separated projects agent tools may write to (group/app, 42, * = any) -
GITLAB_TOOL_API_EXTRA_PATHSOpsionalMore read paths for agent api_request, e.g. /projects/*/environments -
GITLAB_TOOL_TOKEN_SOURCE
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari GitLab.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
$ graphrt plugin install gitlab - id: failed
type: gitlab.list_pipelines
project_id: acme/api
ref: main
status: failed
limit: 1
- id: jobs
type: gitlab.list_pipeline_jobs
project_id: acme/api
pipeline_id: "{{#failed.data.0.id#}}"
scope: [failed]