Skip to content
Merged
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 pkg/skills/skillsvc/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (s *service) getContentFromOCI(ctx context.Context, ref string) (*skills.Sk
if pullErr != nil {
return nil, httperr.WithCode(
fmt.Errorf("pulling OCI artifact %q: %w", qualifiedRef, pullErr),
http.StatusBadRequest,
http.StatusBadGateway,
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/skills/skillsvc/content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestGetContent(t *testing.T) {
assert.Equal(t, http.StatusBadRequest, httperr.Code(err))
})

t.Run("pull failure propagates as 400", func(t *testing.T) {
t.Run("pull failure propagates as 502", func(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)

Expand All @@ -142,7 +142,7 @@ func TestGetContent(t *testing.T) {
)
_, err = svc.GetContent(t.Context(), skills.ContentOptions{Reference: "ghcr.io/org/my-skill:v1"})
require.Error(t, err)
assert.Equal(t, http.StatusBadRequest, httperr.Code(err))
assert.Equal(t, http.StatusBadGateway, httperr.Code(err))
assert.Contains(t, err.Error(), "registry unreachable")
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/skills/skillsvc/install_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *service) installFromOCI(
if err != nil {
return nil, httperr.WithCode(
fmt.Errorf("pulling OCI artifact %q: %w", ociRef, err),
http.StatusBadRequest,
http.StatusBadGateway,
)
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/skills/skillsvc/install_oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func TestInstallQualifiedNameOCIFallback(t *testing.T) {
// No lookup mock — gomock will fail the test if SearchSkills is called.
return nil, reg, ociStore, nil, store, pr
},
wantCode: http.StatusBadRequest,
wantCode: http.StatusBadGateway,
wantErr: "auth required",
},
{
Expand All @@ -604,7 +604,7 @@ func TestInstallQualifiedNameOCIFallback(t *testing.T) {
store := storemocks.NewMockSkillStore(ctrl)
return lookup, reg, ociStore, nil, store, pr
},
wantCode: http.StatusBadRequest,
wantCode: http.StatusBadGateway,
wantErr: "no such host",
},
{
Expand All @@ -625,7 +625,7 @@ func TestInstallQualifiedNameOCIFallback(t *testing.T) {
// No lookup mock — gomock will fail the test if SearchSkills is called.
return nil, reg, ociStore, nil, store, pr
},
wantCode: http.StatusBadRequest,
wantCode: http.StatusBadGateway,
wantErr: "manifest unknown",
},
{
Expand All @@ -645,7 +645,7 @@ func TestInstallQualifiedNameOCIFallback(t *testing.T) {
// No lookup mock — gomock will fail if SearchSkills is called.
return nil, reg, ociStore, nil, store, pr
},
wantCode: http.StatusBadRequest,
wantCode: http.StatusBadGateway,
wantErr: "auth required",
},
{
Expand Down
Loading