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

Aperta
#303 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, node.js, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
18h 41m
PR unite (30g)
48

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DiffCI/core

Tutte le issue di DiffCI/core

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.