Skip to content

Make lease allocation strategy pluggable - #65

Merged
yashdotdev13 merged 1 commit into
mainfrom
feat/3-pluggable-lease-allocation
Oct 24, 2026
Merged

yashdotdev13 merged 1 commit into
mainfrom
feat/3-pluggable-lease-allocation

Conversation

@yashdotdev13

Copy link
Copy Markdown
Owner

Summary

  • Introduce AllocationStrategyConfiguration to register a default allocation strategy.
  • Use @ConditionalOnMissingBean to allow applications to provide custom AllocationStrategy implementations.
  • Update TrafficControlConfiguration to inject the configured strategy.
  • Add tests covering the default strategy and custom strategy override.

Testing

  • mvn clean test
  • 133 tests passed, with 0 failures and 0 errors.

Closes #3

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T08:37:19.922977Z a8a6c80 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8a6c806d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

public class AllocationStrategyConfiguration {

@Bean
@ConditionalOnMissingBean(AllocationStrategy.class)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the missing-bean condition behind user configurations

If a consumer declares its custom strategy in a separate @Configuration class that is processed after this imported configuration, @ConditionalOnMissingBean can register the default first, leaving two AllocationStrategy beans and making injection into capacityAllocator ambiguous. TrafficControlConfiguration imports this class directly rather than loading it through Boot’s auto-configuration ordering; the new test uses AutoConfigurations.of(...) and does not cover that import path. Ensure user bean definitions are considered before registering the default.

Useful? React with 👍 / 👎.

@yashdotdev13
yashdotdev13 merged commit b7ba01a into main Oct 24, 2026
2 checks passed
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.

Make lease allocation strategy pluggable

1 participant