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

Reduce gem size #633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ybiquitous
Copy link

@ybiquitous ybiquitous commented Nov 28, 2024

Changes

This reduces the Auth0 gem size by changing files in the gemspec.
Currently, the gem contains many unnecessary files for execution, such as tests or examples.

Besides, since test_files in the gemspec is unsupported, we can remove it.
See https://guides.rubygems.org/specification-reference/

To verify this change locally, run the command for each branch and compare each output:

gem build

Here's a size diff in my local environment:

$ du -h auth0-*.gem*
 40K	auth0-5.17.0.gem
216K	auth0-5.17.0.gem.current

In addition, we can compare included files in the gem as well:

bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables'

For example:

git switch master
bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables' > before
git switch reduce-gem-size
bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables' > after
diff -u before after
Diff output

--- before	2024-11-28 23:12:35
+++ after	2024-11-28 23:12:36
@@ -1,122 +1,5 @@
-Resolving dependencies...
-.bundle/config
-.devcontainer/Dockerfile
-.devcontainer/devcontainer.json
-.env.example
-.github/CODEOWNERS
-.github/ISSUE_TEMPLATE/Bug Report.yml
-.github/ISSUE_TEMPLATE/Feature Request.yml
-.github/ISSUE_TEMPLATE/config.yml
-.github/PULL_REQUEST_TEMPLATE.md
-.github/actions/get-prerelease/action.yml
-.github/actions/get-release-notes/action.yml
-.github/actions/get-version/action.yml
-.github/actions/release-create/action.yml
-.github/actions/rl-scanner/action.yml
-.github/actions/rubygems-publish/action.yml
-.github/actions/setup/action.yml
-.github/actions/tag-exists/action.yml
-.github/dependabot.yml
-.github/stale.yml
-.github/workflows/codeql.yml
-.github/workflows/matrix.json
-.github/workflows/release.yml
-.github/workflows/rl-scanner.yml
-.github/workflows/ruby-release.yml
-.github/workflows/semgrep.yml
-.github/workflows/snyk.yml
-.github/workflows/test.yml
-.gitignore
-.rspec
-.rubocop.yml
-.rubocop_todo.yml
-.semgrepignore
-.shiprc
-.snyk
-.version
-CHANGELOG.md
-CODE_OF_CONDUCT.md
-DEPLOYMENT.md
-DEVELOPMENT.md
-Dockerfile
-EXAMPLES.md
-Gemfile
-Gemfile.lock
-Guardfile
 LICENSE
 README.md
