Skip to content
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

make locking packages an error #198

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/provider/config_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func unify(originals []string, inputs []resolved) ([]string, diag.Diagnostics) {
for _, input := range inputs {
missingHere := input.packages.Difference(acc.packages).Difference(missing)
if missingHere.Len() > 0 {
diagnostics = append(diagnostics, diag.NewWarningDiagnostic(
diagnostics = append(diagnostics, diag.NewErrorDiagnostic(
fmt.Sprintf("unable to lock certain packages for %s", input.arch),
fmt.Sprint(sets.List(missingHere)),
))
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/config_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ func TestUnify(t *testing.T) {
"foo=1.2.3",
},
wantDiag: []diag.Diagnostic{
diag.NewWarningDiagnostic("unable to lock certain packages for amd64", "[bonus]"),
diag.NewWarningDiagnostic("unable to lock certain packages for arm64", "[bonus]"),
diag.NewErrorDiagnostic("unable to lock certain packages for amd64", "[bonus]"),
diag.NewErrorDiagnostic("unable to lock certain packages for arm64", "[bonus]"),
},
}, {
name: "provided direct dependency",
Expand Down Expand Up @@ -471,8 +471,8 @@ func TestUnify(t *testing.T) {
"foo=1.2.3",
},
wantDiag: []diag.Diagnostic{
diag.NewWarningDiagnostic("unable to lock certain packages for amd64", "[intel-fast-as-f-math]"),
diag.NewWarningDiagnostic("unable to lock certain packages for arm64", "[arm-energy-efficient-as-f-arithmetic]"),
diag.NewErrorDiagnostic("unable to lock certain packages for amd64", "[intel-fast-as-f-math]"),
diag.NewErrorDiagnostic("unable to lock certain packages for arm64", "[arm-energy-efficient-as-f-arithmetic]"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were intended as examples where we legitimately shouldn't fail because it is actually impossible to create a platform-independent lock file.

},
}}

Expand Down
Loading