Skip to content

Adds vanity import check#4180

Merged
bogdandrutu merged 8 commits intoopen-telemetry:mainfrom
jcchavezs:adds_go_porto
Oct 12, 2021
Merged

Adds vanity import check#4180
bogdandrutu merged 8 commits intoopen-telemetry:mainfrom
jcchavezs:adds_go_porto

Conversation

@jcchavezs
Copy link
Copy Markdown
Contributor

@jcchavezs jcchavezs commented Oct 6, 2021

Important

This PR fixes the vanity imports and add a check to verify them on CI.

Follows from open-telemetry/opentelemetry-go#2255

@jcchavezs jcchavezs requested review from a team and jpkrohling October 6, 2021 20:25
@jcchavezs jcchavezs changed the title Adds go porto Adds vanity import check Oct 6, 2021
Comment thread .github/workflows/build-and-test.yml
Comment thread .github/workflows/build-and-test.yml
Comment thread .github/workflows/build-and-test.yml
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 6, 2021

Codecov Report

Merging #4180 (84ec462) into main (6654804) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4180   +/-   ##
=======================================
  Coverage   87.73%   87.73%           
=======================================
  Files         174      174           
  Lines       10335    10335           
=======================================
  Hits         9067     9067           
  Misses       1016     1016           
  Partials      252      252           
Impacted Files Coverage Δ
client/client.go 85.71% <ø> (ø)
component/build_info.go 100.00% <ø> (ø)
component/componenthelper/component.go 100.00% <ø> (ø)
component/componenttest/nop_exporter.go 100.00% <ø> (ø)
component/componenttest/nop_extension.go 100.00% <ø> (ø)
component/componenttest/nop_factories.go 29.41% <ø> (ø)
component/componenttest/nop_host.go 100.00% <ø> (ø)
component/componenttest/nop_processor.go 100.00% <ø> (ø)
component/componenttest/nop_receiver.go 100.00% <ø> (ø)
component/componenttest/nop_telemetry.go 100.00% <ø> (ø)
... and 158 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6654804...84ec462. Read the comment docs.

Copy link
Copy Markdown
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

After this PR the Collector will have the same issue (open-telemetry/opentelemetry-go#2279) that the Go instrumentation library has today: internal packages are not checked so they can end up having an incorrect vanity import comment (which breaks some builds).

That can be okay in the short term but we should think if we want to either (i) disallow vanity import comments on internal packages or (ii) add them too and check them with porto.

@jcchavezs
Copy link
Copy Markdown
Contributor Author

jcchavezs commented Oct 7, 2021 via email

@bogdandrutu
Copy link
Copy Markdown
Member

@jcchavezs what is the solution/proposal for @mx-psi issue?

@jcchavezs
Copy link
Copy Markdown
Contributor Author

@bogdandrutu I think the codebase is big enough to be able to use vanity import for internal packages. @mx-psi already introduced a great addition to include internal packages in this PR so I guess it is only a matter to agree to include internal packages here and opentelemetry-go (following open-telemetry/opentelemetry-go#2277). Does that make sense @bogdandrutu @mx-psi?

Comment thread Makefile.Common Outdated

.PHONY: porto
porto:
porto -w ./
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we use "--include-internal" ?

@mx-psi
Copy link
Copy Markdown
Member

mx-psi commented Oct 12, 2021

I think the same solution as in opentelemetry-go makes sense, it looks like for this repo we probably just need a new porto release with jcchavezs/porto#11 and jcchavezs/porto#12 for that to happen :)

@jcchavezs
Copy link
Copy Markdown
Contributor Author

Done @mx-psi https://github.com/jcchavezs/porto/releases/tag/v0.3.0

@jcchavezs
Copy link
Copy Markdown
Contributor Author

I will update this PR accordingly.

@bogdandrutu
Copy link
Copy Markdown
Member

@jcchavezs the lint job fails.

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Can't find porto for the lint job

porto -w ./
/bin/bash: porto: command not found

@jcchavezs
Copy link
Copy Markdown
Contributor Author

@bogdandrutu failure seems unrelated. Could you please retrigger?

@bogdandrutu bogdandrutu merged commit 9d3a8a4 into open-telemetry:main Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants