Skip to content

test(k8s): seed apply_operations in the stored-apply fixture#433

Merged
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/k8s-remote-failure-fixture-op-claim
Jun 20, 2026
Merged

test(k8s): seed apply_operations in the stored-apply fixture#433
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/k8s-remote-failure-fixture-op-claim

Conversation

@Kiran01bm

@Kiran01bm Kiran01bm commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

What

Update the K8s stored-apply fixture (createStoredK8sApplyWithTask) to
dual-write a single apply_operations row alongside the parent apply and
task, via CreateWithTasksAndOperations.

Why

When operation-level claiming is the default, the operator claims work through
FindNextApplyOperation (the apply_operations row), not the bare apply. The
fixture previously seeded an apply + task but no operation row, so the
operator had nothing to claim, the control-plane apply was never driven, and
the remote failure was never propagated — the remote-failure E2E stalled.
Mirroring the production apply-create dual-write keeps the fixture
representative.

Before

createStoredK8sApplyWithTask
│  CreateWithTasks
▼
╭───────────╮     ╭──────╮
│   apply   │────▶│ task │          (no apply_operations row)
╰───────────╯     ╰──────╯
│
▼
operator: FindNextApplyOperation ── finds nothing ──▶ apply never claimed
│
▼
remote failure never propagated ──▶ E2E stalls / fails

After

createStoredK8sApplyWithTask
│  CreateWithTasksAndOperations
▼
╭───────────╮     ╭──────────────-─╮     ╭──────╮
│   apply   │────▶│ apply_operation│────▶│ task │
╰───────────╯     ╰───────────────-╯     ╰──────╯
│            (state mirrors apply)
▼
operator: FindNextApplyOperation ── claims op ──▶ drives the apply
│
▼
remote failure propagated to control-plane status ──▶ E2E passes

This is a test-only enablement slice for the parked draft #431.

Testing / validation

  • gofmt -w e2e/k8s/k8s_test.go
  • go vet -tags e2e ./e2e/k8s/
  • go build ./...

Full K8s E2E not run locally (no minikube); validated by compile/vet plus the
#431 CI failure signature.

References

Enablement slice for #431.

Copilot AI review requested due to automatic review settings June 19, 2026 03:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the K8s E2E “stored apply” fixture to more closely match the production apply-create write pattern by inserting an apply_operations row alongside the parent applies row and its initial tasks, so operator drivers that claim at the operation level have something to claim.

Changes:

  • Extend createStoredK8sApplyWithTask to create a single storage.ApplyOperation for the apply.
  • Switch the fixture write path from CreateWithTasks to CreateWithTasksAndOperations so tasks are linked to the inserted operation via apply_operation_id.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/k8s/k8s_test.go
The remote-failure E2E fixture created an apply with tasks but no
apply_operations row, so the operation-claim operator could not claim it
once operation-level claiming becomes the default. Dual-write one
operation per apply, mirroring the production apply-create path.
Operation-level claiming reclaims a running apply via FindNextApplyOperation's
stale-heartbeat clause, which keys off apply_operations.updated_at. The helper
only aged applies.updated_at, so the operator had nothing claimable for ~1m and
the stale-recovery E2E polls could stall.
@Kiran01bm Kiran01bm force-pushed the kiran01bm/k8s-remote-failure-fixture-op-claim branch from e8c283d to 715a179 Compare June 19, 2026 03:33
@Kiran01bm Kiran01bm marked this pull request as ready for review June 19, 2026 03:42
@Kiran01bm Kiran01bm requested review from aparajon and morgo as code owners June 19, 2026 03:42
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Kiran01bm Kiran01bm merged commit a4915c8 into main Jun 20, 2026
30 checks passed
@Kiran01bm Kiran01bm deleted the kiran01bm/k8s-remote-failure-fixture-op-claim branch June 20, 2026 01:28
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.

3 participants