-
Notifications
You must be signed in to change notification settings - Fork 369
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
Avoid shipping development cruft files in gem releases #1585
Avoid shipping development cruft files in gem releases #1585
Conversation
The `spec.files` setting controls which files get shipped when the gem gets packaged/installed. We still use the default setup of everything in git, other than spec/test/features folders. The problem is, that this means that we're shipping the `integration/`, `gemfiles/`, `.circleci/` and a bunch of extra development stuff. (Full list at: <https://gist.github.com/ivoanjo/0e3aa44ae9e3ca7a14194d8318f52b62>) I've pared this list down to include only things useful. After this change, we include the following files in a release (with current master): ``` .gitignore .yardopts CHANGELOG.md CONTRIBUTING.md LICENSE LICENSE-3rdparty.csv LICENSE.Apache LICENSE.BSD3 NOTICE README.md bin/ddtracerb ddtrace.gemspec docs/DevelopmentGuide.md docs/GettingStarted.md docs/ProfilingDevelopment.md lib/* ``` This means that gem releases will be smaller and have less irrelevant things.
Codecov Report
@@ Coverage Diff @@
## master #1585 +/- ##
==========================================
+ Coverage 98.22% 98.25% +0.03%
==========================================
Files 862 894 +32
Lines 41704 42879 +1175
==========================================
+ Hits 40962 42131 +1169
- Misses 742 748 +6
Continue to review full report at Codecov.
|
.reject { |f| f.match(%r{^(test|spec|features|[.]circleci|[.]github|[.]dd-ci|benchmarks|gemfiles|integration|tasks)/}) } | ||
.reject do |f| | ||
['.dockerignore', '.env', '.gitattributes', '.gitlab-ci.yml', '.rspec', '.rubocop.yml', | ||
'.rubocop_todo.yml', '.simplecov', 'Appraisals', 'Gemfile', 'Rakefile', 'docker-compose.yml'].include?(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this point, what do you think of listing the included files instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not the biggest fan of that, since I've seen quite a few broken releases on rubygems.org due to "it worked on my machine but we forgot to update the files list and so the packaged gem is missing stuff".
On the other hand, those projects usually specified all files by name, and I think you may be suggesting to just specify the ones on the the root, which is a smaller subset, but... I'd still go with the safer default of excluding what we don't want.
The
spec.files
setting controls which files get shipped when the gem gets packaged/installed.We still use the default setup of everything in git, other than spec/test/features folders. The problem is, that this means that
we're shipping the
integration/
,gemfiles/
,.circleci/
and a bunch of extra development stuff.(Full list at: https://gist.github.com/ivoanjo/0e3aa44ae9e3ca7a14194d8318f52b62)
I've pared this list down to include only things useful. After this change, we include the following files in a release (with current master):
This means that gem releases will be smaller and have less irrelevant things.