[feat/pipeline-support] feat: add USE_PIPELINE environment variable for conditional pipeline feature activation
✨ Breaking Changes: - Pipeline features are now opt-in via USE_PIPELINE environment variable 📝 Details: - Pipeline 관련 도구들을 USE_PIPELINE 환경 변수로 제어 가능하도록 변경 - USE_GITLAB_WIKI, USE_MILESTONE과 동일한 패턴으로 구현 - 기본값은 false로 설정되어 pipeline 기능은 명시적으로 활성화해야 함 - README에 USE_PIPELINE 환경 변수 설명 추가
This commit is contained in:
19
index.ts
19
index.ts
@ -192,6 +192,7 @@ const GITLAB_PERSONAL_ACCESS_TOKEN = process.env.GITLAB_PERSONAL_ACCESS_TOKEN;
|
||||
const GITLAB_READ_ONLY_MODE = process.env.GITLAB_READ_ONLY_MODE === "true";
|
||||
const USE_GITLAB_WIKI = process.env.USE_GITLAB_WIKI === "true";
|
||||
const USE_MILESTONE = process.env.USE_MILESTONE === "true";
|
||||
const USE_PIPELINE = process.env.USE_PIPELINE === "true";
|
||||
|
||||
// Add proxy configuration
|
||||
const HTTP_PROXY = process.env.HTTP_PROXY;
|
||||
@ -614,6 +615,18 @@ const milestoneToolNames = [
|
||||
"get_milestone_burndown_events",
|
||||
];
|
||||
|
||||
// Define which tools are related to pipelines and can be toggled by USE_PIPELINE
|
||||
const pipelineToolNames = [
|
||||
"list_pipelines",
|
||||
"get_pipeline",
|
||||
"list_pipeline_jobs",
|
||||
"get_pipeline_job",
|
||||
"get_pipeline_job_output",
|
||||
"create_pipeline",
|
||||
"retry_pipeline",
|
||||
"cancel_pipeline",
|
||||
];
|
||||
|
||||
/**
|
||||
* Smart URL handling for GitLab API
|
||||
*
|
||||
@ -2852,9 +2865,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
? tools0
|
||||
: tools0.filter(tool => !wikiToolNames.includes(tool.name));
|
||||
// Toggle milestone tools by USE_MILESTONE flag
|
||||
let tools = USE_MILESTONE
|
||||
const tools2 = USE_MILESTONE
|
||||
? tools1
|
||||
: tools1.filter(tool => !milestoneToolNames.includes(tool.name));
|
||||
// Toggle pipeline tools by USE_PIPELINE flag
|
||||
let tools = USE_PIPELINE
|
||||
? tools2
|
||||
: tools2.filter(tool => !pipelineToolNames.includes(tool.name));
|
||||
|
||||
// <<< START: Gemini 호환성을 위해 $schema 제거 >>>
|
||||
tools = tools.map(tool => {
|
||||
|
Reference in New Issue
Block a user