Skip to content
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

feat: regex filters for namespace and name #1156

Merged
merged 16 commits into from
Sep 23, 2024
Merged

feat: regex filters for namespace and name #1156

merged 16 commits into from
Sep 23, 2024

Conversation

cmwylie19
Copy link
Collaborator

@cmwylie19 cmwylie19 commented Sep 18, 2024

Description

Adds regex for name and namespaces.

Another note: Filter Logic is extremely difficult to grok through now, we need to refactor

TODO

  • e2e test
  • Extend Unit tests to add cases for regex
  • namespaceComplianceValidator to test for regex namespaces

End to End Test: PR

Related Issue

Fixes #582

Relates to #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 85.50725% with 10 lines in your changes missing coverage. Please review.

Project coverage is 85.91%. Comparing base (6db4b40) to head (c3fa1dd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/capability.ts 0.00% 9 Missing ⚠️
src/lib/filter.ts 94.73% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1156      +/-   ##
==========================================
+ Coverage   85.87%   85.91%   +0.03%     
==========================================
  Files          27       27              
  Lines        1126     1193      +67     
  Branches      243      261      +18     
==========================================
+ Hits          967     1025      +58     
- Misses        145      166      +21     
+ Partials       14        2      -12     
Files with missing lines Coverage Δ
src/lib/helpers.ts 97.60% <100.00%> (+0.56%) ⬆️
src/lib/types.ts 100.00% <ø> (ø)
src/lib/filter.ts 84.41% <94.73%> (+3.38%) ⬆️
src/lib/capability.ts 30.30% <0.00%> (-1.96%) ⬇️

... and 3 files with indirect coverage changes

@cmwylie19 cmwylie19 added needs docs needs docs needs tests and removed needs docs needs docs labels Sep 19, 2024
src/lib/helpers.ts Outdated Show resolved Hide resolved
@cmwylie19 cmwylie19 marked this pull request as ready for review September 20, 2024 20:45
@cmwylie19 cmwylie19 added this to the v0.37.0 milestone Sep 23, 2024
@cmwylie19 cmwylie19 self-assigned this Sep 23, 2024
src/lib/capability.ts Outdated Show resolved Hide resolved
src/lib/filter.test.ts Outdated Show resolved Hide resolved
src/lib/filter.test.ts Outdated Show resolved Hide resolved
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Copy link
Collaborator

@btlghrants btlghrants left a comment

Choose a reason for hiding this comment

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

Given our (lengthy) in-person review earlier, your need to move over to an alternate-watcher implementation post-haste, and the fact that we already discussed how a follow-on refactor story will be coming out of the this + what I'm working on currently, this PR is acceptable.

@cmwylie19 cmwylie19 merged commit 0781707 into main Sep 23, 2024
15 of 16 checks passed
@cmwylie19 cmwylie19 deleted the 582-regex branch September 23, 2024 20:08
btlghrants added a commit that referenced this pull request Sep 23, 2024
## Description

Considers ignored namespaces in filters when determining whether to
process a workload.

Depends on: #1156

End to End Test:
defenseunicorns/pepr-excellent-examples#75
specifically hello-pepr-regex-name

## Related Issue

Fixes #1162 
<!-- or -->
Relates to #

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Co-authored-by: Barrett <81570928+btlghrants@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Look Into Allowing Regex in InNamespace
2 participants