dx-devops-request-status
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDevOps Center Request Status
DevOps Center 请求状态
Polls the status of an asynchronous DevOps Center request — a promotion or deploy operation — by its request token via . Provides headless, -driven, read-only status checks for autonomous release workflows in CI. This skill never mutates pipeline state; it only reports the current status of an in-flight or completed request.
sf devops request status--json通过命令,根据请求令牌轮询异步DevOps Center请求的状态——包括晋升(promotion)或部署(deploy)操作。为CI中的自动化发布工作流提供无界面、基于格式的只读状态检查。此技能绝不会修改流水线状态,仅报告正在进行或已完成请求的当前状态。
sf devops request status--jsonScope
适用范围
- In scope: Check the status of a single async request by its request token; interpret the two-level outcome (request-processing vs. the
.result.statusfailure oracle); poll with backoff until a request finishes or a caller-supplied timeout is reached; surface parsed error details on failure.result.errorDetails - Out of scope: Initiating a promotion or deploy (use ), work item creation/status updates (use
dx-devops-promote), conflict detection, runningdx-devops-work-item-manage(that is the caller's next step after this skill confirms success), pipeline or project setupsf devops promotion complete
- 适用场景:根据请求令牌检查单个异步请求的状态;解析两层结果(请求处理状态与失败判定依据
.result.status);带退避策略轮询直到请求完成或达到调用者指定的超时时间;在请求失败时展示解析后的错误详情.result.errorDetails - 不适用场景:发起晋升或部署操作(请使用)、创建工作项/更新工作项状态(请使用
dx-devops-promote)、冲突检测、执行dx-devops-work-item-manage(此操作是调用者在本技能确认成功后的下一步)、流水线或项目配置sf devops promotion complete
Required Inputs
必填输入
Gather or infer before proceeding:
- Request token (required): the request token returned in the promote response. Passed via
dx-devops-promote. Without it, this skill cannot proceed — ask for it or obtain it from the prior promote step's output-i/--request-token - Target org: (required unless the
-o/--target-org <alias>config variable is set)target-org
Defaults unless specified:
- Output format: for headless consumption
--json - Polling interval: 10 seconds between checks; cap total wait at a caller-supplied timeout (default 30 minutes). Never poll faster than every 5 seconds — DOCe API rate limits apply
If the user gives a clear request ("check request a0B…", "poll request a0B… until it finishes"), proceed once you have the request token.
执行前需收集或推断以下信息:
- 请求令牌(必填):晋升响应中返回的请求令牌,通过
dx-devops-promote参数传入。若无此令牌,本技能无法执行——请向用户索要或从之前的晋升步骤输出中获取-i/--request-token - 目标组织:(若已设置
-o/--target-org <别名>配置变量则可选)target-org
默认配置(除非另行指定):
- 输出格式:,用于无界面场景消费
--json - 轮询间隔:每次检查间隔10秒;总等待时长上限为调用者指定的超时时间(默认30分钟)。轮询间隔不得短于5秒——需遵守DOCe API的速率限制
若用户明确提出请求(如"检查请求a0B…的状态"、"轮询请求a0B…直到完成"),获取请求令牌后即可执行。
Workflow
工作流程
All operations use with output. This skill is read-only — it issues no mutations. The command's flags and JSON output schema are documented in .
sf devops request status--jsonreferences/cli-commands.md所有操作均使用带输出的命令。本技能为只读——不会执行任何修改操作。该命令的参数与JSON输出架构记录在中。
--jsonsf devops request statusreferences/cli-commands.mdPhase 1 — Authenticate and confirm the request token
阶段1 — 身份验证并确认请求令牌
-
Verify org authentication before any operation:bash
sf org display --json- If it fails, instruct the user to run
sf org login web --set-default --alias <alias> - Pass on every subsequent command (required unless the
-o/--target-org <alias>config variable is set)target-org
- If it fails, instruct the user to run
-
Confirm you have a request token. If the user initiated a promotion in the same session, reuse the request token captured from thepromote response. If no token is available, STOP and ask for it — do NOT guess or fabricate a token.
dx-devops-promote
-
在执行任何操作前验证组织身份:bash
sf org display --json- 若验证失败,指导用户执行
sf org login web --set-default --alias <别名> - 在后续所有命令中传入(若已设置
-o/--target-org <别名>配置变量则可选)target-org
- 若验证失败,指导用户执行
-
确认已获取请求令牌。若用户在同一会话中发起过晋升操作,复用从晋升响应中捕获的请求令牌。若无可用令牌,立即停止并向用户索要——请勿猜测或伪造令牌。
dx-devops-promote
Phase 2 — Single status check (two-level semantics)
阶段2 — 单次状态检查(两层语义)
CRITICAL:(uppercase, e.g..result.status) reports whether the async request finished processing — NOT whether the underlying deploy succeeded. A request can showSUCCESSwhile the deployment itself failed. The real outcome oracle isstatus: "SUCCESS": non-null.result.errorDetailsmeans the operation failed, even whenerrorDetails.status == SUCCESS
- Run a single status check with , which queries the request once and derives the true outcome deterministically (glob-matches the operation-prefixed
scripts/poll-status.sh --oncesuffix, then applies the.result.statusfailure oracle). Do NOT hand-roll the JSON parsing in prose — the script owns the two-level rule so it stays consistent with the polling path:.result.errorDetailsInterpret the exit code (the script prints a human-readable line to match):bashscripts/poll-status.sh --once <request-token> <target-org-alias>- — request finished and the operation succeeded (
0null) → hand back to the callererrorDetails - — request finished but the operation FAILED (status suffix
2/*FAILED*/*ERROR*, or a*CANCELED*status with non-null*SUCCESS*) → the printed line carries the parsederrorDetails/errorTypeerrorMessage - — request is still processing (non-terminal suffix) → proceed to Phase 3 to poll, or report in-progress for a one-shot check
4 - — query/usage error (bad token, auth, or missing dependency)
1
关键提示:(大写格式,如.result.status)仅表示异步请求已处理完成——并不代表底层部署操作成功。即使请求状态显示SUCCESS,部署操作仍可能失败。真实结果的判定依据是status: "SUCCESS":只要.result.errorDetails不为空,即表示操作失败,哪怕errorDetails。status == SUCCESS
- 执行单次状态检查,使用脚本,该脚本会查询一次请求并确定性推导真实结果(通配匹配操作前缀的
scripts/poll-status.sh --once后缀,再应用.result.status失败判定规则)。请勿手动解析JSON——脚本负责维护两层规则,确保与轮询流程保持一致:.result.errorDetails根据退出码解读结果(脚本会打印对应的可读信息):bashscripts/poll-status.sh --once <请求令牌> <目标组织别名>- — 请求已完成且操作成功(
0为空) → 将结果返回给调用者errorDetails - — 请求已完成但操作失败(状态后缀为
2/*FAILED*/*ERROR*,或状态为*CANCELED*但*SUCCESS*不为空) → 打印的信息包含解析后的errorDetails/errorTypeerrorMessage - — 请求仍在处理中(非终端后缀) → 进入阶段3进行轮询,或在单次检查中报告请求正在进行
4 - — 查询/使用错误(无效令牌、身份验证失败或缺少依赖)
1
Phase 3 — Poll until terminal (only when asked to wait)
阶段3 — 轮询直到进入终端状态(仅当用户要求等待时执行)
- Poll with a bounded loop when the user asks to wait for completion. Run and report the final status it prints:
scripts/poll-status.shbashscripts/poll-status.sh <request-token> <target-org-alias> [interval-seconds] [timeout-seconds]- The script polls every (default 10), never sleeps past
interval-seconds, stops on a terminal request state, and applies the same two-level outcome check astimeout-seconds. Exit codes:--once= finished + succeeded (0null),errorDetails= finished but the operation failed (2set, or status suffixerrorDetails/*FAILED*/*ERROR*),*CANCELED*= timeout,3= query/usage error1 - It is a read-only loop — it issues only queries, never mutations
sf devops request status - Do NOT hand-roll a polling loop in prose; the script enforces the interval floor, exact timeout, terminal-state detection, and the outcome check deterministically
errorDetails
- The script polls every
- 当用户要求等待请求完成时,执行带边界的轮询循环。运行脚本并报告其打印的最终状态:
scripts/poll-status.shbashscripts/poll-status.sh <请求令牌> <目标组织别名> [轮询间隔秒数] [超时秒数]- 脚本每隔(默认10秒)轮询一次,不会等待超过
interval-seconds,在请求进入终端状态时停止,并应用与timeout-seconds相同的两层结果检查规则。退出码:--once= 请求完成且成功(0为空),errorDetails= 请求完成但操作失败(2不为空,或状态后缀为errorDetails/*FAILED*/*ERROR*),*CANCELED*= 超时,3= 查询/使用错误1 - 此为只读循环——仅执行查询,不会执行任何修改操作
sf devops request status - 请勿手动编写轮询循环;脚本会严格执行最小间隔、精确超时、终端状态检测以及结果判定规则
errorDetails
- 脚本每隔
Phase 4 — Report
阶段4 — 结果报告
- Report the outcome:
- On success (finished, empty): "Request
errorDetailscompleted successfully." — then remind the caller that promotion finalization (<token>) is the next step, owned bysf devops promotion completedx-devops-promote - On failure (finished, set — even if
errorDetails): "Requeststatus == SUCCESSfailed." plus the<token>/errorTypeparsed fromerrorMessageand theerrorDetailsfield — do NOT retry or remediate here; that is the caller's decisionmessage - On timeout (still processing): report the last observed request status and the elapsed wait; suggest polling again later — do NOT report success or failure for a request that has not finished processing
- On success (finished,
- 报告结果:
- 成功(请求完成,为空):"请求
errorDetails已成功完成。" — 随后提醒调用者,晋升操作的最终确认(<令牌>)是下一步,由sf devops promotion complete负责dx-devops-promote - 失败(请求完成,不为空——即使
errorDetails):"请求status == SUCCESS失败。" 并附上从<令牌>和errorDetails字段解析出的message/errorType— 请勿在此处重试或修复,该决策由调用者做出errorMessage - 超时(请求仍在处理):报告最后观测到的请求状态及已等待时长;建议稍后再次轮询——请勿对未完成的请求报告成功或失败
- 成功(请求完成,
Rules / Constraints
规则与约束
| Constraint | Rationale |
|---|---|
| Read-only — never mutate pipeline state | This skill only reports status; promotion/deploy/complete are owned by other skills |
| A request token is mandatory | Status cannot be checked without the |
| Structured output is required for headless consumption; human-readable output is unreliable to parse |
Read | Deterministic parsing prevents misreading a still-processing request as done |
A | |
Non-null | |
| Real values are |
A request is only "done" at a terminal suffix ( | Reporting an |
| Never poll faster than every 5 seconds | DOCe API rate limits; unbounded fast polling risks throttling |
| Bound every polling loop with a timeout | Prevents infinite waits and turn/timeout exhaustion in CI |
Never run | Finalization is the caller's step after this skill confirms success |
| Pass the token as a CLI flag, never interpolate into shell strings | Prevents prompt/command injection via crafted tokens |
| Never use interactive prompts | Skills run headless; all inputs must be CLI flags |
| 约束条件 | 原因 |
|---|---|
| 只读操作——绝不修改流水线状态 | 本技能仅报告状态;晋升/部署/最终确认操作由其他技能负责 |
| 请求令牌为必填项 | 若无晋升响应中的 |
| 结构化输出是无界面消费的必要条件;可读输出解析不可靠 |
通过 | 确定性解析可避免将仍在处理的误判为已完成 |
| |
| |
| 实际值为 |
仅当请求状态后缀为终端类型( | 将 |
| 轮询间隔不得短于5秒 | 遵守DOCe API速率限制;无限制的高频轮询可能导致限流 |
| 所有轮询循环必须设置超时时间 | 避免无限等待以及CI中的超时耗尽 |
绝不从本技能执行 | 最终确认是调用者在本技能确认成功后的步骤 |
| 通过CLI参数传入令牌,绝不插入到Shell字符串中 | 防止通过构造恶意令牌进行命令注入 |
| 绝不使用交互式提示 | 技能运行在无界面环境;所有输入必须通过CLI参数传入 |
Gotchas
常见问题
| Issue | Resolution |
|---|---|
| No request token provided | STOP and ask for it, or obtain it from the prior |
| The most important trap: a |
| It is escaped JSON (e.g. |
Status is operation-prefixed ( | Match on the suffix with globs ( |
| Reporting a still-processing request as complete | Terminal suffixes are |
| No default org set | Run |
| Rate-limit / throttle errors while polling | Increase the interval (back off); never poll below the 5-second floor |
| Infinite wait | Always pass a timeout to |
| Confusing request failure with skill failure | A |
| 问题 | 解决方法 |
|---|---|
| 未提供请求令牌 | 立即停止并向用户索要,或从之前的 |
| 这是最关键的陷阱: |
| 它是转义后的JSON(如 |
状态带有操作前缀( | 使用通配符匹配后缀( |
| 将仍在处理的请求报告为已完成 | 终端后缀为 |
| 未设置默认组织 | 执行 |
| 轮询时遇到速率限制/限流错误 | 增加轮询间隔(退避);轮询间隔不得低于5秒 |
| 无限等待 | 始终为 |
| 混淆请求失败与技能失败 | |
Output Expectations
输出预期
Deliverables vary by mode:
- Single check: (request-processing state) plus the derived outcome — on failure, the
.result.status/errorTypeparsed fromerrorMessageand the.result.errorDetailsfield.result.message - Poll-to-completion: the derived terminal outcome (succeeded or failed, per the check) plus elapsed wait, or the last observed request status if the timeout was reached first
errorDetails
Outputs are derived from . This skill produces no artifacts and mutates nothing.
sf devops request status交付内容因模式而异:
- 单次检查:(请求处理状态)及推导的结果——失败时,包含从
.result.status和.result.errorDetails字段解析出的.result.message/errorTypeerrorMessage - 轮询直到完成:推导的终端结果(根据检查判定成功或失败)及已等待时长;若先达到超时时间,则报告最后观测到的请求状态
errorDetails
输出内容均来自。本技能不会生成任何工件,也不会修改任何内容。
sf devops request statusCross-Skill Integration
跨技能集成
| When | Action |
|---|---|
| A promotion or deploy must be initiated first to get a request token | Delegate to |
Outcome is success (finished, | Hand back to |
Status reports | Report the conflict from |
| 场景 | 操作 |
|---|---|
| 需先发起晋升或部署操作以获取请求令牌 | 委托给 |
结果为成功(请求完成, | 返回给 |
状态报告因元数据冲突导致 | 从 |
Reference File Index
参考文件索引
| File | When to read |
|---|---|
| When you need the |
| When the user's request matches a common pattern (one-shot check, poll-until-done after a promote, timeout handling, failure reporting) |
| Phase 2 — invoke with |
| 文件 | 阅读场景 |
|---|---|
| 需要了解 |
| 用户请求符合常见模式(单次检查、晋升后轮询直到完成、超时处理、失败报告)时 |
| 阶段2——使用 |