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

feat: add boolean behavior for durations #24272

Merged
merged 16 commits into from
Jul 17, 2023

Conversation

fchikwekwe
Copy link
Contributor

@fchikwekwe fchikwekwe commented Jul 14, 2023

Description: Allows time comparison by enabling boolean behavior for time objects.

Link to tracking Issue: Closes #22713

Testing: Unit tests

Documentation:

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

@fchikwekwe please take a look at the failing CI, otherwise looks good.

@fchikwekwe
Copy link
Contributor Author

I resolved merge conflicts, and merged a change to fix CI. Just waiting to see if that helped.

@TylerHelmuth
Copy link
Member

@fchikwekwe looks like one more linter is complaining

@fchikwekwe
Copy link
Contributor Author

@TylerHelmuth yes, I'm looking into it. This test is passing fine for me locally so I'm not fully understanding why its not passing for this linter.

@crobert-1
Copy link
Member

ottl/compare.go:147: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/open-telemetry/opentelemetry-collector-contrib) (gci)
level=info msg="File cache stats: 108 entries of total size 660.6KiB"
  }
ottl/parser_test.go:883: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/open-telemetry/opentelemetry-collector-contrib) (gci)
          if !ok {
ottl/parser_test.go:893: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/open-telemetry/opentelemetry-collector-contrib) (gci)
  }
level=info msg="Memory: 206 samples, avg is 112.6MB, max is 519.2MB"
level=info msg="Execution took 20.921[166](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/5557168194/jobs/10150627304?pr=24272#step:8:167)796s"
make[2]: *** [../../Makefile.Common:[167](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/5557168194/jobs/10150627304?pr=24272#step:8:168): lint] Error 1
make[2]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/pkg/ottl'
make[1]: *** [Makefile:176: pkg/ottl] Error 2

I believe you just need to run make gofmt.

pkg/ottl/boolean_value_test.go Outdated Show resolved Hide resolved
pkg/ottl/compare.go Show resolved Hide resolved
@TylerHelmuth
Copy link
Member

@fchikwekwe
Copy link
Contributor Author

@TylerHelmuth I added the documentation that you mentioned to pkg/ottl/README.md. My columns are quite verbose, so please let me know if I need to correct them.

pkg/ottl/README.md Outdated Show resolved Hide resolved
pkg/ottl/README.md Outdated Show resolved Hide resolved
@TylerHelmuth TylerHelmuth merged commit 6ba05da into open-telemetry:main Jul 17, 2023
89 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pkg/ottl] Boolean expressions are update to be able to handle comparing time.Duration types
4 participants