Skip to content

fix(plan): reject warnings when updating scheduled plans - #5190

Merged
turip merged 1 commit into
mainfrom
feat/reject-scheduled-plan-warnings
Sep 23, 2026
Merged

turip merged 1 commit into
mainfrom
feat/reject-scheduled-plan-warnings

Conversation

@turip

@turip turip commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

A plan published with a future EffectiveFrom can still be updated before it becomes active. The v1 update path sets IgnoreNonCriticalIssues=true, so an update that introduces a validation warning, such as a mismatch between the plan and rate card billing cadences, could be saved. When EffectiveFrom passes, the plan is reported as active without another validation pass.

Scheduled-plan updates now reject validation warnings regardless of that flag. Draft updates retain their existing behavior.

Validation: the focused PostgreSQL-backed service test passes on origin/main, and make lint-go passes. The regression test checks that a draft update can ignore the existing cadence-alignment warning, while the same scheduled-plan update fails and leaves the stored cadence unchanged.

Summary by CodeRabbit

  • Bug Fixes
    • Scheduled plan updates now reject non-critical currency and billing cadence issues, even when issue suppression is requested. Draft plan updates retain their existing behavior.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the implementation is narrowly scoped and the regression test covers the intended state-dependent behavior.

Summary

This PR prevents scheduled-plan updates from ignoring non-critical validation issues while preserving the existing behavior for draft plans.

  • Forces strict validation when the current plan status is scheduled.
  • Adds a PostgreSQL-backed regression test covering both draft and scheduled update behavior.
  • Confirms that a rejected scheduled update leaves the persisted billing cadence unchanged.

Reviews (1) · Last reviewed commit: "fix(plan): reject warnings when updating..."

@turip
turip requested a review from a team as a code owner September 23, 2026 13:20
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openmeterio/openmeter/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 10ff3f0a-a8a4-4ad0-bddc-101b4a3814bb

📥 Commits

Reviewing files that changed from the base of the PR and between 8da3e94 and 066c2e6.

📒 Files selected for processing (2)
  • openmeter/productcatalog/plan/service/plan.go
  • openmeter/productcatalog/plan/service/service_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

UpdatePlan now disables IgnoreNonCriticalIssues for scheduled plans before validation. A new test verifies that scheduled updates reject a cadence misalignment and leave the stored cadence unchanged.

Changes

Scheduled plan validation

Layer / File(s) Summary
Scheduled update validation
openmeter/productcatalog/plan/service/plan.go, openmeter/productcatalog/plan/service/service_test.go
Scheduled plan updates set IgnoreNonCriticalIssues to false before validation. The test confirms that a misaligned cadence is rejected for a scheduled plan, while a draft update with the same setting succeeds. The stored cadence remains unchanged after the rejected update.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: chrisgacsal

Merge Risk: ⚪ Minimal · up to 066c2

Scheduled updates reject the described validation warning while draft updates retain their behavior. No issue identified here prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: scheduled plan updates now reject validation warnings.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@turip turip added the release-note/bug-fix Release note: Bug Fixes label Sep 23, 2026
@turip
turip merged commit 0a4229e into main Sep 23, 2026
30 of 31 checks passed
@turip
turip deleted the feat/reject-scheduled-plan-warnings branch September 23, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants