From c105cc05fa64b87ad14e25f16e263f514421fdd9 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Thu, 21 Nov 2024 10:33:01 -0500 Subject: [PATCH] migrate common processor code to internal Signed-off-by: Alex Goodman --- .../{ => internal}/common/clean_fixed_in_version.go | 0 pkg/process/{ => internal}/common/constraint.go | 0 pkg/process/{ => internal}/common/constraint_test.go | 0 pkg/process/{ => internal}/tests/utils.go | 0 pkg/process/processors/github_processor_test.go | 2 +- .../processors/match_exclusion_processor_test.go | 2 +- pkg/process/processors/msrc_processor_test.go | 2 +- pkg/process/processors/nvd_processor_test.go | 2 +- pkg/process/processors/os_processor_test.go | 2 +- pkg/process/v1/transformers/github/transform.go | 2 +- pkg/process/v1/transformers/github/transform_test.go | 2 +- pkg/process/v1/transformers/nvd/transform_test.go | 2 +- pkg/process/v1/transformers/nvd/unique_pkg.go | 2 +- pkg/process/v1/transformers/os/transform.go | 2 +- pkg/process/v1/transformers/os/transform_test.go | 2 +- pkg/process/v2/transformers/github/transform.go | 2 +- pkg/process/v2/transformers/github/transform_test.go | 8 ++++---- pkg/process/v2/transformers/nvd/transform_test.go | 4 ++-- pkg/process/v2/transformers/nvd/unique_pkg.go | 2 +- pkg/process/v2/transformers/os/transform.go | 2 +- pkg/process/v2/transformers/os/transform_test.go | 4 ++-- pkg/process/v3/transformers/github/transform.go | 2 +- pkg/process/v3/transformers/github/transform_test.go | 10 +++++----- pkg/process/v3/transformers/msrc/transform.go | 2 +- pkg/process/v3/transformers/msrc/transform_test.go | 6 +++--- pkg/process/v3/transformers/nvd/transform_test.go | 4 ++-- pkg/process/v3/transformers/nvd/unique_pkg.go | 2 +- pkg/process/v3/transformers/os/transform.go | 2 +- pkg/process/v3/transformers/os/transform_test.go | 8 ++++---- pkg/process/v4/transformers/github/transform.go | 2 +- pkg/process/v4/transformers/github/transform_test.go | 10 +++++----- pkg/process/v4/transformers/msrc/transform.go | 2 +- pkg/process/v4/transformers/msrc/transform_test.go | 6 +++--- pkg/process/v4/transformers/nvd/transform_test.go | 4 ++-- pkg/process/v4/transformers/nvd/unique_pkg.go | 2 +- pkg/process/v4/transformers/os/transform.go | 2 +- pkg/process/v4/transformers/os/transform_test.go | 4 ++-- pkg/process/v5/transformers/github/transform.go | 2 +- pkg/process/v5/transformers/github/transform_test.go | 10 +++++----- pkg/process/v5/transformers/msrc/transform.go | 2 +- pkg/process/v5/transformers/msrc/transform_test.go | 6 +++--- pkg/process/v5/transformers/nvd/transform_test.go | 4 ++-- pkg/process/v5/transformers/nvd/unique_pkg.go | 2 +- pkg/process/v5/transformers/os/transform.go | 2 +- pkg/process/v5/transformers/os/transform_test.go | 4 ++-- 45 files changed, 72 insertions(+), 72 deletions(-) rename pkg/process/{ => internal}/common/clean_fixed_in_version.go (100%) rename pkg/process/{ => internal}/common/constraint.go (100%) rename pkg/process/{ => internal}/common/constraint_test.go (100%) rename pkg/process/{ => internal}/tests/utils.go (100%) diff --git a/pkg/process/common/clean_fixed_in_version.go b/pkg/process/internal/common/clean_fixed_in_version.go similarity index 100% rename from pkg/process/common/clean_fixed_in_version.go rename to pkg/process/internal/common/clean_fixed_in_version.go diff --git a/pkg/process/common/constraint.go b/pkg/process/internal/common/constraint.go similarity index 100% rename from pkg/process/common/constraint.go rename to pkg/process/internal/common/constraint.go diff --git a/pkg/process/common/constraint_test.go b/pkg/process/internal/common/constraint_test.go similarity index 100% rename from pkg/process/common/constraint_test.go rename to pkg/process/internal/common/constraint_test.go diff --git a/pkg/process/tests/utils.go b/pkg/process/internal/tests/utils.go similarity index 100% rename from pkg/process/tests/utils.go rename to pkg/process/internal/tests/utils.go diff --git a/pkg/process/processors/github_processor_test.go b/pkg/process/processors/github_processor_test.go index f4c203ce..ea7d549f 100644 --- a/pkg/process/processors/github_processor_test.go +++ b/pkg/process/processors/github_processor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/anchore/grype-db/pkg/data" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" ) diff --git a/pkg/process/processors/match_exclusion_processor_test.go b/pkg/process/processors/match_exclusion_processor_test.go index 060e27bc..4fef6d6f 100644 --- a/pkg/process/processors/match_exclusion_processor_test.go +++ b/pkg/process/processors/match_exclusion_processor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/anchore/grype-db/pkg/data" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" ) diff --git a/pkg/process/processors/msrc_processor_test.go b/pkg/process/processors/msrc_processor_test.go index e95f2f66..c1a7d439 100644 --- a/pkg/process/processors/msrc_processor_test.go +++ b/pkg/process/processors/msrc_processor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/anchore/grype-db/pkg/data" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" ) diff --git a/pkg/process/processors/nvd_processor_test.go b/pkg/process/processors/nvd_processor_test.go index e2179f83..8fa214f9 100644 --- a/pkg/process/processors/nvd_processor_test.go +++ b/pkg/process/processors/nvd_processor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/anchore/grype-db/pkg/data" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" ) diff --git a/pkg/process/processors/os_processor_test.go b/pkg/process/processors/os_processor_test.go index 3718fd1c..0cfdfd0a 100644 --- a/pkg/process/processors/os_processor_test.go +++ b/pkg/process/processors/os_processor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/anchore/grype-db/pkg/data" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" ) diff --git a/pkg/process/v1/transformers/github/transform.go b/pkg/process/v1/transformers/github/transform.go index 75fbaf22..05593bb1 100644 --- a/pkg/process/v1/transformers/github/transform.go +++ b/pkg/process/v1/transformers/github/transform.go @@ -2,7 +2,7 @@ package github import ( "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v1/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v1" diff --git a/pkg/process/v1/transformers/github/transform_test.go b/pkg/process/v1/transformers/github/transform_test.go index d0cc3f1d..9e8ab758 100644 --- a/pkg/process/v1/transformers/github/transform_test.go +++ b/pkg/process/v1/transformers/github/transform_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v1" ) diff --git a/pkg/process/v1/transformers/nvd/transform_test.go b/pkg/process/v1/transformers/nvd/transform_test.go index 57e140b2..cecb2f98 100644 --- a/pkg/process/v1/transformers/nvd/transform_test.go +++ b/pkg/process/v1/transformers/nvd/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v1" ) diff --git a/pkg/process/v1/transformers/nvd/unique_pkg.go b/pkg/process/v1/transformers/nvd/unique_pkg.go index 20a62777..34621368 100644 --- a/pkg/process/v1/transformers/nvd/unique_pkg.go +++ b/pkg/process/v1/transformers/nvd/unique_pkg.go @@ -7,7 +7,7 @@ import ( "github.com/umisama/go-cpe" "github.com/anchore/grype-db/internal/log" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" ) diff --git a/pkg/process/v1/transformers/os/transform.go b/pkg/process/v1/transformers/os/transform.go index dcb270e1..df8c3b24 100644 --- a/pkg/process/v1/transformers/os/transform.go +++ b/pkg/process/v1/transformers/os/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v1/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v1" diff --git a/pkg/process/v1/transformers/os/transform_test.go b/pkg/process/v1/transformers/os/transform_test.go index bd0334df..1b3b7560 100644 --- a/pkg/process/v1/transformers/os/transform_test.go +++ b/pkg/process/v1/transformers/os/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + testUtils "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v1" ) diff --git a/pkg/process/v2/transformers/github/transform.go b/pkg/process/v2/transformers/github/transform.go index 873ac1a9..5efac22a 100644 --- a/pkg/process/v2/transformers/github/transform.go +++ b/pkg/process/v2/transformers/github/transform.go @@ -2,7 +2,7 @@ package github import ( "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v2/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v2" diff --git a/pkg/process/v2/transformers/github/transform_test.go b/pkg/process/v2/transformers/github/transform_test.go index c548233c..2099cef9 100644 --- a/pkg/process/v2/transformers/github/transform_test.go +++ b/pkg/process/v2/transformers/github/transform_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v2" ) @@ -69,7 +69,7 @@ func TestParseGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-1.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) assert.NoError(t, err) @@ -123,7 +123,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-npm-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) assert.NoError(t, err) @@ -155,7 +155,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { func TestFilterWithdrawnEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-withdrawn.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) diff --git a/pkg/process/v2/transformers/nvd/transform_test.go b/pkg/process/v2/transformers/nvd/transform_test.go index 7d10d18a..ae308a1f 100644 --- a/pkg/process/v2/transformers/nvd/transform_test.go +++ b/pkg/process/v2/transformers/nvd/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v2" ) @@ -16,7 +16,7 @@ import ( func TestUnmarshalVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.NvdVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v2/transformers/nvd/unique_pkg.go b/pkg/process/v2/transformers/nvd/unique_pkg.go index 20a62777..34621368 100644 --- a/pkg/process/v2/transformers/nvd/unique_pkg.go +++ b/pkg/process/v2/transformers/nvd/unique_pkg.go @@ -7,7 +7,7 @@ import ( "github.com/umisama/go-cpe" "github.com/anchore/grype-db/internal/log" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" ) diff --git a/pkg/process/v2/transformers/os/transform.go b/pkg/process/v2/transformers/os/transform.go index f1c7dafc..436b7c17 100644 --- a/pkg/process/v2/transformers/os/transform.go +++ b/pkg/process/v2/transformers/os/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v2/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v2" diff --git a/pkg/process/v2/transformers/os/transform_test.go b/pkg/process/v2/transformers/os/transform_test.go index cae8160c..5235aee9 100644 --- a/pkg/process/v2/transformers/os/transform_test.go +++ b/pkg/process/v2/transformers/os/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v2" ) @@ -16,7 +16,7 @@ import ( func TestUnmarshalVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.OSVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v3/transformers/github/transform.go b/pkg/process/v3/transformers/github/transform.go index f9ec70cf..6605af9d 100644 --- a/pkg/process/v3/transformers/github/transform.go +++ b/pkg/process/v3/transformers/github/transform.go @@ -2,7 +2,7 @@ package github import ( "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v3/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" diff --git a/pkg/process/v3/transformers/github/transform_test.go b/pkg/process/v3/transformers/github/transform_test.go index ce0bc28c..c8fa2776 100644 --- a/pkg/process/v3/transformers/github/transform_test.go +++ b/pkg/process/v3/transformers/github/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" ) @@ -16,7 +16,7 @@ import ( func TestUnmarshalGitHubEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -92,7 +92,7 @@ func TestParseGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-1.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -154,7 +154,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-npm-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -184,7 +184,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { func TestFilterWithdrawnEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-withdrawn.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) diff --git a/pkg/process/v3/transformers/msrc/transform.go b/pkg/process/v3/transformers/msrc/transform.go index d1a1ea48..14d84da9 100644 --- a/pkg/process/v3/transformers/msrc/transform.go +++ b/pkg/process/v3/transformers/msrc/transform.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v3/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" diff --git a/pkg/process/v3/transformers/msrc/transform_test.go b/pkg/process/v3/transformers/msrc/transform_test.go index 4bb431c8..771e9e48 100644 --- a/pkg/process/v3/transformers/msrc/transform_test.go +++ b/pkg/process/v3/transformers/msrc/transform_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" ) @@ -15,7 +15,7 @@ import ( func TestUnmarshalMsrcVulnerabilities(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) @@ -94,7 +94,7 @@ func TestParseMSRCEntry(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v3/transformers/nvd/transform_test.go b/pkg/process/v3/transformers/nvd/transform_test.go index 1f136144..7dd1fb4c 100644 --- a/pkg/process/v3/transformers/nvd/transform_test.go +++ b/pkg/process/v3/transformers/nvd/transform_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" ) @@ -17,7 +17,7 @@ import ( func TestUnmarshalNVDVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.NvdVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v3/transformers/nvd/unique_pkg.go b/pkg/process/v3/transformers/nvd/unique_pkg.go index 4c994341..081e972b 100644 --- a/pkg/process/v3/transformers/nvd/unique_pkg.go +++ b/pkg/process/v3/transformers/nvd/unique_pkg.go @@ -7,7 +7,7 @@ import ( "github.com/umisama/go-cpe" "github.com/anchore/grype-db/internal/log" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" ) diff --git a/pkg/process/v3/transformers/os/transform.go b/pkg/process/v3/transformers/os/transform.go index 1ab8d60f..6caffd18 100644 --- a/pkg/process/v3/transformers/os/transform.go +++ b/pkg/process/v3/transformers/os/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v3/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" diff --git a/pkg/process/v3/transformers/os/transform_test.go b/pkg/process/v3/transformers/os/transform_test.go index 09834c2c..c2dca6b6 100644 --- a/pkg/process/v3/transformers/os/transform_test.go +++ b/pkg/process/v3/transformers/os/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/process/v3/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v3" @@ -17,7 +17,7 @@ import ( func TestUnmarshalOSVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.OSVulnerabilityEntries(f) require.NoError(t, err) @@ -27,7 +27,7 @@ func TestUnmarshalOSVulnerabilitiesEntries(t *testing.T) { } func TestParseVulnerabilitiesEntry(t *testing.T) { - tests := []struct { + tc := []struct { name string numEntries int fixture string @@ -493,7 +493,7 @@ func TestParseVulnerabilitiesEntry(t *testing.T) { }, } - for _, test := range tests { + for _, test := range tc { t.Run(test.name, func(t *testing.T) { f, err := os.Open(test.fixture) require.NoError(t, err) diff --git a/pkg/process/v4/transformers/github/transform.go b/pkg/process/v4/transformers/github/transform.go index d1599f6d..a7b099dc 100644 --- a/pkg/process/v4/transformers/github/transform.go +++ b/pkg/process/v4/transformers/github/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v4/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" diff --git a/pkg/process/v4/transformers/github/transform_test.go b/pkg/process/v4/transformers/github/transform_test.go index 4e5c1c85..9964fce6 100644 --- a/pkg/process/v4/transformers/github/transform_test.go +++ b/pkg/process/v4/transformers/github/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" "github.com/anchore/grype/grype/db/v4/namespace" @@ -70,7 +70,7 @@ func TestBuildGrypeNamespace(t *testing.T) { func TestUnmarshalGitHubEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -146,7 +146,7 @@ func TestParseGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-1.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -210,7 +210,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-npm-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -240,7 +240,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { func TestFilterWithdrawnEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-withdrawn.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) diff --git a/pkg/process/v4/transformers/msrc/transform.go b/pkg/process/v4/transformers/msrc/transform.go index b15dd881..6ccc225c 100644 --- a/pkg/process/v4/transformers/msrc/transform.go +++ b/pkg/process/v4/transformers/msrc/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v4/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" diff --git a/pkg/process/v4/transformers/msrc/transform_test.go b/pkg/process/v4/transformers/msrc/transform_test.go index d768204b..0ddcd6ff 100644 --- a/pkg/process/v4/transformers/msrc/transform_test.go +++ b/pkg/process/v4/transformers/msrc/transform_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" ) @@ -15,7 +15,7 @@ import ( func TestUnmarshalMsrcVulnerabilities(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) @@ -94,7 +94,7 @@ func TestParseMSRCEntry(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v4/transformers/nvd/transform_test.go b/pkg/process/v4/transformers/nvd/transform_test.go index 277527b8..df365b41 100644 --- a/pkg/process/v4/transformers/nvd/transform_test.go +++ b/pkg/process/v4/transformers/nvd/transform_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" ) @@ -17,7 +17,7 @@ import ( func TestUnmarshalNVDVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.NvdVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v4/transformers/nvd/unique_pkg.go b/pkg/process/v4/transformers/nvd/unique_pkg.go index 20a62777..34621368 100644 --- a/pkg/process/v4/transformers/nvd/unique_pkg.go +++ b/pkg/process/v4/transformers/nvd/unique_pkg.go @@ -7,7 +7,7 @@ import ( "github.com/umisama/go-cpe" "github.com/anchore/grype-db/internal/log" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" ) diff --git a/pkg/process/v4/transformers/os/transform.go b/pkg/process/v4/transformers/os/transform.go index 5a9796b4..9a6b5c09 100644 --- a/pkg/process/v4/transformers/os/transform.go +++ b/pkg/process/v4/transformers/os/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v4/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" diff --git a/pkg/process/v4/transformers/os/transform_test.go b/pkg/process/v4/transformers/os/transform_test.go index 745916a8..d14d45b5 100644 --- a/pkg/process/v4/transformers/os/transform_test.go +++ b/pkg/process/v4/transformers/os/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/process/v4/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v4" @@ -17,7 +17,7 @@ import ( func TestUnmarshalOSVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.OSVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v5/transformers/github/transform.go b/pkg/process/v5/transformers/github/transform.go index 91b31f7d..f2b26f6e 100644 --- a/pkg/process/v5/transformers/github/transform.go +++ b/pkg/process/v5/transformers/github/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v5/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" diff --git a/pkg/process/v5/transformers/github/transform_test.go b/pkg/process/v5/transformers/github/transform_test.go index c6727816..940b18f8 100644 --- a/pkg/process/v5/transformers/github/transform_test.go +++ b/pkg/process/v5/transformers/github/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/process/v5/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" @@ -64,7 +64,7 @@ func TestBuildGrypeNamespace(t *testing.T) { func TestUnmarshalGitHubEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -140,7 +140,7 @@ func TestParseGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-python-1.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -214,7 +214,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { f, err := os.Open("test-fixtures/github-github-npm-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) @@ -244,7 +244,7 @@ func TestDefaultVersionFormatNpmGitHubEntry(t *testing.T) { func TestFilterWithdrawnEntries(t *testing.T) { f, err := os.Open("test-fixtures/github-withdrawn.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.GitHubAdvisoryEntries(f) require.NoError(t, err) diff --git a/pkg/process/v5/transformers/msrc/transform.go b/pkg/process/v5/transformers/msrc/transform.go index a35e17e1..2f913bf6 100644 --- a/pkg/process/v5/transformers/msrc/transform.go +++ b/pkg/process/v5/transformers/msrc/transform.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v5/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" diff --git a/pkg/process/v5/transformers/msrc/transform_test.go b/pkg/process/v5/transformers/msrc/transform_test.go index 081965c9..cd964d2c 100644 --- a/pkg/process/v5/transformers/msrc/transform_test.go +++ b/pkg/process/v5/transformers/msrc/transform_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" ) @@ -15,7 +15,7 @@ import ( func TestUnmarshalMsrcVulnerabilities(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) @@ -94,7 +94,7 @@ func TestParseMSRCEntry(t *testing.T) { f, err := os.Open("test-fixtures/microsoft-msrc-0.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.MSRCVulnerabilityEntries(f) require.NoError(t, err) diff --git a/pkg/process/v5/transformers/nvd/transform_test.go b/pkg/process/v5/transformers/nvd/transform_test.go index 530094e0..9fd52a08 100644 --- a/pkg/process/v5/transformers/nvd/transform_test.go +++ b/pkg/process/v5/transformers/nvd/transform_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/provider/unmarshal" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" grypeDB "github.com/anchore/grype/grype/db/v5" @@ -21,7 +21,7 @@ import ( func TestUnmarshalNVDVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.NvdVulnerabilityEntries(f) assert.NoError(t, err) diff --git a/pkg/process/v5/transformers/nvd/unique_pkg.go b/pkg/process/v5/transformers/nvd/unique_pkg.go index b1284ebf..c4605277 100644 --- a/pkg/process/v5/transformers/nvd/unique_pkg.go +++ b/pkg/process/v5/transformers/nvd/unique_pkg.go @@ -7,7 +7,7 @@ import ( "github.com/umisama/go-cpe" "github.com/anchore/grype-db/internal/log" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/provider/unmarshal/nvd" ) diff --git a/pkg/process/v5/transformers/os/transform.go b/pkg/process/v5/transformers/os/transform.go index 54b3032e..1f75a08d 100644 --- a/pkg/process/v5/transformers/os/transform.go +++ b/pkg/process/v5/transformers/os/transform.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/anchore/grype-db/pkg/data" - "github.com/anchore/grype-db/pkg/process/common" + "github.com/anchore/grype-db/pkg/process/internal/common" "github.com/anchore/grype-db/pkg/process/v5/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" diff --git a/pkg/process/v5/transformers/os/transform_test.go b/pkg/process/v5/transformers/os/transform_test.go index 5b6514ce..c10e7b8d 100644 --- a/pkg/process/v5/transformers/os/transform_test.go +++ b/pkg/process/v5/transformers/os/transform_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - testUtils "github.com/anchore/grype-db/pkg/process/tests" + "github.com/anchore/grype-db/pkg/process/internal/tests" "github.com/anchore/grype-db/pkg/process/v5/transformers" "github.com/anchore/grype-db/pkg/provider/unmarshal" grypeDB "github.com/anchore/grype/grype/db/v5" @@ -19,7 +19,7 @@ import ( func TestUnmarshalOSVulnerabilitiesEntries(t *testing.T) { f, err := os.Open("test-fixtures/unmarshal-test.json") require.NoError(t, err) - defer testUtils.CloseFile(f) + defer tests.CloseFile(f) entries, err := unmarshal.OSVulnerabilityEntries(f) require.NoError(t, err)