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

Check that regexps match in linear time #3042

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Conversation

lloeki
Copy link
Member

@lloeki lloeki commented Aug 10, 2023

What does this PR do?

Check that various regexps we include match in linear time.

Motivation

Some regexps used to not match in linear time, we fixed some, but have not audited all of them. In addition, this will help prevent regressions.

Additional Notes

Hinges on Regexp.linear_time?, introduced in Ruby 3.3.

How to test the change?

Specs

@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Aug 10, 2023
@lloeki lloeki mentioned this pull request Aug 10, 2023
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

This is a great test!

@ivoanjo
Copy link
Member

ivoanjo commented Mar 27, 2024

This is a nice change -- maybe worth pushing over the line?

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.72%. Comparing base (fe9272b) to head (ff08e5c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3042   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files        1356     1356           
  Lines       82494    82494           
  Branches     4221     4221           
=======================================
+ Hits        80614    80615    +1     
+ Misses       1880     1879    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pr-commenter
Copy link

pr-commenter bot commented Dec 9, 2024

Benchmarks

Benchmark execution time: 2025-01-15 21:44:33

Comparing candidate commit ff08e5c in PR branch check-regexp-linear-time with baseline commit fe9272b in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 30 metrics, 2 unstable metrics.

scenario:profiler - stack collector

  • 🟩 throughput [+141.426op/s; +143.469op/s] or [+5.082%; +5.156%]

@ivoanjo ivoanjo marked this pull request as ready for review December 9, 2024 10:36
@ivoanjo ivoanjo requested a review from a team as a code owner December 9, 2024 10:36
@ivoanjo
Copy link
Member

ivoanjo commented Dec 9, 2024

Something seems weird about this PR in CI -- see my note on #3042 (comment)

p added 3 commits January 15, 2025 16:18
* master: (161 commits)
  Bump to version 2.9.0 (#4293)
  Increase type checking coverage (#4290)
  DEBUG-3329 rename datadog/di/init to datadog/di/preload (#4288)
  update supported versions workflow (#4289)
  DEBUG-3182 DI railtie (#4272)
  DEBUG-3328 report DI status in environment logger summary (#4285)
  Move out ostruct gem from test group for Ruby 3.5
  DEBUG-3316 verify code tracking works in forked processes (#4284)
  Fix rebase issue in Rack::RequestMiddleware
  Improve code style in AppSec rack middlewares
  Improve variable naming in Rack::RequestBodyMiddleware
  Improve variable naming in Rack::RequestMiddleware
  Simplify Rack::RequestMiddleware
  Switch AppSec rack blocking to throw
  Extract to .gitlab/scripts
  Implement polling vaccine
  Update RBS signatures
  Add new RSpec negate matcher not_change
  Replace direct AppSec::Processor::Context calls
  Change AppSec::Context exposed interface
  ...
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 15, 2025

Datadog Report

Branch report: check-regexp-linear-time
Commit report: ff08e5c
Test service: dd-trace-rb

✅ 0 Failed, 22577 Passed, 1482 Skipped, 5m 47.76s Total Time
❄️ 1 New Flaky

New Flaky Tests (1)

  • Rack integration tests for an application with remote configuration enabled not responding has boot tags - rspec - Last Failure

    Expand for error
     undefined method \`call' for nil:NilClass
     Did you mean?  caller
     
     Failure/Error: expect(span).to have_tag('_dd.rc.boot.time')
     
     NoMethodError:
       undefined method \`call' for nil:NilClass
       Did you mean?  caller
     ./spec/datadog/tracing/contrib/rack/integration_test_spec.rb:283:in \`block (6 levels) in <top (required)>'
     ./spec/datadog/tracing/contrib/support/tracer_helpers.rb:96:in \`block (2 levels) in <module:TracerHelpers>'
     ...
    

@p-datadog p-datadog merged commit 3e81a5a into master Jan 17, 2025
378 checks passed
@p-datadog p-datadog deleted the check-regexp-linear-time branch January 17, 2025 16:39
@github-actions github-actions bot added this to the 2.10.0 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants