Skip to content

test: cover Stellar auto-remediation dispatch path - #24213

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-stellar-automation
Oct 10, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-stellar-automation

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds unit coverage for pkg/api/handlers/stellar/watches_eventprocessing.go's auto-remediation dispatch path — autoExecuteAction, queueAutoTendAction, and autoCreateWatch — which previously had zero unit or e2e coverage (confirmed by grepping every *_test.go file in the package for these symbol names).

Covers:

  • autoExecuteAction: delegation to queueAutoTendAction for non-RestartDeployment types.
  • queueAutoTendAction: no-op for non-RestartDeployment types; successful queue creates a pending action + notification.
  • autoCreateWatch: creates a new watch vs. refreshes (not duplicates) an existing one.

While writing these tests, discovered that CreateStellarAction's INSERT never persists idempotency_key, so the dedup short-circuit these functions rely on can never fire for genuinely created rows — filed separately as #24212 since it's a production persistence bug, out of scope for a test-only PR. Two tests here (*_IdempotencyKeyDedupIsCurrentlyBroken) intentionally assert the current (buggy) behavior with inline notes on what to flip once #24212 lands, so this PR doesn't block on that fix landing first.

Verified locally: go test ./pkg/api/handlers/stellar/... passes (23.7s, all tests green) and go vet is clean.

Closes #24211


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-opus-4.7 copilot=1.0.88

…/queueAutoTendAction/autoCreateWatch)

Adds unit coverage for the three previously-untested Stellar event
auto-remediation branches: auto-executing a RestartDeployment action
with no human approval, queueing a non-restart action for approval,
and auto-creating/refreshing a watch for a recurring event.

Also documents (via two tests whose names and inline comments make the
current behavior explicit) that CreateStellarAction never persists
idempotency_key, so the dedup short-circuit in both auto-remediation
paths cannot currently prevent duplicate actions. Filed as a separate
production-code bug since fixing store persistence is out of scope for
test-only changes.

Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 10, 2026
@netlify

netlify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit ad00a3d
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6aca71ce7df72c00089a8da7

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added ai-generated Pull request generated by AI tier/1-lightweight labels Oct 10, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 10, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tested code at this head, not just the diff. The test assertions match the tree:

  • autoExecuteAction (pkg/api/handlers/stellar/watches_eventprocessing.go:347-352) does delegate non-RestartDeployment types to queueAutoTendAction, which no-ops for them (watches_eventprocessing.go:489-492) — so the "silent no-op" comment in the test is accurate.
  • The #24212 claim is real: CreateStellarAction's INSERT (pkg/store/sqlite_stellar_actions.go:64-66) omits idempotency_key, so ActionCompletedByIdempotencyKey (sqlite_stellar_actions.go:277) can never match a row created through it. The two *_IdempotencyKeyDedupIsCurrentlyBroken tests correctly pin current behavior and say what to flip when #24212 lands — the store's own test already works around this with setActionColumnForTest (pkg/store/sqlite_stellar_actions_test.go:169), confirming the gap.
  • autoCreateWatch create-vs-touch behavior matches watches_eventprocessing.go:615-626.

Test-only change in an existing package, so the coverage-ratchet completeness gate isn't implicated. Looks correct to me.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit e1dc3ab into main Oct 10, 2026
43 of 44 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#24213ad00a3d` sha256:93acc8de542fc823e45155c42cb6fab847f8cfa2419bd892336138475d1fa7ae — download from the dashboard or `hivectl review evidence #24213`.

@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-stellar-automation branch October 10, 2026 17:41
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed ✅

Both Go and frontend builds compiled successfully against merge commit e1dc3aba68ffb3448a4c0b0bfec29daedc311398.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: e1dc3aba68ffb3448a4c0b0bfec29daedc311398
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/38072752769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] stellar auto-remediation dispatch path (autoExecuteAction/queueAutoTendAction/autoCreateWatch) has zero test coverage

0 participants