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

Fix docker-dev-shell ruby/php build #2324

Merged
merged 4 commits into from Jul 17, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 37 additions & 7 deletions .rubocop.yml
Expand Up @@ -12,7 +12,7 @@ Layout/DotPosition:
EnforcedStyle: trailing

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
Enabled: false

Layout/LineLength:
Max: 80
Expand All @@ -21,7 +21,7 @@ Layout/RescueEnsureAlignment:
Enabled: false

Layout/SpaceAroundMethodCallOperator:
Enabled: false
Enabled: false

Lint/DeprecatedOpenSSLConstant:
Enabled: false
Expand All @@ -42,7 +42,7 @@ Metrics/ModuleLength:
Max: 350

Metrics/CyclomaticComplexity:
Max: 10
Max: 15
jurre marked this conversation as resolved.
Show resolved Hide resolved

Metrics/AbcSize:
Max: 35
Expand Down Expand Up @@ -73,14 +73,14 @@ Style/Documentation:
Enabled: false

Style/HashEachMethods:
Enabled: false
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false

Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': ()
Expand All @@ -98,4 +98,34 @@ Style/RedundantRegexpEscape:
Enabled: false

Style/SlicingWithRange:
Enabled: false
Enabled: false

Style/RedundantFetchBlock:
Enabled: false

Lint/DuplicateElsifCondition:
Enabled: false

Style/AccessorGrouping:
Enabled: false

Style/ArrayCoercion:
Enabled: false

Style/BisectedAttrAccessor:
Enabled: false

Style/CaseLikeIf:
Enabled: false

Style/HashAsLastArrayItem:
Enabled: false

Style/HashLikeCase:
Enabled: false

Style/RedundantAssignment:
Enabled: false

Style/RedundantFileExtensionInRequire:
Enabled: false
10 changes: 4 additions & 6 deletions Dockerfile
Expand Up @@ -51,10 +51,10 @@ RUN apt-get update \

### RUBY

# Install Ruby 2.6.5, update RubyGems, and install Bundler
# Install Ruby 2.6.6, update RubyGems, and install Bundler
ENV BUNDLE_SILENCE_ROOT_WARNING=1
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6 \
&& echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu bionic main" > /etc/apt/sources.list.d/brightbox.list \
RUN apt-get install -y software-properties-common \
&& apt-add-repository ppa:brightbox/ruby-ng \
&& apt-get update \
&& apt-get install -y ruby2.6 ruby2.6-dev \
&& gem update --system 3.0.3 \
Expand Down Expand Up @@ -98,9 +98,7 @@ RUN npm install elm@0.18.0 \

# Install PHP 7.4 and Composer
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" >> /etc/apt/sources.list.d/ondrej-php.list \
&& echo "deb-src http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" >> /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
RUN add-apt-repository ppa:ondrej/php \
&& apt-get update \
&& apt-get install -y php7.4 php7.4-cli php7.4-xml php7.4-json php7.4-zip php7.4-mbstring php7.4-intl php7.4-common php7.4-gettext php7.4-curl php7.4-bcmath php7.4-gmp php7.4-imagick php7.4-gd php7.4-redis php7.4-soap php7.4-ldap php7.4-memcached php7.4-sqlite3 php7.4-apcu php7.4-tidy php7.4-mongodb php7.4-zmq php7.4-mysql php7.4-imap php7.4-geoip \
&& curl -sS https://getcomposer.org/installer | php \
Copy link
Contributor Author

@feelepxyz feelepxyz Jul 17, 2020

Choose a reason for hiding this comment

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

Looks like this is a better way https://getcomposer.org/download/

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think I'll fix this in a new PR to not block red builds on master

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -41,7 +41,7 @@ namespace :ci do
packages = changed_packages
puts "Running rubocop on: #{packages.join(', ')}"
packages.each do |package|
run_command("cd #{package} && bundle exec rubocop")
run_command("cd #{package} && bundle exec rubocop -c ../.rubocop.yml")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this change broke the previous behaviour of checking for config files in the parent directory rubocop/rubocop#8239

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although not sure this is true after looking at the code a bit closer

