Repository navigation
🚨 Update go modules (main) (major) #3287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ import ( | |
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/MakeNowJust/heredoc" | ||
| "github.com/MakeNowJust/heredoc/v2" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] alias-mismatch The import is changed from github.com/MakeNowJust/heredoc (unaliased) to github.com/MakeNowJust/heredoc/v2. Verified: the v2 module package name is heredoc, so unaliased import resolves correctly. No action needed. |
||
| ecc "github.com/conforma/crds/api/v1alpha1" | ||
| "github.com/spf13/afero" | ||
| "github.com/stretchr/testify/mock" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ | |
| "time" | ||
|
|
||
| ecc "github.com/conforma/crds/api/v1alpha1" | ||
| "github.com/santhosh-tekuri/jsonschema/v5" | ||
| "github.com/santhosh-tekuri/jsonschema/v6" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Migrate the schema compilation call with the import.
Replace the call with the v6 compiler and resource-registration APIs.
|
||
| "github.com/sigstore/cosign/v3/cmd/cosign/cli/fulcio" | ||
| "github.com/sigstore/cosign/v3/cmd/cosign/cli/rekor" | ||
| "github.com/sigstore/cosign/v3/pkg/cosign" | ||
|
|
@@ -638,7 +638,7 @@ | |
| } | ||
|
|
||
| func validatePolicyConfig(policyConfig string) error { | ||
| policySchema, err := jsonschema.CompileString("schema.json", ecc.Schema) | ||
| if err != nil { | ||
| log.Errorf("Failed to compile schema: %s", err) | ||
| return err | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| _ "embed" | ||
| "strings" | ||
|
|
||
| "github.com/santhosh-tekuri/jsonschema/v5" | ||
| "github.com/santhosh-tekuri/jsonschema/v6" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [high] API-incompatibility The import is changed from jsonschema/v5 to jsonschema/v6, but the code uses the v5 API surface which has breaking changes in v6: (1) compiler.AssertFormat is a bool field in v5 but a method in v6, (2) compiler.AddResource() signature changed, (3) jsonschema.CompileString() exists in v5 but not in v6. The same issue affects internal/policy/policy.go and internal/evaluation_target/application_snapshot_image/application_snapshot_image.go. Suggested fix: Either revert the jsonschema version bump to stay on v5, or update all call sites to use the v6 API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the format-assertion configuration for v6. The assignment Use the v6 format-assertion configuration API before compiling the schemas.
|
||
| ) | ||
|
|
||
| //go:embed slsa_provenance_v0.2.json | ||
|
|
@@ -39,7 +39,7 @@ | |
|
|
||
| func init() { | ||
| compiler := jsonschema.NewCompiler() | ||
| compiler.AssertFormat = true | ||
|
|
||
| if err := compiler.AddResource(SLSA_Provenance_v0_2_URI, strings.NewReader(slsa_provenance_v0_2_json)); err != nil { | ||
| panic(err) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the declared v4 module path.
go mod downloadfails because v4.1.9 declaresgithub.com/go-jose/go-jose/v4, notgopkg.in/go-jose/go-jose.v4. This blocks the Lint and CodeQL jobs. Use the declared path, or remove the v4 requirement if it is not needed.Source: Pipeline failures
Restore the go-jose v2 requirement or migrate the import.
acceptance/image/image.gostill importsgopkg.in/go-jose/go-jose.v2/json. This change removes the v2 requirement fromacceptance/go.mod. Go requires the main module to list any module that provides an imported package. A transitive dependency does not satisfy this rule, so the import cannot resolve.The minimal fix restores the v2 requirement that the import needs:
Suggested fix
Alternatively, migrate the import in
acceptance/image/image.goto the v4jsonpackage. That change also requires a correct v4 module path ingo.mod.Committable suggestion