-RUBYGEM.md
-Rakefile
-auth0.gemspec
-codecov.yml
-examples/ruby-api/.env.example
-examples/ruby-api/.gitignore
-examples/ruby-api/Gemfile
-examples/ruby-api/Gemfile.lock
-examples/ruby-api/README.md
-examples/ruby-api/config.ru
-examples/ruby-api/main.rb
-examples/ruby-on-rails-api/.env.example
-examples/ruby-on-rails-api/.gitignore
-examples/ruby-on-rails-api/Gemfile
-examples/ruby-on-rails-api/README.md
-examples/ruby-on-rails-api/Rakefile
-examples/ruby-on-rails-api/app/assets/images/.keep
-examples/ruby-on-rails-api/app/assets/javascripts/application.js
-examples/ruby-on-rails-api/app/assets/stylesheets/application.css
-examples/ruby-on-rails-api/app/controllers/application_controller.rb
-examples/ruby-on-rails-api/app/controllers/concerns/.keep
-examples/ruby-on-rails-api/app/controllers/ping_controller.rb
-examples/ruby-on-rails-api/app/controllers/secured_ping_controller.rb
-examples/ruby-on-rails-api/app/helpers/application_helper.rb
-examples/ruby-on-rails-api/app/mailers/.keep
-examples/ruby-on-rails-api/app/models/.keep
-examples/ruby-on-rails-api/app/models/User.rb
-examples/ruby-on-rails-api/app/models/concerns/.keep
-examples/ruby-on-rails-api/app/views/layouts/application.html.erb
-examples/ruby-on-rails-api/bin/bundle
-examples/ruby-on-rails-api/bin/rails
-examples/ruby-on-rails-api/bin/rake
-examples/ruby-on-rails-api/bin/setup
-examples/ruby-on-rails-api/config.ru
-examples/ruby-on-rails-api/config/application.rb
-examples/ruby-on-rails-api/config/boot.rb
-examples/ruby-on-rails-api/config/database.yml
-examples/ruby-on-rails-api/config/environment.rb
-examples/ruby-on-rails-api/config/environments/development.rb
-examples/ruby-on-rails-api/config/environments/production.rb
-examples/ruby-on-rails-api/config/environments/test.rb
-examples/ruby-on-rails-api/config/initializers/backtrace_silencers.rb
-examples/ruby-on-rails-api/config/initializers/cookies_serializer.rb
-examples/ruby-on-rails-api/config/initializers/dotenv.rb
-examples/ruby-on-rails-api/config/initializers/filter_parameter_logging.rb
-examples/ruby-on-rails-api/config/initializers/inflections.rb
-examples/ruby-on-rails-api/config/initializers/knock.rb
-examples/ruby-on-rails-api/config/initializers/mime_types.rb
-examples/ruby-on-rails-api/config/initializers/session_store.rb
-examples/ruby-on-rails-api/config/initializers/wrap_parameters.rb
-examples/ruby-on-rails-api/config/locales/en.yml
-examples/ruby-on-rails-api/config/routes.rb
-examples/ruby-on-rails-api/config/secrets.yml
-examples/ruby-on-rails-api/db/schema.rb
-examples/ruby-on-rails-api/db/seeds.rb
-examples/ruby-on-rails-api/lib/assets/.keep
-examples/ruby-on-rails-api/lib/tasks/.keep
-examples/ruby-on-rails-api/log/.keep
-examples/ruby-on-rails-api/public/404.html
-examples/ruby-on-rails-api/public/422.html
-examples/ruby-on-rails-api/public/500.html
-examples/ruby-on-rails-api/public/favicon.ico
-examples/ruby-on-rails-api/public/robots.txt
-examples/ruby-on-rails-api/test/controllers/.keep
-examples/ruby-on-rails-api/test/fixtures/.keep
-examples/ruby-on-rails-api/test/helpers/.keep
-examples/ruby-on-rails-api/test/integration/.keep
-examples/ruby-on-rails-api/test/mailers/.keep
-examples/ruby-on-rails-api/test/models/.keep
-examples/ruby-on-rails-api/test/ping_controller_test.rb
-examples/ruby-on-rails-api/test/secured_ping_controller_test.rb
-examples/ruby-on-rails-api/test/test_helper.rb
 lib/auth0.rb
 lib/auth0/algorithm.rb
 lib/auth0/api/authentication_endpoints.rb
@@ -163,224 +46,3 @@
 lib/auth0/mixins/validation.rb
 lib/auth0/version.rb
 lib/auth0_client.rb
-opslevel.yml
-publish_rubygem.sh
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_change_password/should_trigger_a_password_reset.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_incorrect_email.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_incorrect_password.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_invalid_audience.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_login_successfully_with_a_custom_audience.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_login_successfully_with_a_default_scope.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_saml_metadata/should_retrieve_SAML_metadata.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_userinfo/should_fail_as_not_authorized.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_userinfo/should_return_the_userinfo.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_wsfed_metadata/should_retrieve_WSFED_metadata.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/delete_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Blacklists/_add_token_to_blacklist/should_add_a_token_to_the_blacklist.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Blacklists/_blacklisted_tokens/should_get_the_added_token_from_the_blacklist.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_client_grants/should_return_at_least_1_result.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_client_grants/should_return_the_test_client_grant.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_delete_client_grant/should_delete_the_test_client_grant.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_patch_client_grant/should_update_the_test_client_grant.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/create_test_client.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/create_test_client_grant.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/delete_test_client.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/delete_test_client_grant.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/_filters/should_exclude_and_include_fields_properly.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/_filters/should_include_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/should_get_the_test_client.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_exclude_fields_not_specified.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_exclude_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_include_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_paginate_results.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/should_get_at_least_one_client.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_delete_client/should_delete_the_test_client_without_an_error.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_patch_client/should_update_the_client_with_the_correct_attributes.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/create_test_client.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/_filters/should_exclude_the_fields_indicated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/_filters/should_include_the_fields_indicated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/should_find_the_correct_connection.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_include_previously-created_connection_when_filtered.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_should_exclude_the_fields_indicated_from_filtered_results.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_should_include_the_fields_indicated_from_filtered_results.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/should_include_the_previously_created_connection.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/should_not_be_empty.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_delete_connection/should_delete_the_connection.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_delete_connection_user/should_delete_the_user_created.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_update_connection/should_update_the_connection.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/create_test_connection.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/create_test_credential.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/delete_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_configure_provider/should_configure_a_new_email_provider.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_delete_provider/should_delete_the_existing_email_provider_without_an_error.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_delete_provider/should_throw_an_error_trying_to_get_the_email_provider.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/_filters/should_get_the_existing_email_provider_with_specific_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/_filters/should_get_the_existing_email_provider_without_specific_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/should_get_the_existing_email_provider.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_update_provider/should_update_the_existing_email_provider.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/delete_existing_provider.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_create_an_export_users_job_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_get_the_export_users_job.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_create_an_import_users_job_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_get_the_import_users_job.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_create_a_new_verification_email_job.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_get_the_completed_verification_email.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_reject_an_invalid_client_id.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/delete_imported_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/search_for_connection_id.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_match_the_created_log_entry.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_not_be_empty.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_fields_not_specified.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_have_one_log_entry.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_include_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_from/should_take_one_log_entry.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_disabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_enabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_delete_resource_server/should_delete_the_test_server_without_an_error.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_patch_resource_server/should_update_the_resource_server_with_the_correct_attributes.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_server/should_get_the_test_server.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_get_the_test_server.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_at_least_1_result.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_the_first_page_of_one_result.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/create_test_server.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/delete_test_server.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_permissions/should_add_a_Permission_to_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_users/should_add_a_User_to_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_delete_role/should_delete_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role/should_get_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_exactly_1_Permission.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_the_added_Permission_from_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_exactly_1_User.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_the_added_User_from_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_roles/should_get_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_remove_role_permissions/should_remove_a_Permission_from_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_update_role/should_update_the_Role_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_api.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_role.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_api.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_disabled_rule_without_an_error.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_enabled_rule_without_an_error.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_exclude_the_fields_not_specified.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_exclude_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_include_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/should_get_a_specific_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_exclude_fields_not_specified.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_include_the_specified_fields.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_at_least_1_disabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_at_least_1_enabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_paginated_results.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/should_return_at_least_1_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_update_rule/should_update_the_disabled_rule_to_be_enabled.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/create_test_disabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/create_test_enabled_rule.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Stats/_active_users/should_have_at_least_one_active_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Stats/_daily_stats/should_have_at_least_one_stats_entry_for_the_timeframe.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings/should_get_the_tenant_settings.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings_with_specific_fields/should_exclude_a_field_not_requested.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings_with_specific_fields/should_include_the_field_requested.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_update_tenant_settings/should_revert_the_tenant_name.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_update_tenant_settings/should_update_the_tenant_settings_with_a_new_tenant_name.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/_post_email_verification/should_create_an_email_verification_ticket.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/_post_password_change/should_create_a_password_change_ticket.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/delete_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_add_user_permissions/should_add_a_Permissions_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_add_user_roles/should_add_a_Role_to_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user/should_delete_the_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user/should_delete_the_secondary_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user_provider/should_attempt_to_delete_the_MFA_provider_for_the_User.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_enrollments/should_get_Enrollments_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_permissions/should_get_exactly_1_Permission_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_permissions/should_get_the_correct_Permission_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_roles/should_get_Roles_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_invalidate_browsers/should_invalidate_MFA_browsers_for_the_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_link_user_account/should_link_two_Users_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_patch_user/should_patch_the_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_remove_user_permissions/should_remove_a_Permission_from_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_remove_user_roles/should_remove_a_Role_from_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_unlink_user_account/should_unlink_two_Users_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_exclude_fields_not_indicated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_exclude_the_fields_indicated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_include_the_fields_indicated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/should_retrieve_the_created_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user_logs/should_get_Logs_for_a_User_successfully.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/is_expected_to_find_a_user_with_a_v2_search_engine_query.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/is_expected_to_find_a_user_with_a_v3_search_engine_query.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_exclude_the_indicated_fields_when_paginated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_include_the_indicated_fields_when_paginated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_not_include_other_fields_when_paginated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_return_the_correct_number_of_results_when_paginated.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/should_have_at_least_one_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_secondary_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_api.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_role.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_user.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/delete_test_api.yml
-spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/delete_test_role.yml
-spec/integration/lib/auth0/api/api_authentication_spec.rb
-spec/integration/lib/auth0/api/v2/api_blacklist_spec.rb
-spec/integration/lib/auth0/api/v2/api_client_grants_spec.rb
-spec/integration/lib/auth0/api/v2/api_clients_spec.rb
-spec/integration/lib/auth0/api/v2/api_connections_spec.rb
-spec/integration/lib/auth0/api/v2/api_email_spec.rb
-spec/integration/lib/auth0/api/v2/api_jobs_spec.rb
-spec/integration/lib/auth0/api/v2/api_logs_spec.rb
-spec/integration/lib/auth0/api/v2/api_resource_servers_spec.rb
-spec/integration/lib/auth0/api/v2/api_roles_spec.rb
-spec/integration/lib/auth0/api/v2/api_rules_spec.rb
-spec/integration/lib/auth0/api/v2/api_stats_spec.rb
-spec/integration/lib/auth0/api/v2/api_tenants_spec.rb
-spec/integration/lib/auth0/api/v2/api_tickets_spec.rb
-spec/integration/lib/auth0/api/v2/api_user_blocks_spec.rb
-spec/integration/lib/auth0/api/v2/api_users_spec.rb
-spec/integration/lib/auth0/auth0_client_spec.rb
-spec/lib/auth0/api/authentication_endpoints_spec.rb
-spec/lib/auth0/api/v2/actions_spec.rb
-spec/lib/auth0/api/v2/anomaly_spec.rb
-spec/lib/auth0/api/v2/attack_protection_spec.rb
-spec/lib/auth0/api/v2/blacklists_spec.rb
-spec/lib/auth0/api/v2/branding_spec.rb
-spec/lib/auth0/api/v2/client_grants_spec.rb
-spec/lib/auth0/api/v2/clients_spec.rb
-spec/lib/auth0/api/v2/connections_spec.rb
-spec/lib/auth0/api/v2/device_credentials_spec.rb
-spec/lib/auth0/api/v2/emails_spec.rb
-spec/lib/auth0/api/v2/grants_spec.rb
-spec/lib/auth0/api/v2/guardian_spec.rb
-spec/lib/auth0/api/v2/jobs_spec.rb
-spec/lib/auth0/api/v2/log_streams_spec.rb
-spec/lib/auth0/api/v2/logs_spec.rb
-spec/lib/auth0/api/v2/organizations_spec.rb
-spec/lib/auth0/api/v2/prompts_spec.rb
-spec/lib/auth0/api/v2/refresh_tokens_spec.rb
-spec/lib/auth0/api/v2/resource_servers_spec.rb
-spec/lib/auth0/api/v2/roles_spec.rb
-spec/lib/auth0/api/v2/rules_spec.rb
-spec/lib/auth0/api/v2/sessions_spec.rb
-spec/lib/auth0/api/v2/stats_spec.rb
-spec/lib/auth0/api/v2/tenants_spec.rb
-spec/lib/auth0/api/v2/tickets_spec.rb
-spec/lib/auth0/api/v2/user_blocks_spec.rb
-spec/lib/auth0/api/v2/users_by_email_spec.rb
-spec/lib/auth0/api/v2/users_spec.rb
-spec/lib/auth0/client_spec.rb
-spec/lib/auth0/mixins/httpproxy_spec.rb
-spec/lib/auth0/mixins/initializer_spec.rb
-spec/lib/auth0/mixins/token_management_spec.rb
-spec/lib/auth0/mixins/validation_spec.rb
-spec/spec_helper.rb
-spec/support/credentials.rb
-spec/support/dummy_class.rb
-spec/support/dummy_class_for_proxy.rb
-spec/support/dummy_class_for_restclient.rb
-spec/support/dummy_class_for_tokens.rb
-spec/support/import_users.json
-spec/support/stub_response.rb

