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

Upgrade rails autoloader version to 6.0 #2392

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions omnibus/config/software/supermarket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
env = with_standard_compiler_flags(with_embedded_path)

bundle "package --no-install", env: env

# This statement is to replace the --without flag which is getting deprecated
bundle "config set without 'development doc'"
bundle "install" \
" --jobs #{workers}" \
" --retry 3" \
" --path=vendor/bundle" \
" --without development doc",
" --path=vendor/bundle",
env: env


Expand Down
2 changes: 1 addition & 1 deletion src/supermarket/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem "sidekiq-cron"
gem "aws-sdk-s3"
gem "chef", "~> 17.7", require: false
gem "compass-rails"
gem "ddtrace", require: false
gem "ddtrace", "0.53.0", require: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pinned to 0.53 because 0.54 has some breaking change

gem "dotenv"
gem "ffi-libarchive"
gem "foreman"
Expand Down
45 changes: 23 additions & 22 deletions src/supermarket/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ GEM
and_feathers-gzipped_tarball (1.0.0.pre)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.525.0)
aws-sdk-core (3.122.0)
aws-partitions (1.533.0)
aws-sdk-core (3.122.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.51.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.105.1)
aws-sdk-s3 (1.106.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sdk-secretsmanager (1.51.0)
aws-sdk-core (~> 3, >= 3.121.2)
aws-sdk-secretsmanager (1.52.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
Expand Down Expand Up @@ -195,7 +195,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.9.0)
css_parser (1.10.0)
addressable
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
Expand All @@ -219,9 +219,9 @@ GEM
equalizer (0.0.11)
erubi (1.10.0)
erubis (2.7.0)
et-orbi (1.2.4)
et-orbi (1.2.6)
tzinfo
excon (0.87.0)
excon (0.88.0)
execjs (2.7.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -262,7 +262,7 @@ GEM
treetop (~> 1.4)
foreman (0.87.2)
formatador (0.3.0)
fugit (1.5.0)
fugit (1.5.2)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
fuzzyurl (0.9.0)
Expand Down Expand Up @@ -309,7 +309,7 @@ GEM
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
iniparse (1.5.0)
inspec-core (4.49.0)
inspec-core (4.50.3)
addressable (~> 2.4)
chef-telemetry (~> 1.0, >= 1.0.8)
faraday (>= 0.9.0, < 1.5)
Expand All @@ -333,7 +333,7 @@ GEM
tty-prompt (~> 0.17)
tty-table (~> 0.10)
ipaddress (0.8.3)
jbuilder (2.11.2)
jbuilder (2.11.3)
activesupport (>= 5.0.0)
jmespath (1.4.0)
json (2.6.1)
Expand Down Expand Up @@ -394,12 +394,12 @@ GEM
lumberjack (1.2.8)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704)
mime-types-data (3.2021.1115)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
Expand Down Expand Up @@ -575,13 +575,14 @@ GEM
redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2)
redis-store (1.6.0)
redis (>= 2.2, < 5)
redis-store (1.9.0)
redis (>= 4, < 5)
ref (2.0.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rinku (2.0.6)
rollout (2.4.3)
rollout (2.5.0)
redis (~> 4.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
Expand All @@ -605,7 +606,7 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.2)
rspec-support (3.10.3)
rubocop (1.23.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
Expand Down Expand Up @@ -670,9 +671,9 @@ GEM
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets-rails (3.4.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sslshake (1.3.1)
statsd-ruby (1.5.0)
Expand Down Expand Up @@ -803,7 +804,7 @@ DEPENDENCIES
coderay
compass-rails
database_cleaner
ddtrace
ddtrace (= 0.53.0)
dotenv
factory_bot_rails
faker
Expand Down
2 changes: 1 addition & 1 deletion src/supermarket/app/lib/supermarket/fips.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "openssl"

module Supermarket
class FIPS
class Fips
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new autoloader zeitwerk imposes some strict naming conventions. Hence this change.

# FIPS 140-2 Annex A references NIST Digital Signature Standard (DSS),
# FIPS Publication 186-4 to identify several algorithms as the
# Secure Hash Standard (SHS). Algorithms listed here are in the SHS
Expand Down
5 changes: 4 additions & 1 deletion src/supermarket/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
module Supermarket
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
config.load_defaults 6.0
# This flag needs to be set to false from rails 6
# onwards as we are currently not using cache versioning.
config.active_record.cache_versioning = false

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
2 changes: 1 addition & 1 deletion src/supermarket/config/initializers/fipsify.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ENV["OPENSSL_FIPS"] == "1"
Supermarket::FIPS.enable!
Supermarket::Fips.enable!
Rails.logger.info "FIPS 140-2 mode is enabled."
end
4 changes: 2 additions & 2 deletions src/supermarket/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
t.integer "user_id", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "ccla_signature_id", null: false
t.index ["organization_id", "user_id"], name: "index_contributor_requests_on_organization_id_and_user_id", unique: true
end

Expand Down Expand Up @@ -114,7 +115,7 @@
t.datetime "updated_at"
t.string "tarball_file_name"
t.string "tarball_content_type"
t.bigint "tarball_file_size"
t.integer "tarball_file_size"
t.datetime "tarball_updated_at"
t.text "readme", default: "", null: false
t.string "readme_extension", default: "", null: false
Expand Down Expand Up @@ -154,7 +155,6 @@
t.string "deprecation_reason"
t.index ["lowercase_name"], name: "index_cookbooks_on_lowercase_name", unique: true
t.index ["name"], name: "index_cookbooks_on_name"
t.index ["replacement_id"], name: "index_cookbooks_on_replacement_id"
t.index ["user_id"], name: "index_cookbooks_on_user_id"
end

Expand Down
2 changes: 1 addition & 1 deletion src/supermarket/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
cookbook_version = cookbook.cookbook_versions.where(
version: "0.#{version_number}.0"
).first_or_initialize(
description: Faker::Lorem.sentences(1).first,
description: Faker::Lorem.sentences(number: 1).first,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new syntax for faker

license: 'MIT',
tarball: File.open('spec/support/cookbook_fixtures/redis-test-v1.tgz'),
readme: '# This is a README',
Expand Down