File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,11 +318,8 @@ The appsec child pipeline IID can be found in the parent pipeline's downstream p
318318The GitLab MCP tools don't include a job trace/log reader. To read job logs via the API:
319319
320320``` bash
321- # Extract the token from MCP config (project ID 355 = DataDog/apm-reliability/dd-trace-php)
322- jq -r ' .mcpServers.gitlab.env.GITLAB_PERSONAL_ACCESS_TOKEN' ~ /.claude.json
323-
324- # Then fetch job trace using the token
325- curl -s -H " PRIVATE-TOKEN: <TOKEN>" " https://gitlab.ddbuild.io/api/v4/projects/355/jobs/<JOB_ID>/trace" > /tmp/...
321+ # project ID 355 = DataDog/apm-reliability/dd-trace-php
322+ curl -s -H " PRIVATE-TOKEN: $GITLAB_PERSONAL_ACCESS_TOKEN " " https://gitlab.ddbuild.io/api/v4/projects/355/jobs/<JOB_ID>/trace" > /tmp/...
326323```
327324
328325### Monitoring CI Jobs
Original file line number Diff line number Diff line change 1313"""
1414
1515import argparse
16- import json
1716import os
1817import subprocess
1918import sys
5049
5150
5251def get_token () -> str :
53- config_path = Path .home () / ".claude.json"
54- config = json .loads (config_path .read_text ())
55- token = (
56- config .get ("mcpServers" , {})
57- .get ("gitlab" , {})
58- .get ("env" , {})
59- .get ("GITLAB_PERSONAL_ACCESS_TOKEN" )
60- )
61- if not token or token == "null" :
62- print ("ERROR: Could not extract GitLab token from ~/.claude.json" , file = sys .stderr )
63- sys .exit (1 )
64- return token
52+ token = os .environ .get ("GITLAB_PERSONAL_ACCESS_TOKEN" )
53+ if token and token != "null" :
54+ return token
55+
56+ print ("ERROR: GITLAB_PERSONAL_ACCESS_TOKEN is not set" , file = sys .stderr )
57+ sys .exit (1 )
6558
6659
6760def api_get (token : str , path : str , params : dict | None = None ) -> list | dict :
You can’t perform that action at this time.
0 commit comments