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

Đang mở
#303 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, node.js, typescript

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
4
Merge trung bình
18 giờ 41 phút
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DiffCI/core

Tất cả issue của DiffCI/core

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.