Skip to content

Commit 0dab130

Browse files
authored
Merge pull request #14 from parca-dev/force-upload
Allow forcing a debuginfo upload even if it already exists
2 parents e98268b + 486c8c5 commit 0dab130

File tree

6 files changed

+228
-147
lines changed

6 files changed

+228
-147
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
# renovate: datasource=go depName=mvdan.cc/gofumpt
1111
GOFUMPT_VERSION: v0.3.1
1212
# renovate: datasource=go depName=github.com/golangci/golangci-lint
13-
GOLANGCI_LINT_VERSION: v1.50.1
13+
GOLANGCI_LINT_VERSION: v1.53.3
1414

1515
jobs:
1616
skip-check:

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
if: startsWith(github.ref, 'refs/tags/')
2020
container:
21-
image: docker.io/goreleaser/goreleaser-cross:v1.18.3
21+
image: docker.io/goreleaser/goreleaser-cross:v1.20.6
2222
options: --privileged
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -55,11 +55,11 @@ jobs:
5555
needs: binaries
5656
steps:
5757
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
58-
58+
5959
- name: Publish Vercel
6060
run: |
6161
curl -X POST "https://api.vercel.com/v1/integrations/deploy/${{ secrets.VERCEL_WEBHOOK }}"
62-
62+
6363
container:
6464
name: Build and release container images
6565
runs-on: ubuntu-latest

.golangci.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,17 @@ issues:
4444

4545
linters-settings:
4646
depguard:
47-
list-type: blacklist
48-
include-go-root: true
49-
packages-with-error-message:
50-
- sync/atomic: "Use go.uber.org/atomic instead of sync/atomic"
51-
- github.com/stretchr/testify/assert: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
52-
- github.com/go-kit/kit/log: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
53-
- github.com/pkg/errors: "Use fmt.Errorf instead"
47+
rules:
48+
Main:
49+
deny:
50+
- pkg: sync/atomic
51+
desc: Use go.uber.org/atomic instead of sync/atomic
52+
- pkg: github.com/stretchr/testify/assert
53+
desc: Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert
54+
- pkg: github.com/go-kit/kit/log
55+
desc: Use github.com/go-kit/log instead of github.com/go-kit/kit/log
56+
- pkg: github.com/pkg/errors
57+
desc: Use fmt.Errorf instead
5458
errcheck:
5559
exclude: ./.errcheck_excludes.txt
5660
goimports:

cmd/parca-debuginfo/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type flags struct {
5656
InsecureSkipVerify bool `kong:"help='Skip TLS certificate verification.'"`
5757
NoExtract bool `kong:"help='Do not extract debug information from binaries, just upload the binary as is.'"`
5858
NoInitiate bool `kong:"help='Do not initiate the upload, just check if it should be initiated.'"`
59+
Force bool `kong:"help='Force upload even if the Build ID is already uploaded.'"`
5960

6061
Paths []string `kong:"required,arg,name='path',help='Paths to upload.',type:'path'"`
6162
} `cmd:"" help:"Upload debug information files."`
@@ -180,7 +181,10 @@ func run(kongCtx *kong.Context, flags flags) error {
180181
}
181182

