Skip to content

refactor: rm unnecessary validation - #3374

Merged
chrisgacsal merged 1 commit into
mainfrom
fix/rm-entitlement-validation
Sep 11, 2025
Merged

chrisgacsal merged 1 commit into
mainfrom
fix/rm-entitlement-validation

Conversation

@chrisgacsal

@chrisgacsal chrisgacsal commented Sep 11, 2025 •

Copy link
Copy Markdown
Collaborator

Overview

Remove unncessary validation for catching scenarious where the usage attribution of the Customer has changed since the entitlement is created. This is a known issue which is going to be addressed separately.

Summary by CodeRabbit

  • Bug Fixes
    • Relaxed validation for entitlements: creation and mapping no longer fail when the entitlement’s subject key doesn’t match a customer’s subjects.
    • Reduces unexpected validation errors during entitlement creation, import, and sync workflows, improving reliability and throughput.
    • Admins should ensure subject consistency as cross-entity checks are no longer enforced automatically.

@chrisgacsal chrisgacsal self-assigned this Sep 11, 2025
@chrisgacsal
chrisgacsal requested a review from a team as a code owner September 11, 2025 15:56
@chrisgacsal chrisgacsal added the release-note/misc Miscellaneous changes label Sep 11, 2025
@coderabbitai

coderabbitai Bot commented Sep 11, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removed subject cross-reference validation in entitlement handling. Deleted validateSubjectKeysMatch and its invocations in CreateEntitlement and mapEntitlementEntity, eliminating checks that entitlement.Subject exists within customer.Subjects. No exported signatures changed.

Changes

Cohort / File(s) Summary
Entitlement subject validation removal
openmeter/entitlement/adapter/entitlement.go
Deleted validateSubjectKeysMatch function and removed its calls in CreateEntitlement and mapEntitlementEntity, stopping subject-key consistency checks during creation and mapping. No public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "refactor: rm unnecessary validation" concisely captures the PR's primary intent — removal of validation logic — and is directly related to the changeset which deletes the entitlement subject-key checks; it therefore reflects the main change. It is brief and actionable for reviewers but does not name the specific validation that was removed. The title is acceptable for this change though slightly less explicit than it could be for long-term history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 724de44 and 8be22b2.

📒 Files selected for processing (1)
  • openmeter/entitlement/adapter/entitlement.go (0 hunks)
💤 Files with no reviewable changes (1)
  • openmeter/entitlement/adapter/entitlement.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Quickstart
  • GitHub Check: E2E
  • GitHub Check: Test
  • GitHub Check: Lint
  • GitHub Check: Code Generators
  • GitHub Check: Build
  • GitHub Check: Analyze (go)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/rm-entitlement-validation

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.

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

Labels

release-note/misc Miscellaneous changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants