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

Bump sinatra from 2.0.8.1 to 3.0.5 #2063

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.8
2.5.9
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
dist: xenial
rvm: 2.5.8
rvm: 2.5.9

services:
- redis
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <[email protected]>
WORKDIR /app

Expand Down
35 changes: 17 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
29 changes: 4 additions & 25 deletions lib/travis/build/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/travis/build/script/shared/rvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -223,4 +223,4 @@ def install_bundler
end
end
end
end
end
13 changes: 7 additions & 6 deletions public/version-aliases/ghc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
70 changes: 29 additions & 41 deletions spec/build/rake_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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

Expand Down