end
end

Expand Down
Expand Up @@ -71,7 +71,6 @@ def dependency_files
).prepared_dependency_files
end

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def fetch_latest_resolvable_version_details
return latest_version_details unless gemfile
Expand Down Expand Up @@ -117,7 +116,6 @@ def fetch_latest_resolvable_version_details
@gemspec_ruby_unlocked = true
regenerate_dependency_files_without_ruby_lock && retry
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def circular_dependency_at_new_version?(error)
Expand Down
20 changes: 20 additions & 0 deletions bundler/spec/fixtures/ruby/rubygems_responses/info-racc
@@ -0,0 +1,20 @@
---
1.4.6 |checksum:5877e6d676b0512e9d8587b273acf71aa7e6bd7c77b5e3f4bc26d9b5ccd08378
1.4.7 |checksum:0468f784a7f98bc2498d0e14596fc694182d957f9f1831309c6e94d075055f6f
1.4.8 |checksum:934d178848b6c55fae8db6108e6e8af0954af8cb374ff9526d098abebf247b7b
1.4.9 |checksum:f9d53caeb1ff5ac633a270a45478e585e6e054c44f6da28415f3432caf8f61d5
1.4.9-java |checksum:1d73cde6030f59851e7725a8b15d479e9b14effcf2da9528a52eb05c3dea3e67
1.4.10 |checksum:6282f61f123f4e1d39bac5ad19027e34c336a5e1d80f9e4769c80b16db11b583
1.4.11 |checksum:1e2e420d5e2e4b9f2b352e9b2828448a2ee13a16fdebf6a7e863252b5054c840
1.4.12 |checksum:bd9a6b06cf502abfdd7823c833ba69b74d038e8d365a5ce42d502f528f531db0
1.4.12-java |checksum:15bdbdb41a5f56daf371f307a13048bedefc041451869fe8ad276eae4a49e57a
1.4.13 |checksum:1da7f490ab9df37109d44f7d626d63354bb4188d02ebf94a7181c652914ffd75
1.4.13-java |checksum:74cbdf76d1a41d19169dfa76ee0eee89f589c2b791c9e6170c05d2ef655cf9b8
1.4.14 |checksum:f4876d08e9bfb560ec281301347a3550ef9526b46b6e5c07dac5fbf394d0d003
1.4.14-java |checksum:39a194da71a9facdf514a870b158bcb78d294a648393d4769813d06a5273a82b
1.4.15 |checksum:8c6af824af1586d0d1d94d481ab6cd53ee3a7a5f8be491ed1e6718884bbdc222
1.4.15-java |checksum:78ff8ab20d64b413df5c547a4661b5be0fa5b392a5b9b57d4a81da77a3cff1b2
1.4.16 |checksum:60e0533d33dd087cde78b613856321ec9c80c17962eaf4bfe62d22a6ca4c8bfa
1.4.16-java |checksum:e422c7726197f2c210dc55414c1c80cba1725c7cc1e132273de04a8404c7e785
1.5.0 |checksum:bfe88b03e2357c2b656a1ade635511264bee6e36b3c91194909a3b5560ce6df9
1.5.0-java |checksum:2ef8ab4514e28266f1fe20620d97435e2b006d49de4f68fc1bcf7f185855daa0
@@ -0,0 +1,41 @@
---
0.3.0 rake:< 0.9&>= 0.8.3|checksum:2c4b6b779d2a7b92b0391aa854557abfdc32ea521bb4a376a7f7f946ea794f37
0.3.1 rake:< 0.9&>= 0.8.3|checksum:8d7f052fc7d55575b2cb1d24e675cdb375221b22ea0adbcfe8b9fc113fe62fb8
0.4.0 rake:< 0.9&>= 0.8.3|checksum:22ca20d8decb2cdc297c8b47234c97c62df9b923f8fe1f65b8b7201726915a6d
0.4.1 rake:< 0.9&>= 0.8.3|checksum:ae1bbd4f5db3d938a7d7e3b8d401e0bbc0b98db29137824c2de676fd9290e8b6
0.5.0 rake:< 0.9&>= 0.8.3|checksum:5b8a7a922097246641077d14c02dfb90fa604b545530136e604bfcb4fd83860e
0.6.0 rake:< 0.9&>= 0.8.3|checksum:258da1604bfd20ce851a8d3f1900da2ec63cb72434170a4ab0d25774dae8a118
0.7.0 rake:< 0.9&>= 0.8.3|checksum:487707bf8b253076a4a052ffd3a46253e042cd48211d4acd3cdb56b631ab2ce8,rubygems:>= 1.3.5
0.7.1 rake:< 0.9&>= 0.8.3|checksum:350d22548c751a0435635260d1447be8a4d1305c39a6e85ddc13e12b21f00051,rubygems:>= 1.3.5
0.7.5 rake:>= 0|checksum:c12738cf31bfba7dac72db8e46a14f6b84d23805222a21d5eefc326436ce0537,rubygems:>= 1.3.5
0.7.6 rake:>= 0|checksum:438e3c8ad74b41571a8e729256dba472a693be22f547b066bab101b61a60e459,rubygems:>= 1.3.5
0.7.7 rake:>= 0|checksum:0adc7d7e19f6d8db9aeb5c394d07b9e9859443dc81c456310e7caa26ab0a7a60,rubygems:>= 1.3.5
0.7.8 rake:>= 0|checksum:7d62098fd8f99b1d03d75cf48361edb8e933b8fad6d7e865a837d3401de4e5c5,rubygems:>= 1.3.5
0.7.9 rake:>= 0|checksum:88484a021683885ea652a79429a0bc870e20586bdd006a38dc8cd82ec724a6ac,rubygems:>= 1.3.5
0.8.0 rake:>= 0|checksum:43d5b390baebc1a232518056176bbf9ed5ab8c354a31d1db9d2a342325733caa,rubygems:>= 1.3.5
0.8.1 rake:>= 0|checksum:8271291a7cb47008b605a1e8071026eac306c9d6f8e8b65864735bfce095be47,rubygems:>= 1.3.5
0.8.2 rake:>= 0|checksum:12e8c555f3393ea8464afc45e32bc57c731f339f13d3c4d79c2822571fdb4537,rubygems:>= 1.3.5
0.8.3 rake:>= 0|checksum:37cfbbff2fa330ac2eee2947a505ae537df4394a64001588493904d419c98e1f,rubygems:>= 1.3.5
0.9.0.pre.1 rake:>= 0|checksum:8d32b4b9afb9a48a1ed63e8b772273d53b2539f457baff385d271550c7b1ac4c,rubygems:>= 1.8.25
0.9.0 rake:>= 0|checksum:397b716aceb86cf2216ff90491f9ca3a6481b38dc293cbd59b3e2ffa4df757f4,rubygems:>= 1.8.25
0.9.1 rake:>= 0|checksum:6c205f328ab86a257a4f173c3c9d90d0caadb161b24e1fc6dcf1b02f917b6bdc,rubygems:>= 1.8.25
0.9.2 rake:>= 0|checksum:964519cca332b323c8b85acefaa387b445bca71cd2d36c3240ec2bf96dfef420,rubygems:>= 1.8.25
0.9.3 rake:>= 0|checksum:d14e255e4e572267ef87894ca29347a18fe01bf27509851de01d696ff51407d5,ruby:>= 1.8.7,rubygems:>= 1.8.25
0.9.4 rake:>= 0|checksum:19be502332138dbd543c6068fe6564e57a42d368b561484b5d5d9516552dd72a,ruby:>= 1.8.7,rubygems:>= 1.8.23
0.9.5 rake:>= 0|checksum:9d1133b585b691059954158d5339be8af338af768a9b295feb8920f9b7a811cd,ruby:>= 1.8.7,rubygems:>= 1.8.23
0.9.6 rake:>= 0|checksum:caeb1a4bbb840dd888e6a26c2fd119e09b67c342d42276ae4994da7ac9d84d28,ruby:>= 1.8.7,rubygems:>= 1.8.23
0.9.7 rake:>= 0|checksum:d850ec26a355f8fda4df41cbe266d67e81aa46ce6e3aea3c338ddd37f616a780,ruby:>= 1.8.7,rubygems:>= 1.8.23
0.9.8 rake:>= 0|checksum:263a82c63fd037951e00c344a448c9a74321b16d9e7f8b8c4f1cff3fc9701ee5,ruby:>= 1.8.7,rubygems:>= 1.8.23
0.9.9 rake:>= 0|checksum:4a278fecf74d8f2f12c620b182729e3573fe956a2e118bb9e22191e2e33626c8,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.0 rake:>= 0|checksum:fc4800c1c22f23bb59db25e413c08162f15eda18ef2bd6f2ad7272f7d902e785,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.1 rake:>= 0|checksum:40c4ca1d7a8bb3a2ed2f234bba51817ccaea3c37e0f74a0ad4d532179c0dc9d1,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.2 rake:>= 0|checksum:e4573021c18e555629d782fb497599dd67da0261b026d4908d00868171649e2e,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.3 rake:>= 0|checksum:b7c4d505c5a01919661df274b43b3e609a3937283e9805aad7641dd213039ba6,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.4 rake:>= 0|checksum:376281facd2f23c109a222013d992b7b7016c11c0fe99b629874aa8f3889edf6,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.5 rake:>= 0|checksum:b5e676eea3224c2c5c111c279b59d4afcc246106fa7fadd6728ae9762b02069e,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.6 rake:>= 0|checksum:f2784b927f093a8ac5860d22e4a34c77c2a56391d0071e4df888e796eaca57b4,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.7 rake:>= 0|checksum:755de500565a06900d7f4286f1c761f5681a88c2420f64a27db4f2dd6e0a14dd,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.8 rake:>= 0|checksum:4571ae0cb67cf263957cccfccf06b259592e45690753b18a93224e67bf5e87fd,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.0.9 rake:>= 0|checksum:9f2124219848c413e822249d8b741d462d402bc2bc341712118786c46d617ce1,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.1.0 rake:>= 0|checksum:18d4395ad141f965c26e0862bf40ee350abb797d3442c1b4cb0e5eb083789050,ruby:>= 1.8.7,rubygems:>= 1.8.23
1.1.1 rake:>= 0|checksum:ee6e2f06ac0ca045f80d41eb596c8f33f25415973294952351a66509027f5d87,ruby:>= 1.8.7,rubygems:>= 1.8.23
7 changes: 7 additions & 0 deletions bundler/spec/fixtures/ruby/rubygems_responses/info-rexical
@@ -0,0 +1,7 @@
---
1.0.3 |checksum:9322b01e6fc57284fa5eca09b066413ba19613ca3c29d74101ae6c2ce593e536
1.0.4 |checksum:2dc2986c03cb1f316febbe7c2e162c44ad22346e862d0ab714822c1a2dcdd0c9
1.0.5.beta1 |checksum:ccf892dbe06abe1ab2aa743df6a9d6d4d0084500e9dcefd37126beca63b59326,rubygems:> 1.3.1
1.0.5.beta2 |checksum:cea0596942630cdcb36308ba6e91db7d45a128bc6af4f3060291d4c15d1b4dfd,rubygems:> 1.3.1
1.0.5 |checksum:2db1bcd03fcf7f072ccbf0555417a095f0c5b344d12ecf9a73fc589761006512
1.0.7 |checksum:ea55c7664f27b70b9a768bded04cd47996fa7d11b6f857381c92df2429aaff5d
@@ -0,0 +1,2 @@
---
1.0.1.20090313144615 |checksum:890ce4b41afb507cf3fcf0714d66bee44e921c04a23c9059271cde8f932eb752
Expand Up @@ -67,6 +67,7 @@ def handle_cargo_error(error)
end

# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def better_specification_needed?(error)
return false if @custom_specification
return false unless error.message.match?(/specification .* is ambigu/)
Expand Down Expand Up @@ -95,7 +96,7 @@ def better_specification_needed?(error)
@custom_specification = spec_options.first
true
end

# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def dependency_spec
Expand Down
Expand Up @@ -79,6 +79,7 @@ def fetch_version_from_new_lockfile
end

# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def better_specification_needed?(error)
return false if @custom_specification
return false unless error.message.match?(/specification .* is ambigu/)
Expand Down Expand Up @@ -107,7 +108,7 @@ def better_specification_needed?(error)
@custom_specification = spec_options.first
true
end

# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def dependency_spec
Expand Down Expand Up @@ -169,7 +170,6 @@ def check_rust_workspace_root
end

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength
def handle_cargo_errors(error)
Expand Down Expand Up @@ -238,7 +238,6 @@ def handle_cargo_errors(error)
raise error
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength

Expand Down
2 changes: 1 addition & 1 deletion common/dependabot-common.gemspec
Expand Up @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.8"
spec.add_development_dependency "rspec-its", "~> 1.2"
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
spec.add_development_dependency "rubocop", "~> 0.85.0"
spec.add_development_dependency "rubocop", "~> 0.88.0"
spec.add_development_dependency "vcr", "6.0.0"
spec.add_development_dependency "webmock", "~> 3.4"

