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

Offen
#303 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
github, node.js, typescript

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
0
Forks
4
Ø Merge
18 Std. 41 Min.
Gemergte PRs (30 T.)
48

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DiffCI/core

Alle Issues in DiffCI/core

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.