From 16776508872f40efd9c721e494fae59cf1be0f1f Mon Sep 17 00:00:00 2001 From: Mahad Zaryab <43658574+mahadzaryab1@users.noreply.github.com> Date: Wed, 25 Dec 2024 11:30:07 -0500 Subject: [PATCH] [fix] Fix incorrect usage of iter package in aggregator (#6403) ## Description of the changes - https://github.com/jaegertracing/jaeger/pull/6401 was accidentally using the official `iter` package instead of the internal one. This PR fixes that usage. - Added a linter rule so we don't accidentally use the official package again until we upgrade to Go 1.23 ## How was this change tested? - CI ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Mahad Zaryab --- .golangci.yml | 8 ++++++++ internal/jptrace/aggregator.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bf9ff03b876..97170f1338a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -146,6 +146,14 @@ linters-settings: files: - "!**/jptrace/**" + # TODO: remove once we have upgraded to Go 1.23 + disallow-iter: + deny: + - pkg: iter + desc: "Use github.com/jaegertracing/jaeger/pkg/iter" + files: + - "**" + goimports: local-prefixes: github.com/jaegertracing/jaeger gosec: diff --git a/internal/jptrace/aggregator.go b/internal/jptrace/aggregator.go index fa8cde63646..f8c4b5c12d8 100644 --- a/internal/jptrace/aggregator.go +++ b/internal/jptrace/aggregator.go @@ -4,10 +4,10 @@ package jptrace import ( - "iter" - "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" + + "github.com/jaegertracing/jaeger/pkg/iter" ) // AggregateTraces aggregates a sequence of trace batches into individual traces.