Skip to content

fix(server): ladder multi-account skip test + naming/comment follow-ups (closes #1370) - #1371

Merged
cristim merged 1 commit into
mainfrom
fix/ladder-1370-followups
Jul 16, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/ladder-1370-followups

Conversation

@cristim

@cristim cristim commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

What

Closes #1370 (follow-ups from the #1362 pre-merge review):

  1. New test TestHandleLadderRun_MultiAccountSkip_CountedAndIsolated: a config whose ExternalID does not match the resolved caller account is visibly counted SkippedMultiAccount==1, persists nothing, and a healthy config still processes (isolation). Verified the test fails when the account comparison is inverted.
  2. Renamed cap -> capability (builtin shadow).
  3. Corrected the unknown-cadence comment (error surfaces in ladderConfigToEngine, pre-persist, fail-loud).

Gates all exit 0: build, vet, go test ./internal/server/... (402), gocyclo.

Part of LeanerCloud/cloud-commitments-platform#70. Tracker LeanerCloud/cloud-commitments-go#27.

Summary by CodeRabbit

  • Bug Fixes
    • Improved ladder run handling for configurations linked to different cloud accounts.
    • Such configurations are now correctly skipped and counted without preventing eligible configurations from running.
    • Invalid cadence values are surfaced earlier with clearer validation behavior.

…ccount skip test

- handler_ladder.go ~256: rename `cap` to `capability` (shadows builtin)
- handler_ladder.go ~437: correct comment -- unknown cadence surfaces in
  ladderConfigToEngine (pre-persist, fail-loud), not during Allocate
- handler_ladder_test.go: add TestHandleLadderRun_MultiAccountSkip_CountedAndIsolated
  which asserts SkippedMultiAccount==1 for a foreign-ExternalID config,
  nothing persisted for it, and a co-present healthy config still plans
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-quarter Within the quarter impact/few Limited audience effort/xs Trivial / one-liner type/chore Maintenance / non-user-visible labels Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73b4661c-0834-4d53-80ba-2588b012037b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The ladder handler renames a capability variable, clarifies cadence validation behavior, and adds coverage ensuring mismatched multi-account configurations are skipped and isolated while matching configurations continue successfully.

Changes

Ladder run eligibility

Layer / File(s) Summary
Multi-account skip isolation and handler cleanup
internal/server/handler_ladder_test.go, internal/server/handler_ladder.go
Adds coverage for counted, non-persisted multi-account skips and continued processing of healthy configurations; renames the capability variable and updates the unknown-cadence validation comment.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: ladder test follow-up plus naming/comment fixes.
Linked Issues check ✅ Passed The PR implements all requested follow-ups: multi-account skip test, cap rename, and cadence comment fix.
Out of Scope Changes check ✅ Passed No unrelated code changes are introduced beyond the linked issue follow-ups.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ladder-1370-followups

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

@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 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.

@cristim
cristim merged commit fcd8133 into main Jul 16, 2026
13 of 16 checks passed
@cristim
cristim deleted the fix/ladder-1370-followups branch July 16, 2026 13:58
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Merged to main (closes #1370): positive multi-account skip test (proven to fail when the account comparison is inverted), cap->capability builtin-shadow rename, corrected cadence comment. CodeRabbit clean, functional CI green.

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

Labels

effort/xs Trivial / one-liner impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ladder: post-merge follow-ups from #1362 pre-merge review (multi-account test gap + nits)

1 participant