Skip to content

chore: log orgId, pod, and UTC timestamp on NUT failures - #475

Merged
nico-pappagianis merged 1 commit into
mainfrom
chore/nut-failure-org-context
Aug 18, 2026
Merged

chore: log orgId, pod, and UTC timestamp on NUT failures#475
nico-pappagianis merged 1 commit into
mainfrom
chore/nut-failure-org-context

Conversation

@nico-pappagianis

Copy link
Copy Markdown
Collaborator

What

Adds structured, CI-log-friendly context to the shared z-series NUT setup (test/nuts/shared-setup.ts) so failures can be correlated in Splunk:

  • [NUT-CONTEXT] — emitted once when the shared scratch org is created, with orgId, pod (instance name), and a UTC timestamp. Always present in every run.
  • [NUT-FAILURE] — root afterEach that, on any failing z-series test, logs orgId, pod, UTC timestamp, test name, and the error.

Timestamp format is MM/DD/YYYY:HH:mm:ss (UTC).

Example lines:

[NUT-CONTEXT] utc=08/18/2026:16:11:24 orgId=00DDF00000XSGeA2AX pod=CS239
[NUT-FAILURE] utc=08/18/2026:16:12:03 orgId=00DDF00000XSGeA2AX pod=CS239 test="agent preview > ... > should reflect --context-variables overrides in the live preview session trace" error=history never created

Why

The z-series NUTs (run from @salesforce/agents' xNuts-plugin-agent job and here) have been failing in ways that are hard to triage from CI logs because the org and instance aren't recorded. These lines make orgId + pod + time-of-failure greppable.

Note on hook failures

A failing before all hook (e.g. the z4 AiTestingDefinition deploy) is not caught by afterEach, but the [NUT-CONTEXT] line logged at setup still records that run's orgId + pod + time for correlation, and mocha prints the hook error itself.

Safety (public repo)

Only non-sensitive identifiers are logged — orgId and pod of an ephemeral, per-run scratch org, plus a platform error string. No auth tokens, no session URL, and no devhub are logged (called out in code comments so it isn't widened later).

Companion

Sister PR forcedotcom/agents#342 adds the equivalent logging to the agents repo's own NUTs (the nuts CI job).

Emit a structured [NUT-CONTEXT] line at shared scratch-org setup and a
[NUT-FAILURE] line on any failing z-series test, carrying orgId,
instance/pod, a UTC timestamp (MM/DD/YYYY:HH:mm:ss), and the error, so
CI failures can be correlated in Splunk.

Only non-sensitive identifiers are logged; no auth tokens or devhub.
@nico-pappagianis
nico-pappagianis merged commit 2a71f54 into main Aug 18, 2026
12 of 15 checks passed
@nico-pappagianis
nico-pappagianis deleted the chore/nut-failure-org-context branch August 18, 2026 18:12
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.

2 participants