diff --git a/.ruby-version b/.ruby-version index ecd7ee50cb..30f69e8cc5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.8 +2.5.9 diff --git a/.travis.yml b/.travis.yml index d7f868ddd6..0e9db07d42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby dist: xenial -rvm: 2.5.8 +rvm: 2.5.9 services: - redis diff --git a/Dockerfile b/Dockerfile index 4dfbb9dbc6..f651dcc070 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.5.8 as builder +FROM ruby:2.5.9 as builder WORKDIR /app ARG GITHUB_OAUTH_TOKEN=notset @@ -12,7 +12,7 @@ RUN bundle install --frozen --deployment --without='development test' --clean RUN bundle exec rake assets:precompile GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN RUN tar -cjf public.tar.bz2 public && rm -rf public -FROM ruby:2.5.8-slim +FROM ruby:2.5.9-slim LABEL maintainer Travis CI GmbH WORKDIR /app diff --git a/Gemfile.lock b/Gemfile.lock index 0a4329a3ee..92cd181c33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM ast (2.4.0) atomic (1.1.101) avl_tree (1.1.3) - backports (3.18.1) + backports (3.24.1) codeclimate-test-reporter (1.0.8) simplecov (<= 0.13) coder (0.4.0) @@ -105,10 +105,10 @@ GEM minitest (5.14.0) mocha (1.7.0) metaclass (~> 0.0.1) - msgpack (1.2.4) - multi_json (1.14.1) + msgpack (1.7.0) + multi_json (1.15.0) multipart-post (2.1.1) - mustermann (1.1.1) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) net-http-persistent (3.0.0) connection_pool (~> 2.2) @@ -117,7 +117,7 @@ GEM octokit (4.18.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) - optimist (3.0.0) + optimist (3.0.1) parallel (1.12.1) parallel_tests (2.23.0) parallel @@ -133,7 +133,7 @@ GEM json websocket (~> 1.0) rack (2.2.6.2) - rack-protection (2.0.8.1) + rack-protection (3.0.5) rack rack-ssl (1.4.1) rack @@ -144,7 +144,7 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - rbtrace (0.4.11) + rbtrace (0.4.14) ffi (>= 1.0.6) msgpack (>= 0.4.3) optimist (>= 3.0.0) @@ -179,7 +179,7 @@ GEM ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.10.0) - ruby2_keywords (0.0.2) + ruby2_keywords (0.0.5) ruby_dep (1.5.0) sawyer (0.8.2) addressable (>= 2.3.5) @@ -191,20 +191,19 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sinatra (2.0.8.1) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.8.1) + sinatra (3.0.5) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.0.5) tilt (~> 2.0) - sinatra-contrib (2.0.8.1) - backports (>= 2.8.2) + sinatra-contrib (3.0.5) multi_json - mustermann (~> 1.0) - rack-protection (= 2.0.8.1) - sinatra (= 2.0.8.1) + mustermann (~> 3.0) + rack-protection (= 3.0.5) + sinatra (= 3.0.5) tilt (~> 2.0) thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.1.0) travis (1.8.9) backports faraday (~> 0.9) diff --git a/lib/travis/build/rake_tasks.rb b/lib/travis/build/rake_tasks.rb index c1fbc1c07f..4d6398695e 100644 --- a/lib/travis/build/rake_tasks.rb +++ b/lib/travis/build/rake_tasks.rb @@ -57,32 +57,11 @@ def fetch_githubusercontent_file(from, host: 'raw.githubusercontent.com', end def latest_release_for(repo) - conn = build_faraday_conn(host: 'api.github.com') - - response = conn.get do |req| - releases_url = "repos/#{repo}/releases" - logger.info "Fetching releases from #{conn.url_prefix}#{releases_url}" - req.url releases_url - oauth_token = ENV.fetch( - 'GITHUB_OAUTH_TOKEN', ENV.fetch('no_scope_token', 'notset') - ) - if oauth_token && !oauth_token.empty? && oauth_token != 'notset' - logger.info( - "Adding 'Authorization' header for api.github.com request" - ) - req.headers['Authorization'] = "token #{oauth_token}" - end - end - - raise "Could not find releases for #{repo}" unless response.success? - - json_data = JSON.parse(response.body) - raise "No releases found for #{repo}" if json_data.empty? - - json_data.sort! do |a, b| - semver_cmp(a['tag_name'].sub(/^v/, ''), b['tag_name'].sub(/^v/, '')) + begin + octokit.latest_release(repo)['tag_name'] + rescue + raise "Could not get latest release for #{repo}" end - json_data.last['tag_name'] end def file_update_sc_data diff --git a/lib/travis/build/script/shared/rvm.rb b/lib/travis/build/script/shared/rvm.rb index 282ac89f84..f9cf6cc86f 100644 --- a/lib/travis/build/script/shared/rvm.rb +++ b/lib/travis/build/script/shared/rvm.rb @@ -17,9 +17,9 @@ module RVM RVM_VERSION_ALIASES = { '2.3' => '2.3.8', '2.4' => '2.4.10', - '2.5' => '2.5.8', - '2.6' => '2.6.6', - '2.7' => '2.7.1', + '2.5' => '2.5.9', + '2.6' => '2.6.10', + '2.7' => '2.7.8' } RVM_GPG_KEY_IDS = %w( @@ -223,4 +223,4 @@ def install_bundler end end end -end \ No newline at end of file +end diff --git a/public/version-aliases/ghc.json b/public/version-aliases/ghc.json index 555b5ca846..aae728f71a 100644 --- a/public/version-aliases/ghc.json +++ b/public/version-aliases/ghc.json @@ -166,9 +166,9 @@ "9.0.1-alpha1": "9.0.1-alpha1", "9.0": "9.0.2", "9.0.1": "9.0.1", - "9": "9.6.0.20230302", - "9.x": "9.6.0.20230302", - "9.x.x": "9.6.0.20230302", + "9": "9.6.1", + "9.x": "9.6.1", + "9.x.x": "9.6.1", "9.0.x": "9.0.2", "9.0.2": "9.0.2", "9.2.1-alpha1": "9.2.1-alpha1", @@ -192,12 +192,13 @@ "9.4.3": "9.4.3", "9.4.4": "9.4.4", "9.6.0.20230111": "9.6.0.20230111", - "9.6.x": "9.6.0.20230302", - "9.6": "9.6.1-alpha3", + "9.6.x": "9.6.1", + "9.6": "9.6.1", "9.6.0.20230128": "9.6.0.20230128", "9.6.0.20230210": "9.6.0.20230210", "9.6.0.20230302": "9.6.0.20230302", "9.6.1-alpha1": "9.6.1-alpha1", "9.6.1-alpha2": "9.6.1-alpha2", - "9.6.1-alpha3": "9.6.1-alpha3" + "9.6.1-alpha3": "9.6.1-alpha3", + "9.6.1": "9.6.1" } \ No newline at end of file diff --git a/spec/build/rake_tasks_spec.rb b/spec/build/rake_tasks_spec.rb index 1bbbf0bad6..db46ce749b 100644 --- a/spec/build/rake_tasks_spec.rb +++ b/spec/build/rake_tasks_spec.rb @@ -11,29 +11,8 @@ def tmp_top describe Travis::Build::RakeTasks do subject { described_class } - def releases_response(*versions) - [ - 200, - { 'Content-Type' => 'application/json' }, - JSON.dump( - versions.map { |v| { 'tag_name' => v } } - ) - ] - end - let :request_stubs do Faraday::Adapter::Test::Stubs.new do |stub| - %w[ - creationix/nvm - tmate-io/tmate - tools/godep - travis-ci/gimme - ].each do |repo_slug| - stub.get("/repos/#{repo_slug}/releases") do |*| - releases_response('v1.2.3', 'v1.2.5') - end - end - [ ['tmate-io/tmate', 'tmate-v1.2.5-static-linux-amd64.tar.xz'], ['tools/godep', 'godep_darwin_amd64'], @@ -168,27 +147,36 @@ def releases_response(*versions) expect(ghc_versions).to_not be_exist end - %w[ - public/files/casher - public/files/gimme - public/files/godep_darwin_amd64 - public/files/godep_linux_amd64 - public/files/nvm.sh - public/files/rustup-init.sh - public/files/sbt - public/files/sc-linux.tar.gz - public/files/sc-osx.zip - public/files/tmate-static-linux-amd64.tar.xz - public/version-aliases/ghc.json - ].each do |filename| - it "can fetch #{filename}" do - %w[ - tmp/ghc-versions.html - ].each { |t| Rake::Task[t].reenable } + context 'fetch files' do + let(:uri_template) { Addressable::Template.new 'https://api.github.com/repos/{owner}/{repo}/releases/latest' } + + %w[ + public/files/casher + public/files/gimme + public/files/godep_darwin_amd64 + public/files/godep_linux_amd64 + public/files/nvm.sh + public/files/rustup-init.sh + public/files/sbt + public/files/sc-linux.tar.gz + public/files/sc-osx.zip + public/files/tmate-static-linux-amd64.tar.xz + public/version-aliases/ghc.json + ].each do |filename| + before do + stub_request(:get, uri_template) + .to_return(headers: { content_type: 'application/json' }, body: '{"tag_name": "v1.2.5"}') + end - Rake::Task[filename].reenable - Rake::Task[filename].invoke - expect(tmp_top + filename).to be_exist + it "can fetch #{filename}" do + %w[ + tmp/ghc-versions.html + ].each { |t| Rake::Task[t].reenable } + + Rake::Task[filename].reenable + Rake::Task[filename].invoke + expect(tmp_top + filename).to be_exist + end end end