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(sync): add tag excludeRegex filter #2906

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

vooon
Copy link
Contributor

@vooon vooon commented Jan 23, 2025

What type of PR is this?

feature

Which issue does this PR fix:

Fix #2902

What does this PR do / Why do we need it:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vooon vooon changed the title feat(sync): add tag reject_regex filter feat(sync): add tag rejectRegex filter Jan 23, 2025
@vooon vooon marked this pull request as ready for review January 23, 2025 14:34
andaaron
andaaron previously approved these changes Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 65.62500% with 11 lines in your changes missing coverage. Please review.

Project coverage is 91.86%. Comparing base (ececc9c) to head (26b4122).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/server/root.go 0.00% 7 Missing and 1 partial ⚠️
pkg/extensions/sync/content.go 87.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2906      +/-   ##
==========================================
- Coverage   91.89%   91.86%   -0.03%     
==========================================
  Files         170      170              
  Lines       30291    30323      +32     
==========================================
+ Hits        27836    27857      +21     
- Misses       1827     1836       +9     
- Partials      628      630       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

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

Would also add an example under examples/

@vooon For your particular use case, are you sure there is no workaround that can avoid this PR altogether.

pkg/extensions/config/sync/config.go Outdated Show resolved Hide resolved
@vooon
Copy link
Contributor Author

vooon commented Jan 24, 2025

@rchincha well, there are workaround, negate every character of the word: .*([^x][^8][^6][^_][^6][^4]|[^a][^a][^r][^c][^h][^6][^4])$

But that very soon will remind me famous perl test-test-test... :)

@vooon vooon changed the title feat(sync): add tag rejectRegex filter feat(sync): add tag excludeRegex filter Jan 24, 2025
@vooon vooon requested review from rchincha and andaaron January 24, 2025 11:01
@rchincha
Copy link
Contributor

What happens if both "regex" and "excludeRegex" are specified? and they step on each other?

@vooon
Copy link
Contributor Author

vooon commented Jan 25, 2025

@rchincha regex first select tags, then excludeRegrex filter-out matching tags from that list.

@andaaron
Copy link
Contributor

andaaron commented Jan 25, 2025

Isn't it the same result if you have the following ops on sets of tags:

  • All ∩ Regex - ExcludeRegex
  • All ∩ (Regex - ExcludeRegex)
  • (All - ExcludeRegex) ∩ Regex
    ?

@vooon
Copy link
Contributor Author

vooon commented Jan 26, 2025

@andaaron yes, all of that cases gives the same result. But the code more like that:

  • (All ∩ Regex) - ((All ∩ Regex) ∩ ExcludeRegex) (as we do not match all tags for exclude, but the ones already matched by include regex)

@rchincha rchincha merged commit 22864a9 into project-zot:main Jan 26, 2025
38 of 40 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.

[Feat]: Sync tags rejection regex
4 participants