Skip to content

feat: pre-fill action params from a live status metric (currentFrom) - #553

Merged
ValgulNecron merged 4 commits into
masterfrom
feat/action-param-current-from
Oct 5, 2026
Merged

ValgulNecron merged 4 commits into
masterfrom
feat/action-param-current-from

Conversation

@ValgulNecron

Copy link
Copy Markdown
Collaborator

Summary

This adds an optional currentFrom to GameTemplate action params. It names a status metric, and the dashboard pre-fills the param from that metric's live reading when the action dialog opens. It fixes a 2026-10-04 live-sweep finding: Set difficulty opened on "normal" while Overview showed Easy.

  • CRD (ActionParamSpec.currentFrom):
    • It is optional and uses the same pattern and maximum length as a status metric id.
    • The new property is in operator/config/crd/gameplane.local_gametemplates.yaml.
    • hack/sync-chart-crds.sh restamped the chart copies. Every chart CRD gets the new bundle hash; only gametemplates gains the property.
  • Dashboard (ServerActionsCard.tsx):
    • Templates whose params use currentFrom subscribe to the same server-status query as the Status card. It is one cache entry, and it is enabled only when needed and RCON is available.
    • An enum param takes the option that matches the reading case-insensitively, a bool takes true/false, and an int takes an integer. Otherwise default applies.
    • Only the user's edits are held in state. A reading that arrives after the dialog opened still pre-fills it, and the user's own choice always wins.
  • Docs: docs/module-authoring.md (Actions) and web/specs.md.
  • Module: ValgulNecron/gameplane-module#43 adds currentFrom: difficulty to minecraft-java's set-difficulty (2.9.0).

Needs a reviewer's eye

  • No local codegen: make generate and make manifests were not run, because this machine builds nothing.
    • The CRD YAML was written to match what controller-gen emits for these markers, using the same layout as the StatusMetricSpec id property in that file.
    • Deepcopy needs no change for a string field.
    • CI's chart-sync check regenerates the chart copies from operator/config/crd and diffs them.
    • A later make manifests on a dev machine should produce no diff. If it does, that run's output wins.
  • No modules pointer bump here: fix(modules): probe Terraria readiness without connecting #551 also moves the pointer, for the Terraria probe fix. Once both module PRs are merged, one pointer bump can cover both.
  • No cross-check: nothing validates that currentFrom names a declared metric. An unknown id just leaves the default, as the docs say.

Verification

  • Nothing was compiled or tested locally. CI is the authority.
  • Haiku applied a scout-verified brief. Sonnet reviewed every diff as compiler, linter and controller-gen, traced the three new tests, and approved it.
  • gofmt -l is clean, and jq empty passes on the module schema.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NsN6bnAMRM9XQtrTQ6KC7U

ValgulNecron and others added 3 commits October 5, 2026 03:15
ActionParamSpec.currentFrom names a status metric (spec.capabilities.status.metrics[].id) whose live value pre-fills the param in the dashboard dialog, so a "set" action opens on the current setting. Optional, same pattern and length as a metric id. The CRD YAML was written to match controller-gen's output for these markers (codegen is not run on this machine; deepcopy needs no change for a string field), and hack/sync-chart-crds.sh restamped the chart copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsN6bnAMRM9XQtrTQ6KC7U
Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
The Set difficulty dialog opened on "normal" while Overview showed Easy (live sweep 2026-10-04). A param with currentFrom now takes that metric's live reading from the shared server-status query: enum options match case-insensitively, bool takes true/false, int an integer, else the default applies. Only the user's edits are state, so a reading that arrives after the dialog opened still pre-fills until the user picks a value. Tests cover the prefill, the user's choice winning and the no-match fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsN6bnAMRM9XQtrTQ6KC7U
Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsN6bnAMRM9XQtrTQ6KC7U
Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
@ValgulNecron ValgulNecron added area: chart Helm chart and deployment area: modules game template OCI bundles area: operator controller-runtime operator and CRDs area: web React dashboard type: feature New capability or user-facing addition labels Oct 5, 2026
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: ValgulNecron/Gameplane/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 51b1ff9b-c1d0-43e0-964b-3922df254d10
📥 Commits

Reviewing files that changed from the base of the PR and between d520c18 and 219539b.

📒 Files selected for processing (25)
  • charts/gameplane/crd-manifests/gameplane.local_backups.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_clusters.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml
  • charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml
  • charts/gameplane/crd-manifests/gameplane.local_restores.yaml
  • charts/gameplane/crds/gameplane.local_backups.yaml
  • charts/gameplane/crds/gameplane.local_backupschedules.yaml
  • charts/gameplane/crds/gameplane.local_clusters.yaml
  • charts/gameplane/crds/gameplane.local_gameservers.yaml
  • charts/gameplane/crds/gameplane.local_gametemplates.yaml
  • charts/gameplane/crds/gameplane.local_modules.yaml
  • charts/gameplane/crds/gameplane.local_modulesources.yaml
  • charts/gameplane/crds/gameplane.local_networkcaptures.yaml
  • charts/gameplane/crds/gameplane.local_restores.yaml
  • docs/module-authoring.md
  • operator/api/v1alpha1/gametemplate_types.go
  • operator/config/crd/gameplane.local_gametemplates.yaml
  • web/specs.md
  • web/src/components/server/ServerActionsCard.test.tsx
  • web/src/components/server/ServerActionsCard.tsx
  • web/src/types.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

CI Report - 219539b

run 37252928556 - attempt 1

0 failed - 18 passed - 2 skipped - 31m48s elapsed

Coverage

Module Measured Gate Margin
web L95.15 S93.61 B87.79 F91.42 L92 S92 B82 F76 +1.61

Changed

Area Files +/-
web/ 4 +136/-6
charts/ 18 +36/-18
operator/ 2 +18/-0
docs/ 1 +9/-0

Slowest jobs

Job Duration
e2e game bot (kind) 20m53s
e2e multicluster / amd64 (kind x2) 9m13s
e2e web live / amd64 (kind) 8m32s
e2e multicluster / arm64 (kind x2) 8m27s
go (operator / amd64) 7m37s

e2e buckets run

api-agent, api-auth, api-mods, api-rbac, api-roles, bot-fast, multicluster, operator, ratelimit, upgrade

Resolves the web/specs.md conflict with #549/#552: keep master's ServerStatusCard note ("—" when no game version) and this branch's ServerActionsCard currentFrom note. The chart CRD stamp is unchanged after the merge (master carried no CRD change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsN6bnAMRM9XQtrTQ6KC7U
Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
@ValgulNecron
ValgulNecron merged commit a6268cd into master Oct 5, 2026
83 of 84 checks passed
@ValgulNecron
ValgulNecron deleted the feat/action-param-current-from branch October 5, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: chart Helm chart and deployment area: modules game template OCI bundles area: operator controller-runtime operator and CRDs area: web React dashboard type: feature New capability or user-facing addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant