Skip to content

Commit e51ea05

Browse files
committed
PR fixes
1 parent 1ab2dcc commit e51ea05

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

storage/artifactory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func (s *Artifactory) AddExtension(ctx context.Context, manifest *VSIXManifest,
288288
// going to Artifactory for the VSIX when it is missing on disk (basically
289289
// using the disk as a cache).
290290
func (s *Artifactory) Open(ctx context.Context, fp string) (fs.File, error) {
291-
resp, code, err := s.request(ctx, http.MethodGet, path.Join(s.repo, fp), nil)
291+
resp, code, err := s.read(ctx, path.Join(s.repo, fp))
292292
if err != nil {
293293
switch code {
294294
case http.StatusNotFound:
@@ -301,7 +301,7 @@ func (s *Artifactory) Open(ctx context.Context, fp string) (fs.File, error) {
301301
}
302302

303303
f := mem.NewFileHandle(mem.CreateFile(fp))
304-
_, err = io.Copy(f, resp.Body)
304+
_, err = io.Copy(f, resp)
305305
if err != nil {
306306
return nil, err
307307
}

storage/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (s *Local) AddExtension(ctx context.Context, manifest *VSIXManifest, vsix [
129129

130130
for _, file := range extra {
131131
path := filepath.Join(dir, file.RelativePath)
132-
err := os.MkdirAll(filepath.Dir(path), 0o644)
132+
err := os.MkdirAll(filepath.Dir(path), 0o755)
133133
if err != nil {
134134
return "", err
135135
}

storage/signature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (s *Signature) Manifest(ctx context.Context, publisher, name string, versio
9393
//
9494
// - VSCodium requires a signature to exist, but it does appear to actually read
9595
// the signature. Meaning the signature could be empty, incorrect, or a
96-
// picture of cat and it would work. There is so signature verification.
96+
// picture of cat and it would work. There is no signature verification.
9797
//
9898
// - VSCode requires a signature payload to exist, but the context appear
9999
// to be somewhat optional.

storage/storage_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"strconv"
1616
"testing"
1717

18-
"github.com/stretchr/testify/assert"
1918
"github.com/stretchr/testify/require"
2019

2120
"github.com/coder/code-marketplace/storage"
@@ -338,9 +337,7 @@ func testManifest(t *testing.T, factory storageFactory) {
338337
if f.expectedManifest != nil {
339338
f.expectedManifest(test.expected)
340339
}
341-
if !assert.Equal(t, test.expected, manifest) {
342-
fmt.Println("Asd")
343-
}
340+
require.Equal(t, test.expected, manifest)
344341
}
345342
})
346343
}

0 commit comments

Comments
 (0)