Skip to content

feat(github-actions-grafana-jump): make the jump button fully generic (rebase of #24) - #27

Merged
nsheaps-oura merged 4 commits into
mainfrom
claude/pr-24-completion-80nro9
Aug 4, 2026
Merged

feat(github-actions-grafana-jump): make the jump button fully generic (rebase of #24)#27
nsheaps-oura merged 4 commits into
mainfrom
claude/pr-24-completion-80nro9

Conversation

@nsheaps-oura

Copy link
Copy Markdown
Collaborator

Summary

Rebases #24 onto current main now that #23 (the TypeScript 6.0.3 moduleResolution CI fix) has merged. #24's CI was failing purely on that stale-base issue, not on its own content.

  • Not configured: clicking the jump button opens an in-page config panel (not a native prompt()) to set a Grafana base URL and one or more dashboards, each with whichever template-variable names it uses for filtering by branch/PR/workflow/runner.
  • Configured: jumps straight to the first applicable dashboard for the current page, with a small "▾" menu to pick a different configured dashboard or reopen the config panel to edit the list.
  • Config persists via GM.setValue/GM.getValue (@grant changed from none to GM.setValue/GM.getValue).
  • Resolves the reason the script's header previously said it was intentionally not published to GreasyFork (baked-in internal Oura infra links) — no dashboard config ships by default anymore. @downloadURL/@updateURL and changeset/publish wiring are intentionally untouched, left for a follow-up decision.

The existing context-detection logic (parsePrContext, parseBranchContext, parseRunnerContext, parseWorkflowContext, resolveJumpContext, extractBranchFromQuery) is untouched from #24.

What changed vs. #24

Only the two mechanical conflicts from rebasing onto main (which already carries #23's fix):

src/index.ts and the test file are otherwise byte-for-byte identical to #24.

Test plan

Supersedes #24.

🤖 Generated with Claude Code


Generated by Claude Code

nsheaps-oura and others added 2 commits August 3, 2026 21:03
Reworks the Grafana jump button so no Grafana instance, dashboard UID,
or template-variable name is baked into the script. This also removes
the reason the script's header previously said it was intentionally
NOT published to GreasyFork (baked-in internal Oura infra links) -
that constraint is gone now that it's fully user-configured, though
whether/how to actually publish is a separate decision.

Behavior:
- Not configured yet -> the jump button opens an in-page config panel
  (not a native prompt) to set a Grafana base URL and one or more
  dashboards, each with whichever template-variable names it uses for
  filtering by branch/PR/workflow/runner.
- Configured -> jumps straight to the first applicable dashboard for
  the current page, with a small "▾" menu to jump to a different
  configured dashboard or reopen the config panel.
- Config persists via GM.setValue/GM.getValue (@grant changed from
  `none` to GM.setValue/GM.getValue accordingly), scoped to this
  script/browser.

The existing context-detection logic (parsePrContext,
parseBranchContext, parseRunnerContext, parseWorkflowContext,
resolveJumpContext, extractBranchFromQuery) is untouched. New pure,
unit-tested logic: contextVarKey/contextFilterValue (map a context to
its filter field/value), applicableDashboards (which configured
dashboards can handle this context), buildJumpUrl (per-dashboard URL
building), defaultConfig/normalizeConfig/isConfigured (config
lifecycle). test/grafana-jump.test.js updated accordingly - all 22
tests pass against the built dist/.

tsconfig.json: added an explicit "types": ["node", "greasemonkey"]
override. Under this repo's moduleResolution setting, tsc doesn't
reliably auto-discover @types packages from node_modules/@types the
way it does under other resolution modes, and this is now the one
package that references both @types/node's `module` (existing
test-export guard) and @types/greasemonkey's `GM` global.

Deliberately left alone per the task: the still-unconfirmed
TODO(nathan) about the two Oura dashboards' real template-variable
names is moot for the shipped script now (no dashboard config ships
by default at all - users fill in their own), but is not being
resolved as a general finding one way or the other; it just no longer
applies to this file's own contents.

Not touched, pending a separate decision: @downloadURL/@updateURL and
the changeset/publish wiring. Generic now, but publishing is a
follow-up call, not assumed here.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Userscript Version Preview

Preview only — versions and CHANGELOGs are bumped automatically on merge to main, not in this PR. Manual bumps to a higher version are preserved.

Package Base New Action
github-actions-grafana-jump 0.1.0 0.2.0 manual (internal)

@nsheaps-oura
nsheaps-oura marked this pull request as ready for review August 3, 2026 22:25
claude added 2 commits August 3, 2026 22:36
…n preview

The version-preview report skipped github-actions-grafana-jump entirely
because the opted_in gate ran before the manual-bump check, so this PR's
own 0.1.0 -> 0.2.0 bump never showed up - it just said 'no package changes
detected'. Detect the bump for every package now, matching the simpler
per-package version diff ai-mktpl's _preview-version-bumps task does, and
report internal-only packages as 'manual (internal)' rather than silently
dropping them. They still don't enter has_bumps/bumps, since there's no
release-it config or built script.user.js for the release job to publish.
@nsheaps-oura
nsheaps-oura merged commit 60db1f1 into main Aug 4, 2026
5 checks passed
@nsheaps-oura
nsheaps-oura deleted the claude/pr-24-completion-80nro9 branch August 4, 2026 23:15
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