Skip to content

Conversation

@cardil
Copy link
Member

@cardil cardil commented Jun 5, 2025

Changes

  • 🎁 Adds copy from upstream and delete from midstream filters

/kind enhancement

@cardil cardil requested a review from Copilot June 5, 2025 18:29
@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Jun 5, 2025
@openshift-ci openshift-ci bot requested review from dsimansk and maschmid June 5, 2025 18:29
@openshift-ci
Copy link

openshift-ci bot commented Jun 5, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This comment was marked as outdated.

@cardil cardil force-pushed the feature/upstream-midstream-filters branch from 029e6f0 to ebce0fc Compare June 6, 2025 10:03
@cardil cardil force-pushed the feature/upstream-midstream-filters branch from ecf1ac4 to d21b0ff Compare June 6, 2025 12:42
@cardil cardil requested a review from Copilot June 6, 2025 12:43

This comment was marked as outdated.

@cardil cardil requested a review from Copilot June 8, 2025 21:40

This comment was marked as outdated.

@cardil cardil force-pushed the feature/upstream-midstream-filters branch from 583795b to 7a54f2f Compare June 8, 2025 21:48
@cardil cardil requested a review from Copilot June 8, 2025 21:51

This comment was marked as outdated.

@cardil cardil force-pushed the feature/upstream-midstream-filters branch from 7a54f2f to 273e066 Compare June 8, 2025 21:56
@cardil cardil force-pushed the feature/upstream-midstream-filters branch from 273e066 to 3bbd6e6 Compare June 9, 2025 10:00
@cardil cardil requested a review from Copilot June 9, 2025 10:00
Copy link
Contributor

Copilot AI left a 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.Filters API for include/exclude glob patterns with matching and deletion support
  • Update git.Checkout.OntoWorkspace to take and apply Filters when copying files
  • Replace removeGithubWorkflows with removeUnwantedUpstreamFiles driven 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

@cardil cardil added the lgtm label Jun 9, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit ca24bad into openshift-knative:main Jun 9, 2025
4 checks passed
@cardil cardil deleted the feature/upstream-midstream-filters branch June 9, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants