Skip to content

Fix TargetIDSet.IsEmpty and add regression test - #220

Merged
Vonng merged 1 commit into
pgsty:mainfrom
AleksaMCode:fix/lambda-targetidset-isempty
Sep 23, 2026
Merged

Vonng merged 1 commit into
pgsty:mainfrom
AleksaMCode:fix/lambda-targetidset-isempty

Conversation

@AleksaMCode

Copy link
Copy Markdown

Description

Fixes an inverted emptiness check in lambda target ID sets and adds a regression test.

  • Updated internal/config/lambda/event/targetidset.go:
    • TargetIDSet.IsEmpty() now correctly returns len(set) == 0.
  • Added TestTargetIDSetIsEmpty in:
    • internal/config/lambda/event/targetidset_test.go.

Motivation and Context

I discovered this while evaluating Silo as a MinIO replacement for my production CI/CD environment.

TargetIDSet.IsEmpty() was returning true for non-empty sets (len(set) != 0), which is logically incorrect and could cause future call sites to invert control flow. This PR fixes the behavior and adds a dedicated unit test so the bug cannot regress silently.

How to test this PR?

go test ./internal/config/lambda/event

Compatibility impact

No API, protocol, config key, metric, header, route, storage format, or module path changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • All commits are signed off (git commit -s) per the DCO
  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • make verifiers passes
  • Relevant package tests and make build pass
  • Compatibility and rollback impact documented
  • Internal documentation updated
  • Public documentation update opened in pgsty/silo.pgsty.com, if needed

Signed-off-by: AleksaMCode <aleksamcode@gmail.com>
@Vonng

Vonng commented Sep 22, 2026

Copy link
Copy Markdown
Member

Thanks @AleksaMCode, nice catch! IsEmpty() has been inverted since it came in with upstream minio#16507, and the new test passes locally.

Nothing in the tree calls it today, so there's no runtime change, but it's good to have it right before anyone does. We'll approve the CI workflows and merge once they're green. Thanks again!

@Vonng
Vonng merged commit 69d5e92 into pgsty:main Sep 23, 2026
8 checks passed
@AleksaMCode
AleksaMCode deleted the fix/lambda-targetidset-isempty branch September 23, 2026 15:44
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.

2 participants