Skip to content

Green main: clear every CI var in the telemetry test, align the CodeQL pins - #277

Merged
anirudhkumar-nanonets merged 1 commit into
mainfrom
fix/ci-green-on-main
Sep 1, 2026
Merged

anirudhkumar-nanonets merged 1 commit into
mainfrom
fix/ci-green-on-main

Conversation

@anirudhkumar-nanonets

Copy link
Copy Markdown
Collaborator

main has been red since before release: 0.16.0. Two unrelated causes.

1. not ok 197 — cursor-session-end force-closes THIS conversation

The test needs telemetry actually on to observe the rollup, so it clears the gates — but only CI:

delete process.env.CI; delete process.env.DO_NOT_TRACK;

inCi is deliberately generous and reads eight more:

CI  GITHUB_ACTIONS  GITLAB_CI  BUILDKITE  CIRCLECI
TEAMCITY_VERSION  JENKINS_URL  TF_BUILD  BUILD_NUMBER

On GitHub Actions GITHUB_ACTIONS=true, so offReason returned 'ci', nothing queued, and readSession(d,'c1').summarized was undefined instead of true. Deterministic, both platforms, invisible on a laptop.

Reproduce on main:

GITHUB_ACTIONS=true node --import tsx --test test/claude-hooks.test.ts

Fixed at the root rather than by adding one more delete: the list is now an exported CI_ENV_VARS, and both inCi and the test read it. A provider added to the gate can no longer leave the test behind. CI keeps its value check (CI=false is a real thing people set); the rest stay presence-only.

2. analyze — CodeQL version mismatch

Loaded a configuration file for version '4.37.8', but running version '4.37.7'

Dependabot #240 bumped codeql-action/init to 4.37.8 and left analyze on 4.37.7. CodeQL requires the pair to match. Both now use the same 4.37.8 SHA that scorecard.yml was already on — all three pins in the repo are identical again.

The # v3 comments were the reason this drifted unnoticed on a SHA-pinned action, so they now name the real version, matching scorecard.yml's convention.

Verification

run result
npm test 1174 pass / 0 fail / 1 skipped
CI=true GITHUB_ACTIONS=true npm test 1174 pass / 0 fail / 1 skipped

No production behaviour changes: inCi returns exactly what it did for every input, and the only source edit is the extracted constant.

… CodeQL pins

Two unrelated causes, both red on main since before 0.16.0.

1. `cursor-session-end` turns telemetry ON to observe the rollup, and cleared
   only `CI`. `inCi` is deliberately generous and also reads GITHUB_ACTIONS
   plus seven more, so on GitHub Actions the gate stayed shut, nothing queued,
   and `summarized` came back undefined. The var list is now `CI_ENV_VARS` in
   gate.ts, read by both `inCi` and the test, so a var added to one reaches
   the other. Reproduces locally with GITHUB_ACTIONS=true.

2. codeql-action/init was bumped to 4.37.8 (#240) while analyze stayed on
   4.37.7, and CodeQL refuses a version-mismatched pair: "Loaded a
   configuration file for version '4.37.8', but running version '4.37.7'".
   Both now match the 4.37.8 SHA scorecard.yml already uses, and the `# v3`
   comments that hid the drift name the real version.
@trailhq-graft

trailhq-graft Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

1 area changed → 2 areas can be affected. 3 dependent symbols, depth 2.
Tests: Telemetry Gate has tests the diff did not touch.
Tag: @shhdwi — CLI Entry Point

flowchart TB
  A0(("Telemetry Notices<br/>2 symbols"))
  A1(("CLI Entry Point<br/>1 symbol"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Telemetry Notices 2 src/telemetry/notice.ts:L34-L43 firstRunNotice — calls, depth 2 Telemetry Gate
CLI Entry Point 1 src/cli.ts:L1-L1193 cli.ts — calls, depth 2 Telemetry Gate
Who knows this code — 1 person across 3 areas
Area Who knows it
CLI Entry Point · affected @shhdwi — 23 commits, last 19d ago
Telemetry Gate · changed only you — nobody else has touched these files
Telemetry Notices · affected only you — nobody else has touched these files

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 3 dependent symbols, grouped by area

Telemetry Notices — 2 symbols in 1 file

  • src/telemetry/notice.ts:L34-L43 — firstRunNotice (calls, depth 2)
  • src/telemetry/notice.ts:L47-L67 — formatStatus (calls, depth 2)

CLI Entry Point — 1 symbol in 1 file

  • src/cli.ts:L1-L1193 — cli.ts (calls, depth 2)
Test signal per changed area — 1 ⚠

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ⚠ Telemetry Gate — 1 of 1 reached · 1 test file reaches it, none changed here
1 test suite also references this code

1 symbol, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/telemetry-gate.test.ts

⚠️ 1 changed file not in the graph (.github/workflows/codeql.yml) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 3 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Sep 1, 2026
@anirudhkumar-nanonets
anirudhkumar-nanonets merged commit afa3d2d into main Sep 1, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Sep 1, 2026
FrancescoMerenda pushed a commit to FrancescoMerenda/Graft that referenced this pull request Sep 7, 2026
… CodeQL pins (trailhq#277)

Two unrelated causes, both red on main since before 0.16.0.

1. cursor-session-end turns telemetry ON to observe the rollup and cleared
   only CI. inCi is deliberately generous and also reads GITHUB_ACTIONS plus
   seven more, so on GitHub Actions the gate stayed shut, nothing queued, and
   summarized came back undefined. The list is now CI_ENV_VARS in gate.ts,
   read by both inCi and the test, so a var added to one reaches the other.
   inCi returns identically for every input.

2. codeql-action/init was bumped to 4.37.8 (trailhq#240) while analyze stayed on
   4.37.7, and CodeQL refuses a version-mismatched pair. Both now match the
   4.37.8 SHA scorecard.yml already used, and the stale '# v3' comments that
   hid the drift name the real version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant