-
Notifications
You must be signed in to change notification settings - Fork 2
🎁 Copy/Delete filters #45
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
🎁 Copy/Delete filters #45
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
029e6f0 to
ebce0fc
Compare
ecf1ac4 to
d21b0ff
Compare
583795b to
7a54f2f
Compare
7a54f2f to
273e066
Compare
273e066 to
3bbd6e6
Compare
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.
Pull Request Overview
This PR introduces configurable copy-from-midstream and delete-from-upstream filters to replace the hard-coded GitHub workflows removal, and integrates these filters into the Git checkout and sync operations.
- Add
files.FiltersAPI for include/exclude glob patterns with matching and deletion support - Update
git.Checkout.OntoWorkspaceto take and applyFilterswhen copying files - Replace
removeGithubWorkflowswithremoveUnwantedUpstreamFilesdriven by the new delete filters
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/files/filters.go | New Filters and Matcher types with glob-based include/exclude |
| pkg/files/filters_test.go | Unit tests for the Matcher coverage |
| pkg/files/delete_by_filters.go | DeleteFiles implementation using filters |
| pkg/files/delete_by_filters_test.go | Tests for deleting files based on filters |
| pkg/git/checkout.go | Updated OntoWorkspace to accept Filters and filter file tree |
| pkg/git/checkout_test.go | End-to-end test for checkout plus filtering |
| pkg/sync/remove_unwanted_upstream_files.go | Add step to delete unwanted upstream files based on filters |
| pkg/sync/remove_github_workflows.go | Removed legacy workflows-only removal |
| pkg/sync/fork_files.go | Updated sync steps to use new copy/delete filters |
| pkg/config/structure.go & defaults.go | Replace workflow glob with Filters for copy/delete config |
| pkg/config/git/checkout.go | Change Checkout interface to include filter parameter |
| go.mod | Add github.com/gobwas/glob dependency |
Comments suppressed due to low confidence (3)
pkg/git/checkout.go:90
- There are no unit tests covering the new filtering logic in OntoWorkspace/applyTree; consider adding tests to verify that files are correctly included or excluded during checkout.
func (o onGoingCheckout) OntoWorkspace(filters files.Filters) error {
pkg/sync/remove_unwanted_upstream_files.go:7
- [nitpick] Publicly visible methods like removeUnwantedUpstreamFiles lack documentation comments; please add a brief doc comment explaining its behavior and parameters.
func (o Operation) removeUnwantedUpstreamFiles() error {
pkg/config/git/checkout.go:9
- [nitpick] Changing the Checkout interface to require a Filters parameter is a breaking API change; consider versioning this change or providing an overload to preserve backward compatibility.
OntoWorkspace(filters files.Filters) error
Co-authored-by: Copilot <[email protected]>
ca24bad
into
openshift-knative:main
Changes
/kind enhancement