Skip to content

fix(tool): otelc setup command failing to run#468

Open
amazingakai wants to merge 5 commits into
open-telemetry:mainfrom
amazingakai:fix-otelc-setup
Open

fix(tool): otelc setup command failing to run#468
amazingakai wants to merge 5 commits into
open-telemetry:mainfrom
amazingakai:fix-otelc-setup

Conversation

@amazingakai
Copy link
Copy Markdown
Contributor

Description

Fixes otelc setup command failing to run.
Also allows passing build, install or go as package names to getBuildPackages function.

Motivation

Currently running otelc setup command fails because setupPhase.listBuildPlan() expects arguments as go build ...:

$ otelc setup   
Error:
[0] at least 2 arguments are required

Stack:
[0] github.com/open-telemetry/opentelemetry-go-compile-instrumentation/tool/internal/setup/find.go:78 tool/internal/setup.(*SetupPhase).listBuildPlan
[1] github.com/open-telemetry/opentelemetry-go-compile-instrumentation/tool/internal/setup/find.go:208 tool/internal/setup.(*SetupPhase).findDeps
[2] github.com/open-telemetry/opentelemetry-go-compile-instrumentation/tool/internal/setup/setup.go:175 tool/internal/setup.Setup
[3] github.com/urfave/cli/v3@v3.6.1/command_run.go:354 github.com/urfave/cli/v3.(*Command).run
[4] github.com/urfave/cli/v3@v3.6.1/command_run.go:288 github.com/urfave/cli/v3.(*Command).run
[5] github.com/urfave/cli/v3@v3.6.1/command_run.go:94 github.com/urfave/cli/v3.(*Command).Run
[6] github.com/open-telemetry/opentelemetry-go-compile-instrumentation/tool/cmd/main.go:100 main.main
[7] runtime/proc.go:285 runtime.main

Also, passing "build", "install" or "go" as package names to getBuildPackages skips them as the loop breaks and it fallbacks to . as the default.


Checklist

  • PR title follows conventional commits format
  • Code formatted: make format
  • Linters pass: make lint
  • Tests pass: make test
  • Tests added for new functionality
  • Tests follow testing guidelines
  • Documentation updated (if applicable)

@amazingakai amazingakai requested a review from a team as a code owner May 6, 2026 15:51
@github-actions github-actions Bot added the scope:fix A bug that is being fixed label May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.71%. Comparing base (c0d5da8) to head (d04b37e).

Files with missing lines Patch % Lines
tool/internal/setup/find.go 0.00% 9 Missing ⚠️
tool/internal/setup/setup.go 0.00% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
- Coverage   62.73%   62.71%   -0.02%     
==========================================
  Files          62       62              
  Lines        4760     4758       -2     
==========================================
- Hits         2986     2984       -2     
+ Misses       1529     1528       -1     
- Partials      245      246       +1     
Flag Coverage Δ
tool 62.71% <0.00%> (-0.02%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 41.17647% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.13%. Comparing base (c0d5da8) to head (7c1e615).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
tool/internal/setup/setup.go 0.00% 7 Missing and 1 partial ⚠️
tool/internal/setup/find.go 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   62.73%   63.13%   +0.40%     
==========================================
  Files          62       62              
  Lines        4760     4763       +3     
==========================================
+ Hits         2986     3007      +21     
+ Misses       1529     1509      -20     
- Partials      245      247       +2     
Flag Coverage Δ
tool 63.13% <41.17%> (+0.40%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@txabman42 txabman42 left a comment

Choose a reason for hiding this comment

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

Nice PR! TY for the fix ❤️

Just some minor nitpicks

Comment thread tool/internal/setup/find.go Outdated
Comment thread tool/internal/setup/setup.go Outdated
Comment thread tool/internal/setup/setup.go
amazingakai and others added 4 commits May 12, 2026 11:17
Co-authored-by: Xabier Martinez <39015378+txabman42@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@txabman42 txabman42 left a comment

Choose a reason for hiding this comment

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

LGTM! ❤️

@txabman42 txabman42 requested a review from a team May 12, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:fix A bug that is being fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants