Skip to content

fix(purchase): pass the platform AttemptJournal in the finalize test helper - #1850

Merged
cristim merged 1 commit into
mainfrom
fix/main-red-attempt-journal-test
Nov 8, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/main-red-attempt-journal-test

Conversation

@cristim

@cristim cristim commented Nov 8, 2026

Copy link
Copy Markdown
Member

Main is red. CI - Build & Test fails at af8f543: internal/purchase tests don't compile.

internal/purchase/requested_at_test.go:210:19: cannot use journal (variable of interface type common.AttemptJournal) as AttemptJournal value in struct literal: common.AttemptJournal does not implement AttemptJournal (missing method ClaimedByOthers)

Cause: a semantic conflict between two PRs that were each green on their own.

Fix: one line, test-only. The helper's parameter now uses the platform AttemptJournal. Its callers pass nil or &fakeAttemptJournal{}, which already implements ClaimedByOthers (requested_at_test.go:387). No production code changes.

Verification: go vet ./internal/purchase/ is clean. go test -run 'RequestedAt|Redshift|Journal|Finalize' ./internal/purchase/ passes. Pre-commit and pre-push hooks pass. This also unblocks CI for every open platform PR, including #1849.

🤖 Generated with Claude Code

…helper

#1846 made purchase.AttemptJournal also require ClaimedByOthers, and
#1832 merged after it with a test helper still typed as
common.AttemptJournal, so internal/purchase tests no longer compile on
main. The helper now takes the platform interface; its callers already
pass a fake that implements ClaimedByOthers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim cristim added priority/p0 Drop everything; same-day fix type/bug Defect labels Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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 40 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

Commits

Reviewing files that changed from the base of the PR and between af8f543 and 6955331.

Files selected for processing: 1

  • internal/purchase/requested_at_test.go
  • 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

@cristim

cristim commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

APPROVED 6955331 by claude-qa-ui-3

Cold review of the main-red fix.

  1. Test-only, and it compiles. The diff against main af8f5434 is one line in internal/purchase/requested_at_test.go:159. runRedshiftFinalizeWithJournal's journal parameter changes from common.AttemptJournal to the package's AttemptJournal, which is common.AttemptJournal plus common.ClaimReader (internal/purchase/manager.go:61-64, feat(purchase): read Redshift purchase claims across attempt lineages #1846). No non-test file changes. At this SHA, go vet ./internal/purchase/ is OK, and go test -run 'Redshift|Journal|RequestedAt|Finalize' ./internal/purchase/ passes.
  2. Every caller passes nil or a ClaimReader-capable fake.
    • runRedshiftFinalize (requested_at_test.go:151-155) passes nil. Its callers are requested_at_test.go:232, 251, 276, 358 and redshift_journal_guard_test.go:24, 48.
    • The only direct caller, redshift_journal_guard_test.go:38, passes &fakeAttemptJournal{}. That fake implements ClaimedByOthers (requested_at_test.go:387).
  3. CI is green at this SHA. "CI - Build & Test" (run 42460164179's sibling 42460164169) completed with success. All 41 checks pass and 1 is skipped. The same run on main af8f5434 failed to compile (common.AttemptJournal does not implement AttemptJournal (missing ClaimedByOthers)).

@cristim

cristim commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

APPROVED 6955331 by claude-cc-platform

Cold review of the main-red fix. One commit on main af8f5434, one line, test-only (internal/purchase/requested_at_test.go, +1/-1).

  1. Compiles, test-only. runRedshiftFinalizeWithJournal now takes the package's AttemptJournal (manager.go:61: common.AttemptJournal plus common.ClaimReader) instead of common.AttemptJournal. That's the type Manager.attemptJournal needs since feat(purchase): read Redshift purchase claims across attempt lineages #1846, which is what broke main's compile. No production file changes. Locally at this head (scratch worktree, heavy-review-2, GOMAXPROCS=4): go vet ./internal/purchase/ is clean, and go test -run 'Redshift|RequestedAt|Journal' ./internal/purchase/ passes.
  2. Every caller passes nil or &fakeAttemptJournal{}. runRedshiftFinalize (requested_at_test.go:151-155) passes nil, and the seven callers that go through it (requested_at_test.go:232, 251, 276, 358 and redshift_journal_guard_test.go:24, 48) inherit that. The only direct caller, TestRedshiftRetryDispatch_WithJournalDispatches (redshift_journal_guard_test.go:37-38), passes &fakeAttemptJournal{}, which implements ClaimedByOthers (requested_at_test.go:387-389). No other test passes a bare common.AttemptJournal.
  3. CI is green on this head (run 42460164169): Unit Tests, Integration Tests (purchase), Lint Code and CI Success all pass, and pre-commit run 42460164223 passes.

Once this merges, PRs whose CI ran on the red main (for example #1847) need a re-run or a main merge.

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

Labels

priority/p0 Drop everything; same-day fix type/bug Defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant