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

Đang mở
#284 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

@FredApps đang làm issue này rồi.

Từ ngày 17/11/2026.

  • #285 của @FredApps — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github-actions, node.js, typescript
Lĩnh vực
ci-cd, observability

Hướng nghiên cứu

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.

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 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.

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.