From fa85613b47d0bda092b2177ac48b28f67672e568 Mon Sep 17 00:00:00 2001 From: Nicolas Savoire Date: Mon, 30 Sep 2024 19:15:32 +0200 Subject: [PATCH] Fix symbol upload (#21) * Return early if the symbol is already uploaded * Improve logging --- reporter/symbol_querier.go | 2 -- reporter/symbol_uploader.go | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reporter/symbol_querier.go b/reporter/symbol_querier.go index 562c824..6455f6c 100644 --- a/reporter/symbol_querier.go +++ b/reporter/symbol_querier.go @@ -66,8 +66,6 @@ func (d *DatadogSymbolQuerier) QuerySymbols(ctx context.Context, buildIDs []stri return nil, fmt.Errorf("error marshaling symbols query request: %w", err) } - fmt.Printf("Querying symbols with request: %s\n", string(body)) - req, err := http.NewRequestWithContext(ctx, http.MethodPost, d.symbolQueryURL, bytes.NewReader(body)) if err != nil { return nil, fmt.Errorf("failed to create request: %w", err) diff --git a/reporter/symbol_uploader.go b/reporter/symbol_uploader.go index 46ecb00..506db52 100644 --- a/reporter/symbol_uploader.go +++ b/reporter/symbol_uploader.go @@ -184,6 +184,7 @@ func (d *DatadogSymbolUploader) GetExistingSymbolsOnBackend(ctx context.Context, } } + log.Debugf("Existing symbols for executable %s with build: %v", e, symbolSource) return symbolSource, nil } @@ -225,8 +226,9 @@ func (d *DatadogSymbolUploader) upload(ctx context.Context, uploadData uploadDat } if existingSymbolSource >= symbolSource { - log.Debugf("Skipping symbol upload for executable %s: existing symbols with source %v", fileName, + log.Infof("Skipping symbol upload for executable %s: existing symbols with source %v", fileName, existingSymbolSource.String()) + return true } symbolPath := debugElf.actualFileName