Telemetry: the Azure DevOps task's DIFFCI_SURFACE=azure-devops-task is not a recognised surface, so its runs count as cli

未關閉
#303 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github, node.js, typescript

研究方向

Read packages/diffci-cli/src/client/usage-signal.ts, packages/diffci-cli/src/client/telemetry.ts around surfaceOf, and docs/telemetry.md; compare them with integrations/azure-devops/DiffCIObserve/index.js:131. First confirm with a maintainer which surface value the usage endpoint accepts, as the issue identifies this as an unresolved dependency. Done when Azure task runs are recorded under that accepted surface and the documentation and client types agree.

由索引模型根據 Issue 內容生成。

描述

What went wrong?

The Azure DevOps task tags its CLI runs with a surface that telemetry doesn't recognise, so Azure task runs are counted as surface: "cli".

  • integrations/azure-devops/DiffCIObserve/index.js:131 runs the CLI with DIFFCI_SURFACE: "azure-devops-task".
  • packages/diffci-cli/src/client/telemetry.ts:94-98 (surfaceOf) only passes through github-action and gitlab-component, and maps everything else to cli.
  • UsageSurface (packages/diffci-cli/src/client/usage-signal.ts:4) and docs/telemetry.md:18 list only cli, local-mcp, github-action and gitlab-component.

This is the Azure counterpart of #284 (the GitHub Action's observe step sets no surface).

DiffCI version

core main 40aa308 (CLI 0.3.54)

Repro

Run with tsx from packages/diffci-cli. The script stubs fetch and records the usage bodies:

import { mkdtempSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path";
import { recordUsage } from "./src/client/telemetry.ts";
const bodies: any[] = [];
globalThis.fetch = async (_u, init) => { bodies.push(JSON.parse(String(init?.body))); return new Response(null, { status: 200 }); };
const env = { DIFFCI_TELEMETRY_HOME: mkdtempSync(join(tmpdir(), "t-")), TF_BUILD: "True" };
for (const s of ["github-action", "gitlab-component", "azure-devops-task"]) await recordUsage("observe", "observed", "0.3.54", {}, { ...env, DIFFCI_SURFACE: s });
console.log(bodies.map((b) => b.surface));

Actual: [ 'github-action', 'gitlab-component', 'cli' ]

Expected

Azure DevOps task runs are counted under their own surface, the way the GitHub Action and the GitLab component are. That means adding the task's value (or an agreed name such as azure-devops-task) to UsageSurface, surfaceOf and docs/telemetry.md.

The usage endpoint may also need to accept the new value. That's why this issue has no PR yet: a maintainer should confirm the value the ingest side accepts before the client starts sending it.

主要語言
TypeScript
星號
0
分支
4
平均合併
18 小時 41 分鐘
30 天內合併 PR
48

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

DiffCI/core 的其他 Issue

查看 DiffCI/core 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。