Skip to content

ci(nr): emit CI test-run results to New Relic (Wave 5)#266

Merged
mastermanas805 merged 4 commits into
masterfrom
ci/wave5-nr-ci-event
Jun 6, 2026
Merged

ci(nr): emit CI test-run results to New Relic (Wave 5)#266
mastermanas805 merged 4 commits into
masterfrom
ci/wave5-nr-ci-event

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Wave 5 of the CI integration plan (docs/ci/01-CI-INTEGRATION-DESIGN.md §NR observability): push CI test/gate/deploy results to New Relic so ANY red run is studyable from an NR dashboard, not just the GitHub Actions log.

What

  • .github/actions/nr-ci-event — reusable composite action. POSTs InstantCITestRun{repo,workflow,branch,commit_sha,pr_number,result,duration_ms,suite,...} on every gated job (always) + InstantCITestFailure{...,failed_step,log_url} on failure, via the NR Event API (insights-collector.../v1/accounts/<acct>/events) authed with the ingest license key.
  • Wired as if: always() steps into ci.yml (build-and-test), coverage.yml (coverage gate), deploy.yml (deploy gate).

No-op contract

When NEW_RELIC_LICENSE_KEY or NEW_RELIC_ACCOUNT_ID is absent (fork PRs, unprovisioned repo) the action prints the payload it WOULD send and exits 0 — observability never reds a PR. Free-form values flow through env, not shell interpolation (injection-safe). Additive only; gates unchanged.

Verify

  • Action YAML + all 3 workflows parse (Python yaml). Action bash body shellcheck-clean. Dry-run proof (no secret → pass/fail/cancelled cases) exercised locally: pass→1 event, fail/cancelled→2 events, garbage duration→0, exit 0.
  • No Go changes (workflow/action YAML only) — Go gate unaffected (origin/master already green).

Operator action

Provision NEW_RELIC_LICENSE_KEY (same k8s instant-secrets value) + NEW_RELIC_ACCOUNT_ID as GitHub Actions secrets on the api repo.

Companion PRs (Wave 5)

🤖 Generated with Claude Code

Wave 5 of the CI integration plan (docs/ci/01-CI-INTEGRATION-DESIGN.md
§NR observability): push CI test/gate/deploy results to New Relic so ANY
red run is studyable from an NR dashboard, not just the GitHub Actions log.

Adds a reusable composite action .github/actions/nr-ci-event that POSTs an
InstantCITestRun custom event on every gated job (always) plus an
InstantCITestFailure event on failure, via the NR Event API
(insights-collector .../v1/accounts/<acct>/events) authenticated with the
ingest license key. Wired into build-and-test (ci.yml), coverage (coverage.yml),
and the deploy gate (deploy.yml) as an `if: always()` step.

No-op contract: when NEW_RELIC_LICENSE_KEY or NEW_RELIC_ACCOUNT_ID is absent
(fork PRs, unprovisioned repo) the action prints the payload it WOULD send and
exits 0 — observability never reds a PR. Free-form values flow through env, not
shell interpolation (injection-safe). Additive only; gates unchanged.

Schema InstantCITestRun{repo,workflow,branch,commit_sha,pr_number,result,
duration_ms,suite,...}; InstantCITestFailure{...,failed_step,log_url}. NR
dashboard + alerts land in the infra repo (instanode-ci-health).

Operator action: provision NEW_RELIC_LICENSE_KEY + NEW_RELIC_ACCOUNT_ID as
GitHub Actions secrets on the api repo (license key = same k8s instant-secrets
value; account id per infra/newrelic/README.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 enabled auto-merge (squash) June 5, 2026 23:50
mastermanas805 and others added 3 commits June 6, 2026 05:25
…ses them as inputs

The nr-ci-event composite action referenced github.*/secrets.*/job.status in its
own env: block; GitHub rejects those contexts inside a composite action
(TemplateValidationException 'Unrecognized named-value'). Move all resolution to
the caller's with: block (which CAN read those contexts) and have the action read
only inputs.*. Adds event-name + actor inputs. Callers now pass repo/workflow/
branch/commit-sha/log-url/event-name/actor from the github context.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitHub evaluates ${{ }} even inside input description: strings; the example
'${{ secrets... }}' text triggered Unrecognized-named-value. Plain text now;
only runs: keeps inputs.* expressions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eckout)

coverage.yml and deploy.yml check the api repo out into ./api (path: api), so a
local-action 'uses: ./.github/actions/nr-ci-event' resolves to the workspace
root (empty) and 404s ('Can't find action.yml'). Reference the action at its
real nested path ./api/.github/actions/nr-ci-event in those two workflows.
ci.yml checks out at the root, so it keeps ./.github/actions/nr-ci-event.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 4369a86 into master Jun 6, 2026
18 checks passed
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