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

Abierto
#284 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@FredApps ya está trabajando en esto.

Desde el 17/11/2026.

  • #285 de @FredApps — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
github-actions, node.js, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
4
Merge medio
18 h 41 min
PR fusionados (30 d)
48

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DiffCI/core

Todos los issues de DiffCI/core

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.