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
Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SungJin1212 SungJin1212 force-pushed the refactor/ruler-query-func-cleanup branch from dcdf8b5 to 31095c9 Compare January 8, 2026 02:10
@SungJin1212 SungJin1212 force-pushed the refactor/ruler-query-func-cleanup branch from 31095c9 to e996f09 Compare January 8, 2026 06:57
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.

2 participants