GitHub Action: observe runs are counted as surface=cli, because the Observe step never sets DIFFCI_SURFACE

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

I maintainer di solito rispondono entro 1 giorno

@FredApps ci sta già lavorando.

Dal 17/11/2026.

  • #285 di @FredApps — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, node.js, typescript

Direzione di ricerca

Read the observe step in action.yml and compare its environment with action/verify.sh, which already exports DIFFCI_SURFACE=github-action. Check packages/diffci-cli/src/client/telemetry.ts for how the surface is read, then verify the Action metadata check in the issue passes. A linked open pull request (#285) already addresses this issue.

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

Descrizione

What went wrong?

The output or a command was wrong or confusing

DiffCI version

0.3.54 (the Action's default cli-version on main, 40aa308)

Command you ran

The public DiffCI/core change impact Action, default verify: "false". Its Observe step runs the published CLI:

npx --yes --ignore-scripts --no-audit --fund=false --package "@diffci.com/[email protected]" diffci observe --repo "$DIFFCI_REPO"

without DIFFCI_SURFACE=github-action in that step's environment (action.yml, the observe step).

Environment

Any GitHub Actions runner; Node 22 (the Action's default). Reproduced by reading action.yml and packages/diffci-cli/src/client/telemetry.ts on main (40aa308).

Output

surfaceOf in packages/diffci-cli/src/client/telemetry.ts only returns github-action when DIFFCI_SURFACE is that string. GITHUB_ACTIONS is used for the ci flag, not for surface. So an observation from the Action is sent to https://app.diffci.com/v1/usage-events with surface: "cli".

The opt-in fast check is already counted correctly: action/verify.sh exports DIFFCI_SURFACE=github-action. The GitLab component sets DIFFCI_SURFACE=gitlab-component, which telemetry counts. The Azure DevOps task sets DIFFCI_SURFACE=azure-devops-task, but telemetry's surfaceOf doesn't recognise that value and counts it as cli. That is a separate gap, filed as #303. Among the wrappers, only the Action's default path (observe) sets no surface at all.

A check that reads the Action metadata fails on main:

# from a worktree of main, after npm ci
node --input-type=module -e '
import { readFileSync } from "node:fs";
import { parse } from "yaml";
const action = parse(readFileSync("action.yml", "utf8"));
const observe = action.runs.steps.find((s) => s.id === "observe");
if (observe?.env?.DIFFCI_SURFACE !== "github-action") {
  console.error("observe env DIFFCI_SURFACE:", observe?.env?.DIFFCI_SURFACE);
  process.exit(1);
}
'
observe env DIFFCI_SURFACE: undefined
What you expected

Observe runs started by the GitHub Action are counted as surface: "github-action", the same as verify from that Action, and as the GitLab component already does for its observe path. (The Azure task's value isn't recognised yet; see #303.) Adoption by surface is then accurate. docs/telemetry.md already lists github-action as a surface the Action is supposed to report.

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.