Skip to content

feat: Label Filter Case-Sensitivity Improvements #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

GrantBirki
Copy link
Member

By default make label matching case insensitive but make it sensitive by using the --case-sensitive-labels flag


resolves: #9

… by using the `--case-sensitive-labels` flag
@GrantBirki GrantBirki added the enhancement New feature or request label Apr 14, 2025
@Copilot Copilot AI review requested due to automatic review settings April 14, 2025 16:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves label filtering by adding support for case-sensitive matching when enabled via the --case-sensitive-labels flag. Key changes include adding a normalization helper to convert labels to lowercase, introducing a new boolean flag in the CLI, and updating tests and matching logic to account for case sensitivity.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/common/common.go Added NormalizeArray() to convert arrays of strings to lowercase
internal/cmd/root.go Introduced the --case-sensitive-labels flag and updated CLI examples
internal/cmd/match_criteria_test.go Expanded tests to include cases for both case-sensitive and case-insensitive label matching
internal/cmd/match_criteria.go Updated labelsMatch() to conditionally normalize label arrays based on the flag setting

@GrantBirki GrantBirki merged commit 2b73a35 into main Apr 14, 2025
7 checks passed
@GrantBirki GrantBirki deleted the case-sensitive-label-matching-or-not branch April 14, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: better label matching by ignoring case sensitivity
1 participant