References

Testing

This change should be tested on each developer's local environment, instead of unit/integration tests, as I explained above.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of Ruby

Checklist

This reduces the Auth0 gem size by changing `files` in the gemspec.
Currently, the gem contains many unnecessary files for execution, such as tests or examples.

Besides, since `test_files` in the gemspec is unsupported, we can remove it.
See https://guides.rubygems.org/specification-reference/

To verify this change locally, run the command for each branch and compare each output:

```sh
gem build
```

Here's a size diff in my local environment:

```sh-session
$ du -h auth0-*.gem*
 40K	auth0-5.17.0.gem
216K	auth0-5.17.0.gem.current
```

In addition, we can compare included files in the gem as well:

```shell
bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables'
```

For example:

```shell
git switch master
bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables' > before
git switch reduce-gem-size
bundle exec ruby -e 's = Gem.loaded_specs["auth0"]; puts s.files + s.executables' > after
diff -u before after
```
@ybiquitous ybiquitous requested a review from a team as a code owner November 28, 2024 14:05
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.files = `git ls-files -z -- LICENSE README.md lib`.split("\x0")
Copy link
Author

Choose a reason for hiding this comment

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

LICENSE README.md lib is a discussion point. Please let me know if you want to change.

Copy link
Author

Choose a reason for hiding this comment

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

For example, including EXAMPLES.md may make sense:

Suggested change
s.files = `git ls-files -z -- LICENSE README.md lib`.split("\x0")
s.files = `git ls-files -z -- EXAMPLES.md LICENSE README.md lib`.split("\x0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant