Skip to content

fix(recovery): reuse the guarded Cluster connection - #4700

Merged
devantler merged 2 commits into
mainfrom
codex/pause-transport-4673
Oct 10, 2026
Merged

devantler merged 2 commits into
mainfrom
codex/pause-transport-4673

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Summary

Reuse the existing protected certificate connection for the database Cluster's final read and conditional patch. This removes command startup, discovery and an extra target read from the recovery window without changing any safety precondition.

Only the protected completed-join recovery and pause diagnostic use this connection. Ordinary OIDC planning and other resource operations stay unchanged. Unsupported credentials fail closed; writes cannot be retried or redirected. No new dependency, credential or deployment exception is introduced.

Verification

The transport regression fails with the old CLI forwarding behavior and passes with this change. Synthetic TLS tests cover connection reuse, exact patch and dry-run queries, credential restrictions, bounded capture, throttling, redirects and lost responses. The full recovery race suite, Go vet, affected lint and current-main source-wiring regressions pass.

This shortens a demonstrated request window; it does not prove which precondition caused the previous rejection or guarantee recovery. Production remains at HOLD until a separately approved first-attempt recovery passes live verification.

Related: #4673. The boot-image and init-log repair chain still depends on database recovery.

@devantler

devantler commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7121bc88-e482-45be-9212-3edf697b49e7

📥 Commits

Reviewing files that changed from the base of the PR and between 6e6f89f and f63fa57.


📒 Files selected for processing (4)
  • scripts/replace-wedding-standby/README.md
  • scripts/replace-wedding-standby/cluster_transport.go
  • scripts/replace-wedding-standby/cluster_transport_test.go
  • scripts/replace-wedding-standby/main.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: 🔍 Detect Changes
  • GitHub Check: 🔐 Validate Consumer Discovery Regressions
  • GitHub Check: 🔏 Validate Cosign Matcher Efficacy

🧰 Additional context used
🪛 Betterleaks (1.8.1)
scripts/replace-wedding-standby/cluster_transport_test.go

[high] 188-188: Detected a password embedded in a service connection URI, which may expose direct access to the referenced service.

(generic-credential-uri)


🪛 golangci-lint (2.13.2)
scripts/replace-wedding-standby/cluster_transport.go

[error] 134-134: right hand must be only type assertion

(forcetypeassert)


[medium] 58-58: G204: Subprocess launched with a potential tainted input or cmd arguments

(gosec)


[medium] 60-60: G204: Subprocess launched with a potential tainted input or cmd arguments

(gosec)


scripts/replace-wedding-standby/cluster_transport_test.go

[error] 85-85: Error return value of encoding/json.Marshal is not checked: unsafe type any found

(errchkjson)


[error] 226-226: Error return value of encoding/json.Marshal is not checked: unsafe type any found

(errchkjson)


[error] 133-133: right hand must be only type assertion

(forcetypeassert)


[error] 166-166: type assertion must be checked

(forcetypeassert)


[error] 167-167: type assertion must be checked

(forcetypeassert)


[error] 168-168: type assertion must be checked

(forcetypeassert)


🔇 Additional comments (4)
scripts/replace-wedding-standby/cluster_transport.go (1)

1-133: LGTM!

Also applies to: 139-205


scripts/replace-wedding-standby/cluster_transport_test.go (1)

1-359: LGTM!


scripts/replace-wedding-standby/README.md (1)

63-76: LGTM!


scripts/replace-wedding-standby/main.go (1)

168-171: LGTM!

Also applies to: 960-967



📝 Walkthrough

Walkthrough

The change adds a protected HTTP/1.1 transport for selected Kubernetes Cluster GET and PATCH requests. It bounds and validates kubeconfig export, configures TLS, limits request shapes, and validates responses. Other resource operations continue to use kubectl. The production run path enables the transport for completed-join quarantine execution or diagnosis, and tests cover configuration, request behavior, and wiring.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to f63fa

No actionable merge-blocking issue remains in the reviewed change. Normal verification can proceed.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 55.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: reusing the guarded Cluster connection during recovery.
Description check Passed The description is directly related to the changeset and explains the connection reuse, scope, safety constraints, and verification results.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 55.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: 1 unsupported.)


  • Autofix · 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.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

The review follow-up is in 948e3fc. A new regression reproduced the unchecked default-transport panic, then passed after the helper was changed to refuse unavailable or incompatible defaults. Fixture serialization, collection assertions and the HTTP/1 hijacker are now checked. Missing function comments were added. The full race suite, vet and lint with forcetypeassert and errchkjson enabled pass.

The secret-scanner URI is a deliberately invalid fixture under example.invalid, used to verify that embedded URL credentials are refused before any request. It is not a real credential or service. Both subprocess advisories concern direct, non-shell kubectl invocation with the selected, internally fixed context and reviewed argument shapes; no command text from external content is executed. The scoped dispatch, malformed-credential and byte-bound regressions remain intact. These advisory findings are refuted, not suppressed.

The earlier review is stale after this push. A new exact-head review is required before merge; no production recovery has been retried.

@devantler devantler 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.

🤖 Generated by the Agentic Engineer

Self-review (fallback — CodeRabbit, Codex and Cursor Bugbot unavailable)

Reviewed commit: 948e3fc

  • CodeRabbit: its edited review summary, verified now, reports zero included reviews remaining after the 2026-10-10T08:33:25Z event; account-plan scope, recovery on the next included allowance or maintainer-authorized credits. That review covered the previous head, not this one.
  • Codex: the provider's account usage-limit response from 2026-10-08T15:23:18Z remains present on a fresh read; recovery requires account credits or quota recovery. The current lane sweep also reports a later limit and no subsequent substantive green.
  • Cursor Bugbot: its user/team usage-limit response from 2026-10-09T05:33:32Z remains present on a fresh read; recovery requires an administrator to change the usage/spend limit.

Current PR review objects, all conversation comments, complete review threads and current-head checks were read before fallback. No current-head substantive provider review or unresolved thread exists. Prior ancillary findings were fixed or refuted in the resolution record; no scanner or check was disabled.

The complete four-file diff was reviewed for correctness, credential handling, identity/scope preservation, byte and deadline bounds, no automatic mutation replay, refusal behavior, CAS semantics and production wiring. Independent exact-head review found no P0/P1/P2 findings. Full race tests, vet, the flagged lint checks and current-main source-wiring ablations pass. This is offline code review, not live recovery proof.

Verdict: no P0/P1 findings

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Ready at 948e3fc. Required CI and all selected recovery safety checks pass, the exact-head local review is GREEN, all review threads are resolved, and the ancillary findings are fixed or refuted. The branch is conflict-free against current main.

User evaluation: exercised the actual client against a synthetic mTLS API that offers HTTP/2. The client positively uses HTTP/1, reuses the final GET connection, sends the unchanged conditional PATCH with no intervening discovery/read, and refuses every tested failure without replay or cleanup. The unavailable-default regression reproduced a panic before the fix and passes afterward. The current-main source-wiring ablations also pass. These are runtime client observations, not a claim that production recovery succeeded; that acceptance remains the separately approved first-attempt workflow after merge.

@devantler
devantler added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit a9c39fa Oct 10, 2026
38 checks passed
@devantler
devantler deleted the codex/pause-transport-4673 branch October 10, 2026 08:56
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant