当前位置: 首页 > news >正文

CircleCI自动化_circleci-automation

以下为本文档的中文说明

这是一个通过 Rube MCP(Model Context Protocol)中间件来自动化 CircleCI CI/CD 操作的技能。它基于 Composio 平台的 CircleCI 工具集,通过 Rube MCP 桥接 AI 代理与 CircleCI API 的交互,使得用户可以通过自然语言指令完成复杂的 CI/CD 管理任务。使用场景包括:需要触发新的流水线运行(Trigger Pipeline)、监控管道和工作流状态(Monitor Pipelines and Workflows)、查看具体的 Job 执行详情(Inspect Job Details)、获取构建产物(Retrieve Build Artifacts)以及检查测试结果(Review Test Metadata)。核心操作流程遵循严格的先决条件检查:首先确认 Rube MCP 可用,然后通过 RUBE_MANAGE_CONNECTIONS 建立 CircleCI 连接,确认连接状态为 ACTIVE 后才开始执行工作流。该技能提供了完整的参数说明和陷阱提示,例如 project_slug 的格式必须是 {vcs}/{org}/{repo}(如 gh/myorg/myrepo),branch 和 tag 参数互斥不能同时使用,以及 Pipeline ID 和工作流 ID 是 UUID 格式而 Job Number 是整数格式。它还定义了 Pipeline → Workflow → Job 的三层调用层级关系,以及分页处理的规范。此外,该技能覆盖了常见的错误处理和速率限制应对策略,如指数退避(Exponential Backoff)和合理的轮询间隔(5-10 秒),适合在生产环境中使用。


CircleCI Automation via Rube MCP

Automate CircleCI CI/CD operations through Composio’s CircleCI toolkit via Rube MCP.

Prerequisites

  • Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
  • Active CircleCI connection viaRUBE_MANAGE_CONNECTIONSwith toolkitcircleci
  • Always callRUBE_SEARCH_TOOLSfirst to get current tool schemas

Setup

Get Rube MCP: Addhttps://rube.app/mcpas an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.

  1. Verify Rube MCP is available by confirmingRUBE_SEARCH_TOOLSresponds
  2. CallRUBE_MANAGE_CONNECTIONSwith toolkitcircleci
  3. If connection is not ACTIVE, follow the returned auth link to complete CircleCI authentication
  4. Confirm connection status shows ACTIVE before running any workflows

Core Workflows

1. Trigger a Pipeline

When to use: User wants to start a new CI/CD pipeline run

Tool sequence:

  1. CIRCLECI_TRIGGER_PIPELINE- Trigger a new pipeline on a project [Required]
  2. CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- Monitor resulting workflows [Optional]

Key parameters:

  • project_slug: Project identifier in formatgh/org/repoorbb/org/repo
  • branch: Git branch to run the pipeline on
  • tag: Git tag to run the pipeline on (mutually exclusive with branch)
  • parameters: Pipeline parameter key-value pairs

Pitfalls:

  • project_slugformat is{vcs}/{org}/{repo}(e.g.,gh/myorg/myrepo)
  • branchandtagare mutually exclusive; providing both causes an error
  • Pipeline parameters must match those defined in.circleci/config.yml
  • Triggering returns a pipeline ID; workflows start asynchronously

2. Monitor Pipelines and Workflows

When to use: User wants to check the status of pipelines or workflows

Tool sequence:

  1. CIRCLECI_LIST_PIPELINES_FOR_PROJECT- List recent pipelines for a project [Required]
  2. CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- List workflows within a pipeline [Required]
  3. CIRCLECI_GET_PIPELINE_CONFIG- View the pipeline configuration used [Optional]

Key parameters:

  • project_slug: Project identifier in{vcs}/{org}/{repo}format
  • pipeline_id: UUID of a specific pipeline
  • branch: Filter pipelines by branch name
  • page_token: Pagination cursor for next page of results

Pitfalls:

  • Pipeline IDs are UUIDs, not numeric IDs
  • Workflows inherit the pipeline ID; a single pipeline can have multiple workflows
  • Workflow states include: success, running, not_run, failed, error, failing, on_hold, canceled, unauthorized
  • page_tokenis returned in responses for pagination; continue until absent

3. Inspect Job Details

When to use: User wants to drill into a specific job’s execution details

Tool sequence:

  1. CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID- Find workflow containing the job [Prerequisite]
  2. CIRCLECI_GET_JOB_DETAILS- Get detailed job information [Required]

Key parameters:

  • project_slug: Project identifier
  • job_number: Numeric job number (not UUID)

Pitfalls:

  • Job numbers are integers, not UUIDs (unlike pipeline and workflow IDs)
  • Job details include executor type, parallelism, start/stop times, and status
  • Job statuses: success, running, not_run, failed, retried, timedout, infrastructure_fail, canceled

4. Retrieve Build Artifacts

When to use: User wants to download or list artifacts produced by a job

Tool sequence:

  1. CIRCLECI_GET_JOB_DETAILS- Confirm job completed successfully [Prerequisite]
  2. CIRCLECI_GET_JOB_ARTIFACTS- List all artifacts from the job [Required]

Key parameters:

  • project_slug: Project identifier
  • job_number: Numeric job number

Pitfalls:

  • Artifacts are only available after job completion
  • Each artifact has apathandurlfor download
  • Artifact URLs may require authentication headers to download
  • Large artifacts may have download size limits

5. Review Test Results

When to use: User wants to check test outcomes for a specific job

