Skip to content

Target Group Quota introduction - #3337

Merged
strailov merged 3 commits into
eclipse-hawkbit:masterfrom
boschglobal:feature/target_group_quota_introduction
Sep 9, 2026
Merged

strailov merged 3 commits into
eclipse-hawkbit:masterfrom
boschglobal:feature/target_group_quota_introduction

Conversation

@strailov

@strailov strailov commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Introduction

Limits the number of distinct target groups a tenant may create.
Quota check on each write case for target group - create/update (+bulk case) targets if groups is present and assigning group to target(s).
Default quota set to 100 with options to be increased/decreased.

Behaviour

  • null group never consumes quota — unassignment always allowed
  • Limit <= 0 means unlimited
  • Assigning an existing group is always allowed, even for a tenant already over the limit,
    so introducing a limit never breaks existing tenants
  • Batches are asserted once against their distinct new groups, so n + k is checked rather
    than n + 1 repeatedly
  • Rejection throws AssignmentQuotaExceededException
  • Existence is checked before the quota rejection is surfaced in update, so a bad id still
    reports EntityNotFoundException

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>

@avgustinmm avgustinmm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but see comment - maybe better to call method without parentId

return; // no growth -> allowed
}

QuotaHelper.assertAssignmentQuota(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why use method with parrentId (when no such) instead of:
public static void assertAssignmentQuota(
final long requested, final long limit,
@NotNull final Class type, @NotNull final Class parentType) {
i.e. parent null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because we won't get into :
if (parentId != null && countFct != null) in the assertAssignmentQuota where we want to evaluate currentCount + requested > limit . Didn't want to modify the method just for one parameter, which just needs to be non null (and why not the parent to be the Tenant in the exception message).

@strailov
strailov merged commit 99e5239 into eclipse-hawkbit:master Sep 9, 2026
6 of 7 checks passed
@strailov
strailov deleted the feature/target_group_quota_introduction branch September 9, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants