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

Deny rubygems-update injection #4108

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

lloeki
Copy link
Contributor

@lloeki lloeki commented Nov 13, 2024

What does this PR do?

Coverage is twofold:

  • Deny on --disable-gems: gems are required for ruby injector
  • Deny on setup.rb: This may be wide-catching but we don't want to instrument any of them anyway.

Motivation:

rubygems-update setup.rb re-execs itself when RUBYOPT is detected, which causes endless looping because injection adds it back immediately.

See: https://github.com/rubygems/rubygems/blob/90c90addee4bda3130cf44f1321eebf162367d1b/setup.rb#L13-L20

Change log entry

Additional Notes:

JIRA

How to test the change?

@lloeki lloeki requested a review from a team as a code owner November 13, 2024 11:32
@github-actions github-actions bot added the single-step Single Step APM Instrumentation label Nov 13, 2024
@lloeki lloeki force-pushed the lloeki/deny-rubygems-update-injection branch from 61a0bc7 to bacd3fe Compare November 13, 2024 11:36
`rubygems-update` `setup.rb` re-execs itself when `RUBYOPT` is detected,
which causes endless looping because injection adds it back immediately.

See: https://github.com/rubygems/rubygems/blob/90c90addee4bda3130cf44f1321eebf162367d1b/setup.rb#L13-L20

Coverage is twofold:

- Deny on `--disable-gems`: gems are required for ruby injector
- Deny on `setup.rb`: This may be wide-catching but we don't want to
  instrument any of them anyway.
@lloeki lloeki force-pushed the lloeki/deny-rubygems-update-injection branch from bacd3fe to 20f2fa5 Compare November 13, 2024 11:38
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

:shipit:

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.77%. Comparing base (48e5f09) to head (20f2fa5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4108      +/-   ##
==========================================
- Coverage   97.77%   97.77%   -0.01%     
==========================================
  Files        1350     1350              
  Lines       81062    81062              
  Branches     4085     4085              
==========================================
- Hits        79259    79256       -3     
- Misses       1803     1806       +3     

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

@pr-commenter
Copy link

pr-commenter bot commented Nov 13, 2024

Benchmarks

Benchmark execution time: 2024-11-13 12:52:22

Comparing candidate commit 20f2fa5 in PR branch lloeki/deny-rubygems-update-injection with baseline commit 48e5f09 in branch master.

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

scenario:method instrumentation

  • 🟩 throughput [+23247.595op/s; +24366.105op/s] or [+11.581%; +12.138%]

@TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu added this to the 2.7.0 milestone Nov 13, 2024
@TonyCTHsu TonyCTHsu merged commit 494abac into master Nov 13, 2024
262 of 263 checks passed
@TonyCTHsu TonyCTHsu deleted the lloeki/deny-rubygems-update-injection branch November 13, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
single-step Single Step APM Instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants