Skip to content

Conversation

@SungJin1212
Copy link
Member

This PR refactors pkg/ruler/compat.go to improve code readability and maintainability.
Previously, EngineQueryFunc and DefaultTenantManagerFactory contained mixed responsibilities.
This is a pure refactoring change. There are no changes to the logic or behavior of the ruler.

EngineQueryFunc Refactoring:

  • Moved middleware logic (MaxQueryLength, Timeout, Context handling) into wrapWithMiddleware.

DefaultTenantManagerFactory Refactoring:

  • Extracted buildQueryFunc to encapsulate the composition of the query function
  • Simplifies the main factory function

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot bot added the component/rules Bits & bobs todo with rules and alerts: the ruler, config service etc. label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/rules Bits & bobs todo with rules and alerts: the ruler, config service etc. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant