diff --git a/compare/commands/compare/interactors/fetch_impacted_files.py b/compare/commands/compare/interactors/fetch_impacted_files.py index 0e722d1d38..f25acd58c1 100644 --- a/compare/commands/compare/interactors/fetch_impacted_files.py +++ b/compare/commands/compare/interactors/fetch_impacted_files.py @@ -1,7 +1,7 @@ import enum from typing import List, Optional -from shared.utils.match import match +from shared.utils.match import Matcher import services.components as components from codecov.commands.base import BaseInteractor @@ -74,11 +74,8 @@ def _apply_filters( res = impacted_files if components_paths: - res = [ - file - for file in impacted_files - if match(components_paths, file.head_name) - ] + matcher = Matcher(components_paths) + res = [file for file in impacted_files if matcher.match(file.head_name)] return res def get_attribute( diff --git a/requirements.in b/requirements.in index 3beaf26362..ad9ecc1765 100644 --- a/requirements.in +++ b/requirements.in @@ -25,7 +25,7 @@ freezegun google-cloud-pubsub gunicorn>=22.0.0 https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem -https://github.com/codecov/shared/archive/016a756f2ab982016bc2d46e2467be71604c0ba5.tar.gz#egg=shared +https://github.com/codecov/shared/archive/3aea532ed80c4d941cbc50e27b11147a8f72d3cd.tar.gz#egg=shared https://github.com/photocrowd/django-cursor-pagination/archive/f560902696b0c8509e4d95c10ba0d62700181d84.tar.gz idna>=3.7 minio diff --git a/requirements.txt b/requirements.txt index c1d64fd296..18edbcaae6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -416,7 +416,7 @@ sentry-sdk[celery]==2.13.0 # shared setproctitle==1.1.10 # via -r requirements.in -shared @ https://github.com/codecov/shared/archive/016a756f2ab982016bc2d46e2467be71604c0ba5.tar.gz +shared @ https://github.com/codecov/shared/archive/3aea532ed80c4d941cbc50e27b11147a8f72d3cd.tar.gz # via -r requirements.in simplejson==3.17.2 # via -r requirements.in diff --git a/services/path.py b/services/path.py index a2f637b408..372bd90a1f 100644 --- a/services/path.py +++ b/services/path.py @@ -11,7 +11,7 @@ from shared.reports.resources import Report from shared.reports.types import ReportTotals from shared.torngit.exceptions import TorngitClientError -from shared.utils.match import match +from shared.utils.match import Matcher import services.report as report_service from codecov_auth.models import Owner @@ -195,7 +195,8 @@ def files(self) -> list[str]: # Do path filtering if needed if self.filter_paths: - files = [file for file in files if match(self.filter_paths, file)] + matcher = Matcher(self.filter_paths) + files = [file for file in files if matcher.match(file)] return files