Skip to content

Conversation

@zachaller
Copy link
Contributor

@zachaller zachaller commented Feb 17, 2025

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=ACMRT

This feature is good for mono repos where we only care about a particular sub directory grouping of application/environments

@zachaller zachaller force-pushed the filtering-support-main branch from 57eb6fc to 9ad40dc Compare February 17, 2025 19:12
@zachaller zachaller force-pushed the filtering-support-main branch from fc94634 to 417a74f Compare February 17, 2025 19:20
@zachaller zachaller force-pushed the filtering-support-main branch from 417a74f to d7eee22 Compare February 17, 2025 19:21
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.16%. Comparing base (00a72be) to head (32e6e74).

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.
📢 Have feedback on the report? Share it here.

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]>
@zachaller zachaller marked this pull request as draft February 17, 2025 23:10
@zachaller zachaller force-pushed the filtering-support-main branch from e04828b to b33d8fb Compare February 17, 2025 23:20
ProposedCommitStatuses []CommitStatusSelector `json:"proposedCommitStatuses"`

// +kubebuilder:validation:Optional
OpenPullerRequestFilter *OpenPullerRequestFilter `json:"openPullRequestFilter,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like "relevantFilesFilter"?

Copy link
Contributor Author

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


for _, file := range diffOutput {
for _, pathPattern := range filter.Paths {
matched, err := filepath.Match(pathPattern, file)
Copy link
Contributor

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]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
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.

3 participants