Skip to content

feat(core): drop v2.0/v2.1 support, enforce minimum version v2.2.0#433

Open
flemzord wants to merge 2 commits into
mainfrom
feat/drop-v2.0-v2.1-support
Open

feat(core): drop v2.0/v2.1 support, enforce minimum version v2.2.0#433
flemzord wants to merge 2 commits into
mainfrom
feat/drop-v2.0-v2.1-support

Conversation

@flemzord
Copy link
Copy Markdown
Member

Summary

  • Add explicit version validation gate (ValidateMinimumVersion) in GetModuleVersion() rejecting stack versions < v2.2.0 with actionable error message
  • Clean up all dead code branches for v2.0/v2.1 across webhooks, reconciliations, auths, brokers, and ledger
  • Remove 7 orphaned functions: IsGreaterOrEqual, IsLower, hasAllVersionsGreaterThan, installLedgerSingleInstance, createLedgerContainerFull, createBaseLedgerContainer, createDeployment (ledger-local)

Net result: 12 files changed, 96 insertions, 208 deletions.

What's preserved

  • Payments v2 branches — module version, not stack version
  • Broker NATS stream detection — legacy streams may still exist on v2.2+ stacks
  • Non-semver versions (dev tags, SHA refs) — pass through without validation

Test plan

  • go build ./... passes
  • go vet ./... passes
  • New TestValidateMinimumVersion with 11 cases (v2.0.0, v2.1.0, v2.1.9, v2.0.0-rc.5, v2.2.0-alpha rejected; v2.2.0, v2.3.0, v3.0.0, non-semver, sha, latest accepted)
  • Existing tests updated (v1.0.0v2.2.0 in stack/ledger controller tests)
  • Integration tests compile
  • No remaining IsGreaterOrEqual/IsLower references in codebase
  • Reviewed by Codex (architecture) and Gemini (quality)

@flemzord flemzord requested a review from a team as a code owner March 24, 2026 12:53
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2026

Warning

Rate limit exceeded

@flemzord has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 36 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bde9de3b-e64b-4109-9123-9c8672cae569

📥 Commits

Reviewing files that changed from the base of the PR and between a45739a and 4db933c.

📒 Files selected for processing (12)
  • internal/core/version.go
  • internal/core/version_test.go
  • internal/resources/auths/configuration.go
  • internal/resources/auths/deployment.go
  • internal/resources/brokers/reconcile.go
  • internal/resources/ledgers/deployments.go
  • internal/resources/ledgers/init.go
  • internal/resources/reconciliations/init.go
  • internal/resources/webhooks/deployment.go
  • internal/resources/webhooks/init.go
  • internal/tests/ledger_controller_test.go
  • internal/tests/stack_controller_test.go

Walkthrough

The changes establish a new minimum supported stack version (v2.2.0) with validation, remove obsolete version gates for earlier releases, and simplify code paths that previously accommodated pre-v2.2.0 versions across authentication, broker, ledger, database migration, and webhook resources.

Changes

Cohort / File(s) Summary
Version Management
internal/core/version.go, internal/core/version_test.go
Introduces MinimumStackVersion constant and ValidateMinimumVersion function to enforce v2.2.0 floor; removes IsGreaterOrEqual and IsLower helpers; refactors GetModuleVersion to validate resolved versions.
Authentication Resources
internal/resources/auths/configuration.go, internal/resources/auths/deployment.go
Removes v2.1.0 version gates; now unconditionally applies auth client secret handling regardless of stack version.
Broker Configuration
internal/resources/brokers/reconcile.go
Removes semantic-version-based broker mode detection; unconditionally sets ModeOneStreamByStack after legacy-stream checks.
Ledger Resources
internal/resources/ledgers/deployments.go, internal/resources/ledgers/init.go
Removes legacy single-instance ledger installation paths and v2.2.0-alpha version gates; eliminates associated container-assembly helpers; simplifies migration error handling.
Database & Webhook Migration
internal/resources/reconciliations/init.go, internal/resources/webhooks/init.go, internal/resources/webhooks/deployment.go
Removes version gates from database migrations (v2.0.0-rc.5 and equivalents) and webhook deployment (v2.0.0-alpha to v2.0.0-rc.5 CLI argument gating).
Test Updates
internal/tests/ledger_controller_test.go, internal/tests/stack_controller_test.go
Updates test versions from v1.0.0 / v0.0.0-test to v2.2.0 to align with new minimum stack version.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Version gates of old now fade away,
v2.2.0 marks a brighter day,
No more checks for lesser releases,
Our code grows lighter, logic increases,
Simpler paths for modern stacks,
Rabbits hop without looking back! 🐇✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: dropping support for v2.0/v2.1 and enforcing v2.2.0 as the minimum version, which is the core objective of the PR.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the validation gate addition, dead code removal, preserved functionality, and test coverage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drop-v2.0-v2.1-support

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 and usage tips.

flemzord added 2 commits May 11, 2026 11:28
Add explicit version validation gate in GetModuleVersion() that rejects
stack versions below v2.2.0 with an actionable error message.

Clean up all dead code branches that only executed for versions < v2.2:
- Remove --auto-migrate block in webhooks (range < v2.0.0-rc.5)
- Remove IsGreaterOrEqual guards in webhooks, reconciliations, auths
- Simplify broker mode detection (always default to OneStreamByStack)
- Remove installLedgerSingleInstance and related dead functions
- Simplify ledger migration error handling (always allow proceed)

Removed functions: IsGreaterOrEqual, IsLower, hasAllVersionsGreaterThan,
installLedgerSingleInstance, createLedgerContainerFull,
createBaseLedgerContainer, createDeployment (ledger-local).

Payments v2 branches and broker NATS stream detection are preserved
as they operate on module versions, not stack versions.
@flemzord flemzord force-pushed the feat/drop-v2.0-v2.1-support branch from a45739a to 4db933c Compare May 11, 2026 09: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.

1 participant