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

Add YAMLLint to CI #1933

Merged
merged 10 commits into from
Jul 4, 2024
Merged

Conversation

mowies
Copy link
Member

@mowies mowies commented Jul 1, 2024

Fixes #1688

Changes

Note

There's are lots of errors showing right now, using the default ruleset.
For now, I copied the ruleset from https://github.com/open-telemetry/opentelemetry-demo/blob/main/.yamllint which seems reasonable to me, but there's still some linting errors. I can definitely fix the remaining linter errors if somebody here tells me to :)

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
Copy link

linux-foundation-easycla bot commented Jul 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters documentation Improvements or additions to documentation labels Jul 1, 2024
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
@mowies mowies marked this pull request as ready for review July 1, 2024 06:44
@mowies mowies requested a review from a team July 1, 2024 06:44
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.70%. Comparing base (71655ce) to head (648442c).
Report is 350 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1933      +/-   ##
==========================================
- Coverage   73.91%   70.70%   -3.21%     
==========================================
  Files         267      298      +31     
  Lines        9615    11133    +1518     
==========================================
+ Hits         7107     7872     +765     
- Misses       2508     3261     +753     
Flag Coverage Δ
unittests-Exporter.Geneva 53.20% <ø> (?)
unittests-Exporter.InfluxDB 95.88% <ø> (?)
unittests-Exporter.Instana 71.24% <ø> (?)
unittests-Exporter.OneCollector 91.29% <ø> (?)
unittests-Exporter.Stackdriver 75.73% <ø> (?)
unittests-Extensions 79.33% <ø> (?)
unittests-Extensions.AWS 77.24% <ø> (?)
unittests-Extensions.Enrichment 100.00% <ø> (?)
unittests-Instrumentation.AWS 87.56% <ø> (?)
unittests-Instrumentation.AWSLambda 87.96% <ø> (?)
unittests-Instrumentation.AspNetCore 85.27% <ø> (?)
unittests-Instrumentation.ElasticsearchClient 79.87% <ø> (?)
unittests-Instrumentation.EntityFrameworkCore 55.49% <ø> (?)
unittests-Instrumentation.EventCounters 76.36% <ø> (?)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (?)
unittests-Instrumentation.Hangfire 93.58% <ø> (?)
unittests-Instrumentation.Http 81.08% <ø> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.Quartz 78.94% <ø> (?)
unittests-Instrumentation.Runtime 100.00% <ø> (?)
unittests-Instrumentation.SqlClient 90.90% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 67.02% <ø> (?)
unittests-Instrumentation.Wcf 48.91% <ø> (?)
unittests-PersistentStorage 65.44% <ø> (?)
unittests-Resources.AWS 77.93% <ø> (?)
unittests-Resources.Azure 77.94% <ø> (?)
unittests-Resources.Container 72.41% <ø> (?)
unittests-Resources.Gcp 72.54% <ø> (?)
unittests-Resources.Host 47.67% <ø> (?)
unittests-Resources.Process 81.81% <ø> (?)
unittests-Resources.ProcessRuntime 72.91% <ø> (?)
unittests-Sampler.AWS 87.97% <ø> (?)

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

see 323 files with indirect coverage changes

@Kielek
Copy link
Contributor

Kielek commented Jul 1, 2024

@mowies, thanks for doing this.

As you described, this job is failing: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/9739790217/job/26875671492?pr=1933.
Before merging we need to fix it.
I have a couple of comments/questions there

  1. Lister reports both Errors and Warnings. What happen if it will have only warnings? Will it fail or just left a comment? If it only left a comment in the execution, we should either disabled it, or better treat as errors. We do not need to soft recommendation. Nobody will be checking the CI output.
  2. Line length - I think that we could just disabled this/double the value to 400. I do not see this as problematic (just personal opinion, you can fix all occurrences to 200).
  3. Please fix all other, obvious issues reporter by the linter.

@mowies
Copy link
Member Author

mowies commented Jul 1, 2024

  1. Lister reports both Errors and Warnings. What happen if it will have only warnings? Will it fail or just left a comment? If it only left a comment in the execution, we should either disabled it, or better treat as errors. We do not need to soft recommendation. Nobody will be checking the CI output.

So we have 2 options for this: strict mode and ignoring warnings

  • strict mode: yamllint will treat warnings as errors and will return with a non-zero exit code also when there's just warnings
  • ignoring warnings: yamllint will not print any warnings, just errors
  1. Line length - I think that we could just disabled this/double the value to 400. I do not see this as problematic (just personal opinion, you can fix all occurrences to 200).

I will disable the rule.

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
@github-actions github-actions bot added the comp:instrumentation.cassandra Things related to OpenTelemetry.Instrumentation.Cassandra label Jul 1, 2024
@mowies
Copy link
Member Author

mowies commented Jul 1, 2024

@Kielek fixed all current linter errors, ignored the warnings for now. Please see my previous comment :)

@Kielek
Copy link
Contributor

Kielek commented Jul 1, 2024

@movies, I think that we can ignore all warnings in this PR and enable strict mode in follow up/disable unwanted warnings one by one.

Now it pulutes output and PRs:
image
image

BTW, it will be great if you allow maintainers to modify your pr-branch. With this, we can merge all changes from current main, and merge it without waiting for you.

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
@mowies
Copy link
Member Author

mowies commented Jul 1, 2024

@movies, I think that we can ignore all warnings in this PR and enable strict mode in follow up/disable unwanted warnings one by one.

Sounds good @Kielek , I changed the command to include --no-warnings and updated the contrib guide accordingly.

BTW, it will be great if you allow maintainers to modify your pr-branch. With this, we can merge all changes from current main, and merge it without waiting for you.

It seems that I can't, since my fork is owned by an organization and not my personal account...
But I merged main now.

@Kielek
Copy link
Contributor

Kielek commented Jul 4, 2024

@mowies, could you please merge main branch to your PR branch? I think that we are good to merge.

Consider creating follow up issues/PRs with enabling more strict validation.

@Kielek Kielek merged commit 38cd963 into open-telemetry:main Jul 4, 2024
278 of 279 checks passed
@mowies mowies deleted the add-yamllint branch July 4, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.cassandra Things related to OpenTelemetry.Instrumentation.Cassandra documentation Improvements or additions to documentation infra Infra work - CI/CD, code coverage, linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[repo] Add linting of yml/yaml files in CI
7 participants