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

Lint fails on CI when passing locally for import group count #6997

Closed
anuraaga opened this issue Jan 4, 2022 · 6 comments
Closed

Lint fails on CI when passing locally for import group count #6997

anuraaga opened this issue Jan 4, 2022 · 6 comments
Labels
bug Something isn't working ci-cd CI, CD, testing, build issues closed as inactive good first issue Good for newcomers Stale

Comments

@anuraaga
Copy link
Contributor

anuraaga commented Jan 4, 2022

In https://github.com/open-telemetry/opentelemetry-collector-contrib/runs/4688228948?check_suite_focus=true

Lint fails with this

processor/transformprocessor/config_test.go: Expected no more than 3 groups, got 4
processor/transformprocessor/factory_test.go: Import groups are not in the proper order: ["Std" "Third party" "Third party"]
processor/transformprocessor/internal/traces/processor.go: Expected no more than 3 groups, got 4

This is despite when I do this

cd processor/transformprocessor
make lint

it succeeds. More tediously, make fmt also isn't able to fix the trivial import grouping problem. Could something in lint / fmt be misconfigured to cause this situation?

@anuraaga anuraaga added the bug Something isn't working label Jan 4, 2022
@jpkrohling jpkrohling added ci-cd CI, CD, testing, build issues good first issue Good for newcomers labels Jan 4, 2022
@anuraaga
Copy link
Contributor Author

anuraaga commented Jan 5, 2022

I noticed another detail - it seems make fmt often actually introduces another import group when formatting, it seems to be more interested in order rather than the groups. I'm still not sure why make lint would pass locally in this situation though, more important to fix that, but ideally make fmt could do the grouping correctly too.

@jefchien
Copy link
Contributor

So from what I understand, goimports doesn't combine the separate groups and then reorder/split them. It seems to run against each individual existing group. So, it will never decrease the number of groups that exist even if it should. There's an issue filed: golang/go#20818

make lint is fine with the imports. It's make impi that fails. If you run make impi with the imports that were in that PR, it correctly fails.

@anuraaga
Copy link
Contributor Author

Thanks @jefchien - I hadn't noticed the separate make impi command. Since linting is linting, should make lint also call the imports check?

@jefchien
Copy link
Contributor

I think it should. People typically expect the make lint command to be comprehensive. The workflows will need to be slightly adjusted though.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 7, 2022
animetauren pushed a commit to animetauren/opentelemetry-collector-contrib that referenced this issue Apr 4, 2023
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci-cd CI, CD, testing, build issues closed as inactive good first issue Good for newcomers Stale
Projects
None yet
Development

No branches or pull requests

3 participants