Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splunkclient-go: Do not use incorrect build tags #2891

Merged
merged 13 commits into from
Feb 22, 2024

Conversation

andrewwdye
Copy link
Contributor

@andrewwdye andrewwdye commented Feb 15, 2024

Overview

go build (and friends) include build tags for current and prior versions of go (i.e., go 1.21 has tags go1.21, go1.20, go1.19, ...). The existing go:build directive in splunkclient-go checks the for absence of tags go1.1 -> go1.16, which will always fail.

This change modifies the directive to indicate go 1.17 as the min version.

Also fixed lint and test failures. For the latter, removed attributed that were tested for but not returned from ClientRequest for semconv 1.17.

Testing

Before

❯ cd splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go
❯ go test ./... -v
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/internal/config	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/option	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/transport	[no test files]

After

❯ go test ./... -v
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/internal/config	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/option	[no test files]
=== RUN   TestNewWrapperFuncNilRoundTripper
--- PASS: TestNewWrapperFuncNilRoundTripper (0.00s)
=== RUN   TestRequestToSpanNameUnrecognized
--- PASS: TestRequestToSpanNameUnrecognized (0.00s)
=== RUN   TestRequestPathToSpanName
--- PASS: TestRequestPathToSpanName (0.00s)
=== RUN   TestRequestMethodToSpanName
--- PASS: TestRequestMethodToSpanName (0.00s)
=== RUN   TestWrappedBodyRead
--- PASS: TestWrappedBodyRead (0.00s)
=== RUN   TestWrappedBodyReadEOFError
--- PASS: TestWrappedBodyReadEOFError (0.00s)
=== RUN   TestWrappedBodyReadError
--- PASS: TestWrappedBodyReadError (0.00s)
=== RUN   TestWrappedBodyClose
--- PASS: TestWrappedBodyClose (0.00s)
=== RUN   TestWrappedBodyCloseError
--- PASS: TestWrappedBodyCloseError (0.00s)
=== RUN   TestWrappedRoundTripperError
--- PASS: TestWrappedRoundTripperError (0.00s)
PASS
ok  	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/transport	(cached)

fixes #2890

@andrewwdye andrewwdye requested review from a team as code owners February 15, 2024 22:40
Copy link

github-actions bot commented Feb 15, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@andrewwdye
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

srv-gh-o11y-gdi-cla added a commit to splunk/cla-agreement that referenced this pull request Feb 16, 2024
@andrewwdye
Copy link
Contributor Author

recheck

Copy link
Contributor

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewwdye Thanks for the issue and PR 👍

Can you also try adding a changelog entry to make the PR more complete?

@andrewwdye andrewwdye requested a review from a team as a code owner February 20, 2024 01:41
Copy link
Contributor

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MrAlias, PTAL

CHANGELOG.md Outdated Show resolved Hide resolved
@pellared pellared changed the title Set splunkclient-go min version to go1.17 Fix splunkclient-go for go1.20+ Feb 20, 2024
@pellared pellared changed the title Fix splunkclient-go for go1.20+ Fix splunkclient-go build tags Feb 20, 2024
@pellared pellared changed the title Fix splunkclient-go build tags Fix splunkclient-go to not use incorrect build tags Feb 20, 2024
@pellared pellared changed the title Fix splunkclient-go to not use incorrect build tags splunkclient-go: Do not use incorrect build tags Feb 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.04%. Comparing base (63aef34) to head (e594c9c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2891      +/-   ##
==========================================
+ Coverage   78.34%   80.04%   +1.70%     
==========================================
  Files          85       88       +3     
  Lines        3293     2897     -396     
==========================================
- Hits         2580     2319     -261     
+ Misses        639      502     -137     
- Partials       74       76       +2     
Flag Coverage Δ
Linux 80.04% <100.00%> (+0.59%) ⬆️
Windows ?
macOS 76.07% <100.00%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MrAlias
Copy link
Contributor

MrAlias commented Feb 20, 2024

@andrewwdye thank you for the contribution! Please sign your commits. We required signed commits for the project to ensure authenticity.

@andrewwdye andrewwdye force-pushed the splunkclient-go-min-version branch from d6de4fc to edebcc2 Compare February 22, 2024 05:56
andrewwdye and others added 8 commits February 21, 2024 22:04
Signed-off-by: Andrew Dye <andrewwdye@gmail.com>
Signed-off-by: Andrew Dye <andrewwdye@gmail.com>
Signed-off-by: Andrew Dye <andrewwdye@gmail.com>
signalfx#2892)

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.56.1 to 1.56.2.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](golangci/golangci-lint@v1.56.1...v1.56.2)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@andrewwdye andrewwdye force-pushed the splunkclient-go-min-version branch from edebcc2 to 33d3b6a Compare February 22, 2024 06:04
@andrewwdye
Copy link
Contributor Author

I rebased with my commits signed (and @pellared 's commits signed as co-authored). I assume there is another step here to co-sign but was unsure

@pellared pellared enabled auto-merge (squash) February 22, 2024 20:21
@pellared pellared merged commit 120f753 into signalfx:main Feb 22, 2024
20 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

splunkclient-go does not build or run tests, cannot be imported
4 participants