Expand Down
2 changes: 0 additions & 2 deletions common/lib/dependabot/git_metadata_fetcher.rb
Expand Up @@ -47,7 +47,6 @@ def head_commit_for_ref(ref)

attr_reader :url, :credentials

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def fetch_upload_pack_for(uri)
response = fetch_raw_upload_pack_for(uri)
Expand Down Expand Up @@ -79,7 +78,6 @@ def fetch_upload_pack_for(uri)

raise Dependabot::GitDependenciesNotReachable, [uri]
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def fetch_raw_upload_pack_for(uri)
Expand Down
Expand Up @@ -76,7 +76,6 @@ def upgrade_guide_text

private

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def changelog
return unless changelog_from_suggested_url || source
Expand All @@ -98,7 +97,6 @@ def changelog
# Fall back to the changelog (or nil) from the default branch
default_branch_changelog
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def changelog_from_suggested_url
Expand Down
2 changes: 2 additions & 0 deletions hex/lib/dependabot/hex/update_checker/file_preparer.rb
Expand Up @@ -94,6 +94,7 @@ def updated_version_requirement_string(filename)

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def updated_version_req_lower_bound(filename)
original_req = dependency.requirements.
find { |r| r.fetch(:file) == filename }&.
Expand All @@ -120,6 +121,7 @@ def updated_version_req_lower_bound(filename)
">= #{parts.join('.')}"
end
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/PerceivedComplexity

Expand Down
Expand Up @@ -163,7 +163,6 @@ def requirements_for_path(requirements, path)
end

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength
def handle_yarn_lock_updater_error(error, yarn_lock)
Expand Down Expand Up @@ -255,7 +254,6 @@ def handle_yarn_lock_updater_error(error, yarn_lock)
raise error
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength

Expand Down
Expand Up @@ -2504,8 +2504,9 @@

context "with non-standard indentation" do
it "preserves indentation in the package-lock.json" do
expect(updated_npm_lock.content).to eq(
fixture("npm_lockfiles", "package_lock_preserved_indentation.json")
expect(updated_npm_lock.content).to start_with(
fixture("npm_lockfiles",
"package_lock_preserved_indentation_partial_lockfile")
)
end
end
Expand Down