Skip to content

Commit

Permalink
Migrate common processor code to internal (#432)
Browse files Browse the repository at this point in the history
* migrate common processor code to internal

Signed-off-by: Alex Goodman <[email protected]>

* name import alias testUtils

Signed-off-by: Alex Goodman <[email protected]>

---------

Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman authored Nov 21, 2024
1 parent 109081c commit e5ee538
Show file tree
Hide file tree
Showing 45 changed files with 43 additions and 43 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/process/processors/github_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/processors/match_exclusion_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/processors/msrc_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/processors/nvd_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/processors/os_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/github/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/github/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/nvd/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/nvd/unique_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/os/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v1/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/github/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/github/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/nvd/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/nvd/unique_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/os/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v2/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/github/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/github/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/msrc/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/msrc/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/nvd/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/nvd/unique_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v3/transformers/os/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions pkg/process/v3/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/process/v3/transformers"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
grypeDB "github.com/anchore/grype/grype/db/v3"
Expand All @@ -27,7 +27,7 @@ func TestUnmarshalOSVulnerabilitiesEntries(t *testing.T) {
}

func TestParseVulnerabilitiesEntry(t *testing.T) {
tests := []struct {
tc := []struct {
name string
numEntries int
fixture string
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/github/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/github/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v4"
"github.com/anchore/grype/grype/db/v4/namespace"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/msrc/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/msrc/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v4"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/nvd/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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/v4"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/nvd/unique_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/os/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v4/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/process/v4/transformers"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
grypeDB "github.com/anchore/grype/grype/db/v4"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/github/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/github/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/process/v5/transformers"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
grypeDB "github.com/anchore/grype/grype/db/v5"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/msrc/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/msrc/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/v5"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/nvd/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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"
"github.com/anchore/grype-db/pkg/provider/unmarshal/nvd"
grypeDB "github.com/anchore/grype/grype/db/v5"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/nvd/unique_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/os/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/process/v5/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/process/v5/transformers"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
grypeDB "github.com/anchore/grype/grype/db/v5"
Expand Down

0 comments on commit e5ee538

Please sign in to comment.