Skip to content

feat: add GitHub Actions to Grafana jump buttons (ADX-525) - #4

Merged
nsheaps-oura merged 2 commits into
mainfrom
nate-ai/adx-525-grafana-jump-buttons
Jul 24, 2026
Merged

nsheaps-oura merged 2 commits into
mainfrom
nate-ai/adx-525-grafana-jump-buttons

Conversation

@nsheaps-oura

Copy link
Copy Markdown
Collaborator

Summary

  • Adds @nsheaps/gm-github-actions-grafana-jump, a userscript that shows a fixed "Grafana ↗️" button on github.com Actions pages for three contexts: a PR's workflow runs, a single workflow's runs across all branches, and a self-hosted runner's detail page (repo- or org-scoped).
  • Anchors on location.pathname/location.search rather than a specific page toolbar, since GitHub's Actions/PR toolbars use hashed Primer React CSS-module class names (confirmed live) that aren't stable to hardcode as selectors.
  • Grafana base URL (monitoring.oura.cloud) and dashboard UIDs (pagrf6j "CI/DevX report dashboard", pap5g6z "Android & iOS CI") are real, sourced from existing internal docs cataloging the target Grafana folder. The per-dashboard template-variable names used to filter by branch/PR/workflow/runner are explicitly flagged as unconfirmed placeholders (see TODO(nathan) comment in src/index.ts) pending verification against the live dashboard JSON.

Linear: ADX-525

Test plan

  • tsc --build passes for the new package
  • oxlint passes with 0 warnings/errors
  • node --test test/*.test.js — 14/14 unit tests pass, covering context parsing (PR/branch/runner/workflow) and Grafana URL building
  • Not verified: actually installing the built script in Tampermonkey/Greasemonkey and clicking the button on a live github.com page — no browser extension install available in this environment. DOM anchoring was checked against live github.com pages (this repo's own Actions/PR/workflow pages) via browser automation during development, but the shipped script itself was not click-tested end-to-end.

…-button userscript

Adds a new package that shows a fixed-position "Grafana ↗️" button on
github.com Actions pages, covering the three ADX-525 contexts: a PR's
workflow runs, a single workflow's runs across branches, and a
self-hosted runner's detail page (repo- or org-scoped).

Uses a floating button rather than anchoring inline to a page toolbar,
since GitHub's Actions/PR toolbars are styled with hashed Primer React
CSS-module class names (confirmed by inspecting the live DOM) that
aren't safe to hardcode as selectors.

The Grafana base URL and dashboard UIDs are real, sourced from existing
internal docs cataloging the target Grafana folder. The per-dashboard
template-variable names are explicitly flagged as unconfirmed
placeholders pending verification against the live dashboards.
… and URL building

Covers the pure logic extracted in src/index.ts: parsing a PR, branch,
runner, or workflow context out of location.pathname/search, and
building the resulting Grafana dashboard URL (including the var-*
query-param encoding). Run with `node:test` via the package's own
`test` script (`tsc --build && node --test test/*.test.js`) - no new
dependencies.
@nsheaps-oura
nsheaps-oura merged commit e83305e into main Jul 24, 2026
4 checks passed
@nsheaps-oura
nsheaps-oura deleted the nate-ai/adx-525-grafana-jump-buttons branch July 24, 2026 21:22
nsheaps-oura added a commit that referenced this pull request Jul 27, 2026
## Summary

`main`'s CI has failed on **every push since 2026-07-21** (~10 commits,
including the just-merged ADX-525 Grafana jump buttons feature, #4).
Three independent, compounding causes, all fixed here:

- **`tsconfig.base.json`**: `moduleResolution: "node"` (deprecated alias
for `node10`) is a hard error under TypeScript 6.0.3 (`TS5107`, removed
entirely in 7.0). Switched to `"bundler"`, the modern pairing for
`module: ESNext` — no package in this repo does external imports, so
this has zero effect on compiled output.
- **`packages/github-actions-grafana-jump/tsconfig.json`**: under
`moduleResolution: bundler`, `tsc` no longer auto-includes ambient
globals from `node_modules/@types` the way it did under `"node"`. This
package's `typeof module` test-export guard and `GM.*` API calls need an
explicit `"types": ["node", "greasemonkey"]` to keep resolving.
- **`packages/github-actions-grafana-jump/package.json`**: still
declared `"typescript": "~5.8.3"` — a stale copy from before the
org-wide v6 bump, since this package was only added later via the
ADX-525 PR and never got Renovate's bump. That mismatch against every
other package's `~6.0.3` left `yarn.lock` without a consistent
resolution, so `yarn install --immutable` (what CI actually runs) failed
outright on some runs before ever reaching a TypeScript compile. Bumped
to match; `yarn.lock` regenerated accordingly.

Also cherry-picked `4a38bf0` (from the still-open PR #7) to restore
`packages/graphite-to-github-button/src/index.ts`, which has been
missing from `main` since `4fc2806` renamed it straight to
`dist/script.user.js` without ever compiling it — `tsc --build` for that
package has been failing with "No inputs were found" independent of the
typescript v6 issue, since before the v6 bump even landed.

## Test plan

- [x] `yarn install --immutable` succeeds (this is what CI runs, and was
failing before this change)
- [x] `nx run-many --target=build --all --skip-nx-cache` succeeds for
all 5 packages, cache bypassed
- [x] `github-actions-grafana-jump`'s existing 14 unit tests pass
- [x] Confirmed `packages/graphite-to-github-button/dist/script.user.js`
(the already-committed, force-added artifact) is untouched by this
change — bringing it back in sync with the now-restored `src/index.ts`
is left to PR #7, which already does that plus its own separate
regen-dist workflow generalization
- [ ] CI green on this PR (will confirm once checks run)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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