Tool sequence:

  1. CIRCLECI_GET_JOB_DETAILS- Verify job ran tests
    [Prerequisite]
  2. CIRCLECI_GET_TEST_METADATA- Retrieve test results and metadata [Required]

Key parameters:

  • project_slug: Project identifier
  • job_number: Numeric job number

Pitfalls:

  • Test metadata requires the job to have uploaded test results (JUnit XML format)
  • If no test results were uploaded, the response will be empty
  • Test metadata includes classname, name, result, message, and run_time fields
  • Failed tests include failure messages in themessagefield

Common Patterns

Project Slug Format

Format: {vcs_type}/{org_name}/{repo_name} - GitHub: gh/myorg/myrepo - Bitbucket: bb/myorg/myrepo

Pipeline -> Workflow -> Job Hierarchy

1. Call CIRCLECI_LIST_PIPELINES_FOR_PROJECT to get pipeline IDs 2. Call CIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_ID with pipeline_id 3. Extract job numbers from workflow details 4. Call CIRCLECI_GET_JOB_DETAILS with job_number

Pagination

  • Check response fornext_page_tokenfield
  • Pass token aspage_tokenin next request
  • Continue untilnext_page_tokenis absent or null

Known Pitfalls

ID Formats:

  • Pipeline IDs: UUIDs (e.g.,5034460f-c7c4-4c43-9457-de07e2029e7b)
  • Workflow IDs: UUIDs
  • Job numbers: Integers (e.g.,123)
  • Do NOT mix up UUIDs and integers between different endpoints

Project Slugs:

  • Must include VCS prefix:gh/for GitHub,bb/for Bitbucket
  • Organization and repo names are case-sensitive
  • Incorrect slug format causes 404 errors

Rate Limits:

  • CircleCI API has per-endpoint rate limits
  • Implement exponential backoff on 429 responses
  • Avoid rapid polling; use reasonable intervals (5-10 seconds)

Quick Reference

TaskTool SlugKey Params
Trigger pipelineCIRCLECI_TRIGGER_PIPELINEproject_slug, branch, parameters
List pipelinesCIRCLECI_LIST_PIPELINES_FOR_PROJECTproject_slug, branch
List workflowsCIRCLECI_LIST_WORKFLOWS_BY_PIPELINE_IDpipeline_id
Get pipeline configCIRCLECI_GET_PIPELINE_CONFIGpipeline_id
Get job detailsCIRCLECI_GET_JOB_DETAILSproject_slug, job_number
Get job artifactsCIRCLECI_GET_JOB_ARTIFACTSproject_slug, job_number
Get test metadataCIRCLECI_GET_TEST_METADATAproject_slug, job_number

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
http://www.gsyq.cn/news/1584762.html

相关文章:

  • 花5万买串口屏,总结出的7条血泪教训做储能设备的千万别再踩坑
  • 鸿蒙PC中使用ohos-sdk完成Rust适配,自动签名编译安装第三方库walkdir是 Rust 递归遍历目录的专用库
  • 一篇文章带你入门漏洞靶场:从 0 到 1 玩转 bWAPP(附完整安装教程)
  • 屏幕截图文字识别工具帮你屏幕截图取字
  • 5分钟搞定OpenCode Go套餐无缝接入Claude Code,性价比直接起飞!
  • 在MacOS上如何安装配置工时通
  • HoRain云--R循环实战:从语法到高效向量化技巧
  • 使用 Python 调用商品条形码查询API并解析商品信息
  • FAST-LIVO2 源码精读(九):VoxelMap 体素地图——哈希索引与八叉树平面拟合
  • 西瓜/甜瓜智能病虫害防控喷雾机上位机 Qt信创完整项目
  • 第31章:构建自定义Code Agent——打造专属的代码助手
  • Power BI 6 月重磅更新:9 大新功能全面提升数据分析效率
  • 【ComfyUI】在Windows电脑上安装 ComfyUI并通过python脚本调用API批量生成图片
  • window显示驱动开发-Direct3D 着色器代码
  • 计算机毕业设计之网络商城系统的设计与实现
  • TVA在机电产品视觉检测的创新应用(13)
  • 告别重复造轮子:C#抽象机器人控制层,兼容ABB/安川/发那科
  • Python之stubsplit包语法、参数和实际应用案例
  • 第六章—18—数据容器的通用操作
  • Kimi LeetCode 3347. 执行操作后元素的最高频率 II C语言实现
  • 【第十期】高级进阶篇:自动化与智能化 —— 如何用 Python 和 AI 辅助挖掘漏洞?
  • 2026-06-23:合并靠近字符。用go语言,现有仅含小写字母的字符串s与整数k,规则说明如下: 1. 判定标准:同一字符串里,若两个相同字母的位置索引差值不超过k,这两个字符视作相邻靠近字符。 2
  • HarmonyOS 6商城开发学习:平板竖屏下的底部“飞件“事故——用 layoutWeight 替掉 position 与 Stack 的响应式救火
  • 项目实训(十一)| 学习路线模块:个性化学习路线生成
  • 【Linux基础】Linux 必学基础指令:echo/cat/ 重定向 / 查找命令全解析
  • 阿里通义千问,8元叠加券,真的可以领到,真没有套路,真不用拉人头,实打实的,就是这么简单!
  • 信创业务技术全景解析:从项目实施到国密安全,一文读懂信创落地核心技术体系(PPT)
  • 《个人头像上传》二、Preferences用户首选项使用指南
  • TVA在机电产品视觉检测的创新应用(11)
  • 华为OD机试真题-预测新能源发电量(C/C++/Py/Java/Js/Go)