From e33a42ccc4ba9a33266fe9202e9c560f1f0e0674 Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sat, 18 May 2013 17:11:33 +0200 Subject: [PATCH 1/8] Bump travis-core - Make /builds return recent builds instead of nothing. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0ef613ee..67bdd961 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,7 +53,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: 7931f7847fda40e788ab61a4b7724a41123128c2 + revision: 26aa6752822b546538edce9a52cdb7054675279b specs: travis-core (0.0.1) actionmailer (~> 3.2.12) From c51bcaaa20e1dbe407f9b16e164a957796fddb3b Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Tue, 21 May 2013 13:05:05 +0200 Subject: [PATCH 2/8] Update travis-core - Only return started builds for Build.recent, sort by started_at date --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 67bdd961..2228eaee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,7 +53,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: 26aa6752822b546538edce9a52cdb7054675279b + revision: 73782013c0585f6de5be159b33905b8ab0146e56 specs: travis-core (0.0.1) actionmailer (~> 3.2.12) From 7a7b85d8765acbdc27a2a0170d48ac1d77eacbac Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Thu, 23 May 2013 15:29:29 +0200 Subject: [PATCH 3/8] Update dependencies --- Gemfile.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2228eaee..568a2f08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: git://github.com/getsentry/raven-ruby.git - revision: 267b33417a3ed43f552911cf353561a641ba9fb2 + revision: a07adb1fcbe4b11d938e2af236eb2063d2a22c32 specs: - sentry-raven (0.4.6) + sentry-raven (0.4.8) faraday (>= 0.7.6) hashie (>= 1.1.0) multi_json (~> 1.0) @@ -10,16 +10,16 @@ GIT GIT remote: git://github.com/rack/rack-contrib.git - revision: 6f337267eae0bedb4110879f2aea6b1bb2137980 + revision: 1026181ca6bbe01e7daad43d15b701296abf95b8 specs: rack-contrib (1.2.0) rack (>= 0.9.1) GIT remote: git://github.com/rkh/gh.git - revision: ff93c759591a66c9d5250cada5234d2adde95dd3 + revision: 6eec1a730700d7e94bb288742ad23822d2d28604 specs: - gh (0.11.1) + gh (0.11.2) addressable backports faraday (~> 0.8) @@ -53,7 +53,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: 73782013c0585f6de5be159b33905b8ab0146e56 + revision: e6bbe851c95e7afbbc5420661c8f1329d478a519 specs: travis-core (0.0.1) actionmailer (~> 3.2.12) @@ -82,7 +82,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-support.git - revision: 1f705a2ce4bcc42c642b337f117073abedef971b + revision: c0add49c71ff3c788b4b7e5b63c11d3896d9847d specs: travis-support (0.0.1) @@ -150,7 +150,7 @@ GEM coderay (1.0.9) connection_pool (0.9.3) daemons (1.1.9) - dalli (2.6.2) + dalli (2.6.3) data_migrations (0.0.1) activerecord rake @@ -159,7 +159,7 @@ GEM dotenv (0.7.0) erubis (2.7.0) eventmachine (1.0.3) - facter (1.7.0) + facter (1.7.1) factory_girl (2.4.2) activesupport faraday (0.8.7) @@ -168,7 +168,7 @@ GEM foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) - hashie (2.0.4) + hashie (2.0.5) hashr (0.0.22) hike (1.2.2) hitimes (1.2.1) @@ -177,7 +177,7 @@ GEM i18n (0.6.1) journey (1.0.4) json (1.8.0) - listen (1.0.3) + listen (1.1.3) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) rb-kqueue (>= 0.2) @@ -191,7 +191,7 @@ GEM avl_tree (~> 1.1.2) hitimes (~> 1.1) mime-types (1.23) - mocha (0.13.3) + mocha (0.14.0) metaclass (~> 0.0.1) multi_json (1.7.3) multipart-post (1.2.0) @@ -200,7 +200,7 @@ GEM newrelic_rpm (3.6.1.88) pg (0.13.2) polyglot (0.3.3) - pry (0.9.12.1) + pry (0.9.12.2) coderay (~> 1.0.5) method_source (~> 0.8) slop (~> 3.4) @@ -233,9 +233,9 @@ GEM ffi (>= 0.5.0) rdoc (3.12.2) json (~> 1.4) - redcarpet (2.2.2) + redcarpet (2.3.0) redis (3.0.4) - redis-namespace (1.2.1) + redis-namespace (1.3.0) redis (~> 3.0.0) rerun (0.8.1) listen (>= 1.0.3) @@ -266,7 +266,7 @@ GEM rack-test sinatra (~> 1.3.0) tilt (~> 1.3) - slop (3.4.4) + slop (3.4.5) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) From 791e5f3d0e9376e3f688f8a09945e082ca2eef1a Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Thu, 23 May 2013 15:46:54 +0200 Subject: [PATCH 4/8] Update gemspec --- travis-api.gemspec | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/travis-api.gemspec b/travis-api.gemspec index 4fdfb215..55f7dfff 100644 --- a/travis-api.gemspec +++ b/travis-api.gemspec @@ -12,29 +12,32 @@ Gem::Specification.new do |s| "Sven Fuchs", "Konstantin Haase", "Piotr Sarnacki", + "Josh Kalderimis", "Henrik Hodne", "Mathias Meyer", - "Josh Kalderimis", "Andre Arko", "Erik Michaels-Ober", "Steve Richert", "Brian Ford", - "Nick Schonning" + "Nick Schonning", + "James Dennes" ] s.email = [ "me@svenfuchs.com", "konstantin.mailinglists@googlemail.com", "drogus@gmail.com", - "meyer@paperplanes.de", - "me@henrikhodne.com", - "svenfuchs@artweb-design.de", "josh.kalderimis@gmail.com", + "me@henrikhodne.com", + "meyer@paperplanes.de", + "svenfuchs@artweb-design.de", "andre@arko.net", "sferik@gmail.com", "steve.richert@gmail.com", "bford@engineyard.com", - "nschonni@gmail.com" + "jdennes@gmail.com", + "nschonni@gmail.com", + "konstantin.haase@gmail.com" ] s.files = [ @@ -48,6 +51,7 @@ Gem::Specification.new do |s| "config/unicorn.rb", "docs/00_overview.md", "docs/01_cross_origin.md", + "lib/tasks/build_update_branch.rake", "lib/tasks/build_update_pull_request_data.rake", "lib/travis/api/app.rb", "lib/travis/api/app/access_token.rb", @@ -111,6 +115,7 @@ Gem::Specification.new do |s| "lib/travis/api/app/helpers.rb", "lib/travis/api/app/helpers/accept.rb", "lib/travis/api/app/helpers/current_user.rb", + "lib/travis/api/app/helpers/db_follower.rb", "lib/travis/api/app/helpers/flash.rb", "lib/travis/api/app/helpers/mime_types.rb", "lib/travis/api/app/helpers/respond_with.rb", @@ -134,7 +139,9 @@ Gem::Specification.new do |s| "script/console", "script/server", "spec/integration/formats_handling_spec.rb", + "spec/integration/responders_spec.rb", "spec/integration/routes.backup.rb", + "spec/integration/scopes_spec.rb", "spec/integration/v1/branches_spec.rb", "spec/integration/v1/builds_spec.rb", "spec/integration/v1/hooks_spec.rb", @@ -153,6 +160,7 @@ Gem::Specification.new do |s| "spec/integration/version_spec.rb", "spec/spec_helper.rb", "spec/support/matchers.rb", + "spec/unit/access_token_spec.rb", "spec/unit/app_spec.rb", "spec/unit/cors_spec.rb", "spec/unit/default_spec.rb", From 5f1f189c747ff0d31819787b0420b42019abe132 Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Thu, 23 May 2013 15:48:41 +0200 Subject: [PATCH 5/8] Remove references to "result" in specs This column has now been removed in favor of the state columns. --- spec/integration/v1/repositories_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/integration/v1/repositories_spec.rb b/spec/integration/v1/repositories_spec.rb index b1b35fd1..4f5795bf 100644 --- a/spec/integration/v1/repositories_spec.rb +++ b/spec/integration/v1/repositories_spec.rb @@ -42,7 +42,7 @@ describe 'v1 repos' do describe 'GET /svenfuchs/minimal.png' do it '"unknown" when it only has one build that is not finished' do Build.delete_all - Factory(:build, repository: repo, state: :created, result: nil) + Factory(:build, repository: repo, state: :created) repo.builds.update_all(state: 'started') get('/svenfuchs/minimal.png').should deliver_result_image_for('unknown') end @@ -58,7 +58,7 @@ describe 'v1 repos' do end it '"passing" when there is a running build but the previous one has passed' do - Factory(:build, repository: repo, state: :finished, result: nil, previous_result: 0) + Factory(:build, repository: repo, state: :passed, previous_state: :passed) repo.update_attributes!(last_build_state: 'started') get('/svenfuchs/minimal.png').should deliver_result_image_for('passing') end From 3fdd8d2279e6c2ebbab6397c4318bc216bc0dadc Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Thu, 23 May 2013 15:55:58 +0200 Subject: [PATCH 6/8] Remove hubble dependency --- travis-api.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/travis-api.gemspec b/travis-api.gemspec index 55f7dfff..daefb3bc 100644 --- a/travis-api.gemspec +++ b/travis-api.gemspec @@ -194,7 +194,6 @@ Gem::Specification.new do |s| s.add_dependency 'travis-support' s.add_dependency 'travis-core' - s.add_dependency 'hubble', '~> 0.1' s.add_dependency 'backports', '~> 2.5' s.add_dependency 'pg', '~> 0.13.2' s.add_dependency 'newrelic_rpm', '~> 3.6.1.88' From 3e487e55799b3dac5cfe621c16f8ee84c886d8b3 Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Thu, 23 May 2013 16:29:29 +0200 Subject: [PATCH 7/8] Update travis-core --- Gemfile.lock | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 568a2f08..2442ce34 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,7 +53,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: e6bbe851c95e7afbbc5420661c8f1329d478a519 + revision: 475973f29cd817bacec61db17a903730f4f07c51 specs: travis-core (0.0.1) actionmailer (~> 3.2.12) @@ -97,7 +97,6 @@ PATH specs: travis-api (0.0.1) backports (~> 2.5) - hubble (~> 0.1) newrelic_rpm (~> 3.6.1.88) pg (~> 0.13.2) rack-contrib (~> 1.1) @@ -172,8 +171,6 @@ GEM hashr (0.0.22) hike (1.2.2) hitimes (1.2.1) - hubble (0.1.2) - yajl-ruby (~> 1.1) i18n (0.6.1) journey (1.0.4) json (1.8.0) @@ -284,7 +281,6 @@ GEM polyglot (>= 0.3.1) tzinfo (0.3.37) uuidtools (2.1.4) - yajl-ruby (1.1.0) yard (0.8.6.1) PLATFORMS From 277f0c2f724838832075355ce00a0e83bc7c6084 Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Tue, 4 Jun 2013 21:57:09 +0200 Subject: [PATCH 8/8] Whitelist travis-lite for authentication --- lib/travis/api/app/endpoint/authorization.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index f433cfc1..61c34e9e 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -272,6 +272,8 @@ class Travis::Api::App return unless uri = Addressable::URI.parse(target_origin) if uri.host =~ /\A(.+\.)?travis-ci\.(com|org)\Z/ uri.scheme == 'https' + elsif uri.host =~ /\A(.+\.)?travis-lite\.com\Z/ + uri.scheme == 'https' elsif uri.host == 'localhost' or uri.host == '127.0.0.1' uri.port > 1023 end