-
Notifications
You must be signed in to change notification settings - Fork 30
feat: add filter path support #199
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Zach Aller <[email protected]>
57eb6fc to
9ad40dc
Compare
Signed-off-by: Zach Aller <[email protected]>
fc94634 to
417a74f
Compare
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
417a74f to
d7eee22
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
==========================================
+ Coverage 57.13% 57.16% +0.02%
==========================================
Files 11 11
Lines 1507 1508 +1
==========================================
+ Hits 861 862 +1
Misses 534 534
Partials 112 112 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
e04828b to
b33d8fb
Compare
| ProposedCommitStatuses []CommitStatusSelector `json:"proposedCommitStatuses"` | ||
|
|
||
| // +kubebuilder:validation:Optional | ||
| OpenPullerRequestFilter *OpenPullerRequestFilter `json:"openPullRequestFilter,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like "relevantFilesFilter"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think under this top level key, we would also include things like commitMessageFilters, commitUsers, etc etc
internal/git/git.go
Outdated
|
|
||
| for _, file := range diffOutput { | ||
| for _, pathPattern := range filter.Paths { | ||
| matched, err := filepath.Match(pathPattern, file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably think about how we can mitigate directory traversal risks when applying glob patterns. Since we return a boolean, I think the only risk is path enumeration.
…promoter into filtering-support-main Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
…filtering-support-main
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
…filtering-support-main Signed-off-by: Zach Aller <[email protected]>
This feature adds a new field to the spec that lets users specific which files need to be changed from the output of a
git diff <environmentBranch> <environmentNextBranch> --name-only --diff-filter=ACMRTThis feature is good for mono repos where we only care about a particular sub directory grouping of application/environments