182183
for _, upload := range uploads {
183-
shouldInitiate, err := debuginfoClient.ShouldInitiateUpload(ctx, &debuginfopb.ShouldInitiateUploadRequest{BuildId: upload.buildID})
184+
shouldInitiate, err := debuginfoClient.ShouldInitiateUpload(ctx, &debuginfopb.ShouldInitiateUploadRequest{
185+
BuildId: upload.buildID,
186+
Force: flags.Upload.Force,
187+
})
184188
if err != nil {
185189
return fmt.Errorf("check if upload should be initiated for %q with Build ID %q: %w", upload.path, upload.buildID, err)
186190
}
@@ -207,6 +211,7 @@ func run(kongCtx *kong.Context, flags flags) error {
207211
BuildId: upload.buildID,
208212
Hash: hash,
209213
Size: upload.size,
214+
Force: flags.Upload.Force,
210215
})
211216
if err != nil {
212217
return fmt.Errorf("initiate upload for %q with Build ID %q: %w", upload.path, upload.buildID, err)

go.mod

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
module github.com/parca-dev/parca-debuginfo
22

3-
go 1.19
3+
go 1.20
44

55
require (
6-
github.com/alecthomas/kong v0.7.1
6+
github.com/alecthomas/kong v0.8.0
77
github.com/go-kit/log v0.2.1
88
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
99
github.com/oklog/run v1.1.0
10-
github.com/parca-dev/parca v0.15.0
10+
github.com/parca-dev/parca v0.18.1-0.20230714102256-04bf3e42dfea
1111
github.com/parca-dev/parca-agent v0.12.1-0.20230216133018-8dd5ccaeef0f
12-
github.com/prometheus/client_golang v1.14.0
12+
github.com/prometheus/client_golang v1.16.0
1313
github.com/rzajac/flexbuf v0.14.0
14-
google.golang.org/grpc v1.53.0
14+
google.golang.org/grpc v1.56.2
1515
)
1616

1717
require (
18-
cloud.google.com/go v0.107.0 // indirect
19-
cloud.google.com/go/compute v1.15.1 // indirect
18+
cloud.google.com/go v0.110.2 // indirect
19+
cloud.google.com/go/compute v1.20.1 // indirect
2020
cloud.google.com/go/compute/metadata v0.2.3 // indirect
21-
cloud.google.com/go/iam v0.8.0 // indirect
22-
cloud.google.com/go/storage v1.28.1 // indirect
23-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
24-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
25-
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
26-
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
27-
github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect
21+
cloud.google.com/go/iam v1.1.0 // indirect
22+
cloud.google.com/go/storage v1.31.0 // indirect
23+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1 // indirect
24+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 // indirect
25+
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
26+
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.5.1 // indirect
27+
github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 // indirect
2828
github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible // indirect
2929
github.com/aws/aws-sdk-go-v2 v1.16.0 // indirect
3030
github.com/aws/aws-sdk-go-v2/config v1.15.1 // indirect
@@ -43,25 +43,29 @@ require (
4343
github.com/clbanning/mxj v1.8.4 // indirect
4444
github.com/davecgh/go-spew v1.1.1 // indirect
4545
github.com/dustin/go-humanize v1.0.1 // indirect
46-
github.com/efficientgo/core v1.0.0-rc.0.0.20221201130417-ba593f67d2a4 // indirect
47-
github.com/go-logfmt/logfmt v0.5.1 // indirect
46+
github.com/efficientgo/core v1.0.0-rc.2 // indirect
47+
github.com/go-logfmt/logfmt v0.6.0 // indirect
48+
github.com/go-logr/logr v1.2.4 // indirect
49+
github.com/go-logr/stdr v1.2.2 // indirect
4850
github.com/goburrow/cache v0.1.4 // indirect
4951
github.com/gofrs/flock v0.8.1 // indirect
50-
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
52+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
5153
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
52-
github.com/golang/protobuf v1.5.2 // indirect
54+
github.com/golang/protobuf v1.5.3 // indirect
5355
github.com/google/go-cmp v0.5.9 // indirect
5456
github.com/google/go-querystring v1.1.0 // indirect
55-
github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f // indirect
57+
github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect
58+
github.com/google/s2a-go v0.1.4 // indirect
5659
github.com/google/uuid v1.3.0 // indirect
57-
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
58-
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
59-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect
60+
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
61+
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
62+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
6063
github.com/hashicorp/errwrap v1.1.0 // indirect
6164
github.com/hashicorp/go-multierror v1.1.1 // indirect
65+
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.3+incompatible // indirect
6266
github.com/json-iterator/go v1.1.12 // indirect
63-
github.com/klauspost/compress v1.15.15 // indirect
64-
github.com/klauspost/cpuid/v2 v2.1.1 // indirect
67+
github.com/klauspost/compress v1.16.7 // indirect
68+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
6569
github.com/kylelemons/godebug v1.1.0 // indirect
6670
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
6771
github.com/minio/md5-simd v1.1.2 // indirect
@@ -72,34 +76,37 @@ require (
7276
github.com/modern-go/reflect2 v1.0.2 // indirect
7377
github.com/mozillazg/go-httpheader v0.2.1 // indirect
7478
github.com/ncw/swift v1.0.53 // indirect
75-
github.com/opentracing/opentracing-go v1.2.0 // indirect
7679
github.com/oracle/oci-go-sdk/v65 v65.13.0 // indirect
77-
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
80+
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
7881
github.com/pkg/errors v0.9.1 // indirect
79-
github.com/prometheus/client_model v0.3.0 // indirect
80-
github.com/prometheus/common v0.39.0 // indirect
81-
github.com/prometheus/procfs v0.9.0 // indirect
82+
github.com/prometheus/client_model v0.4.0 // indirect
83+
github.com/prometheus/common v0.44.0 // indirect
84+
github.com/prometheus/procfs v0.11.0 // indirect
8285
github.com/rs/xid v1.4.0 // indirect
8386
github.com/sirupsen/logrus v1.9.0 // indirect
8487
github.com/sony/gobreaker v0.5.0 // indirect
8588
github.com/tencentyun/cos-go-sdk-v5 v0.7.40 // indirect
86-
github.com/thanos-io/objstore v0.0.0-20221207004404-2e4c6638339a // indirect
89+
github.com/thanos-io/objstore v0.0.0-20230713070940-eb01c83b89a4 // indirect
8790
go.opencensus.io v0.24.0 // indirect
88-
go.opentelemetry.io/otel v1.11.2 // indirect
89-
go.opentelemetry.io/otel/trace v1.11.2 // indirect
90-
golang.org/x/crypto v0.1.0 // indirect
91-
golang.org/x/net v0.5.0 // indirect
92-
golang.org/x/oauth2 v0.4.0 // indirect
93-
golang.org/x/sync v0.1.0 // indirect
94-
golang.org/x/sys v0.5.0 // indirect
95-
golang.org/x/text v0.6.0 // indirect
91+
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.42.0 // indirect
92+
go.opentelemetry.io/otel v1.16.0 // indirect
93+
go.opentelemetry.io/otel/metric v1.16.0 // indirect
94+
go.opentelemetry.io/otel/trace v1.16.0 // indirect
95+
golang.org/x/crypto v0.11.0 // indirect
96+
golang.org/x/net v0.12.0 // indirect
97+
golang.org/x/oauth2 v0.10.0 // indirect
98+
golang.org/x/sync v0.3.0 // indirect
99+
golang.org/x/sys v0.10.0 // indirect
100+
golang.org/x/text v0.11.0 // indirect
96101
golang.org/x/time v0.3.0 // indirect
97102
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
98-
google.golang.org/api v0.104.0 // indirect
103+
google.golang.org/api v0.131.0 // indirect
99104
google.golang.org/appengine v1.6.7 // indirect
100-
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
101-
google.golang.org/protobuf v1.28.1 // indirect
102-
gopkg.in/ini.v1 v1.66.6 // indirect
105+
google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 // indirect
106+
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect
107+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
108+
google.golang.org/protobuf v1.31.0 // indirect
109+
gopkg.in/ini.v1 v1.67.0 // indirect
103110
gopkg.in/yaml.v2 v2.4.0 // indirect
104111
)
105112

0 commit comments

Comments
 (0)