From d66c2680c2b27e435c82dff37aa36f3e2aa0cae6 Mon Sep 17 00:00:00 2001 From: Andrew Pollock Date: Fri, 2 Aug 2024 08:52:09 +1000 Subject: [PATCH] Merge Android ignore pattern into a single (#2440) This wasn't working as intended as multiple https://xkcd.com/1171/ --- docker/importer/importer_test.py | 6 ++++++ source_test.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/importer/importer_test.py b/docker/importer/importer_test.py index 2a974a8a614..5aee4debbe1 100644 --- a/docker/importer/importer_test.py +++ b/docker/importer/importer_test.py @@ -386,6 +386,12 @@ def test_ignore(self, mock_publish): # pylint: disable=unused-argument ignore_patterns=['(^(?!USN-).*$)']) self.assertTrue( source_repo_ignore_negative.ignore_file('/tmp/foo/CVE-2024-1234.json')) + source_repo_ignore_multiple = osv.SourceRepository( + ignore_patterns=['^(?!MAL-).*$', 'MAL-0000.*']) + self.assertTrue( + source_repo_ignore_multiple.ignore_file('/tmp/foo/CVE-2024-1234.json')) + self.assertTrue( + source_repo_ignore_multiple.ignore_file('/tmp/foo/MAL-0000-0001.json')) @mock.patch('importer.utcnow', lambda: datetime.datetime(2021, 1, 1)) diff --git a/source_test.yaml b/source_test.yaml index 4e61a7a5645..eedce269b89 100644 --- a/source_test.yaml +++ b/source_test.yaml @@ -44,7 +44,7 @@ - name: 'android' versions_from_repo: False type: 1 - ignore_patterns: ['^(?!A-).*$', '^(?!ASB-A-).*$', '^(?!PUB-ASB-A-).*$'] + ignore_patterns: ['^(?!(PUB-)?ASB-A-).*$'] detect_cherrypicks: False extension: '.json' bucket: 'android-osv-test'