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

Split gemfiles for each runtime #4112

Merged
merged 6 commits into from
Nov 14, 2024
Merged

Split gemfiles for each runtime #4112

merged 6 commits into from
Nov 14, 2024

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Nov 13, 2024

Motivation:

The default behaviour for appraisal does not fit well with our requirements.

Our pain using appraisal

  • Difficult to extend/customize appraisal behaviour in Appraisals file, because the self object is Appraisal::AppraisalFile already been evaluated.
  • The DSL does not support eval_gemfile (which is important to split gemfiles for each ruby version)
  • We are writing a lot of conditionals Gemfile at root, and creating gemfile symlink of each ruby version to avoid lockfile conflict.
  • Each appraisal group become bloated and contain unnecessary dependencies
  • bundle exec appraisal install returns false positive result about local gems satisfied the lockfile ends up missing dependencies.

What does this PR do?

  • Copy the Gemfile at root to its own gemfile for each ruby runtime and eval_gemfile dynamically
  • Create appraisal/generate.rb (wrapped with bundle exec rake dependency:generate to replace bundle exec appraisal generate) contains our customize logic and is equivalent with Appraisals.

We are still using appraisal in terms of gemfile formatting (bundle exec rake dependency:generate and bundle exec appraisal generate are creating the EXACT same content), hence the appraisal gem cannot be removed yet

The changes from this PR makes us easier to customize the behaviour for gemfiles, and opens up the possibility to trim down the bloated groups for scaling.

appraisal/generate.rb Show resolved Hide resolved
appraisal/generate.rb Show resolved Hide resolved
@TonyCTHsu TonyCTHsu changed the title Tonycthsu/split gemfiles Split gemfiles for each runtime Nov 13, 2024
@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/split-gemfiles branch from e4ce6d9 to 48aa93a Compare November 13, 2024 23:14
@pr-commenter
Copy link

pr-commenter bot commented Nov 13, 2024

Benchmarks

Benchmark execution time: 2024-11-14 03:51:19

Comparing candidate commit 4d537f3 in PR branch tonycthsu/split-gemfiles with baseline commit 2b8486e in branch master.

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

scenario:tracing - Propagation - Datadog

  • 🟥 throughput [-2857.293op/s; -2758.985op/s] or [-8.595%; -8.299%]

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.78%. Comparing base (7b5fef3) to head (4d537f3).
Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4112      +/-   ##
==========================================
- Coverage   97.78%   97.78%   -0.01%     
==========================================
  Files        1350     1350              
  Lines       81063    81079      +16     
  Branches     4085     4085              
==========================================
+ Hits        79270    79282      +12     
- Misses       1793     1797       +4     

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

@TonyCTHsu TonyCTHsu marked this pull request as ready for review November 14, 2024 00:34
@TonyCTHsu TonyCTHsu requested a review from a team as a code owner November 14, 2024 00:34
@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/split-gemfiles branch 3 times, most recently from 47ee77e to c771a9b Compare November 14, 2024 03:01
@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/split-gemfiles branch from c771a9b to 4d537f3 Compare November 14, 2024 03:11
@TonyCTHsu TonyCTHsu added the dev/tooling Involves tools (e.g. Rubocop, CodeCov) label Nov 14, 2024
Copy link
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@TonyCTHsu TonyCTHsu merged commit 97a222c into master Nov 14, 2024
272 of 273 checks passed
@TonyCTHsu TonyCTHsu deleted the tonycthsu/split-gemfiles branch November 14, 2024 12:16
@github-actions github-actions bot added this to the 2.8.0 milestone Nov 14, 2024
@p-datadog p-datadog added the dev/internal Other internal work that does not need to be included in the changelog label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/internal Other internal work that does not need to be included in the changelog dev/tooling Involves tools (e.g. Rubocop, CodeCov)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants