From d751c769524e298ac617344a038248e9e22350e8 Mon Sep 17 00:00:00 2001 From: Damian Szymanski Date: Thu, 18 Mar 2021 20:05:57 +0100 Subject: [PATCH 01/29] Update OS for enterprise ship:docker --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index e823cbf2c..feb5517eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ LABEL maintainer Travis CI GmbH # packages required for bundle install RUN ( \ apt-get update ; \ + # update to deb 10.8 + apt-get upgrade -y ; \ apt-get install -y --no-install-recommends git make gcc g++ libpq-dev curl \ && rm -rf /var/lib/apt/lists/* \ ) From f32e097614338afb9bf2152320ef3b3a69a5a985 Mon Sep 17 00:00:00 2001 From: Damian Szymanski Date: Wed, 24 Mar 2021 16:05:37 +0100 Subject: [PATCH 02/29] Update travis yml ship:docker --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 948296a8d..bff669293 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,15 +24,12 @@ services: before_install: - bundle config https://gems.contribsys.com/ $BUNDLE_GEMS__CONTRIBSYS__COM - - 'gem install bundler:1.16.2' + - 'gem install bundler' jobs: include: - stage: "testing time" script: bundle exec rspec - before_install: - - "gem update --system" - - "gem install bundler -v 1.16.2" - stage: ":ship: it to quay.io" dist: bionic ruby: @@ -45,4 +42,5 @@ jobs: install: echo "skipping" before_sript: skip script: make ship - if: (branch = master and type = push ) OR commit_message =~ /ship:docker/ OR env(SHIP_DOCKER) = true \ No newline at end of file + if: (branch = master and type = push ) OR commit_message =~ /ship:docker/ OR env(SHIP_DOCKER) = true + From dba772bce481de5d3a4ce708766a7f46aae6da7d Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Mon, 12 Apr 2021 16:36:13 +0200 Subject: [PATCH 03/29] email handler - ignore case --- lib/travis/addons/handlers/email.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/travis/addons/handlers/email.rb b/lib/travis/addons/handlers/email.rb index 079efe7ef..ed3e9ca00 100644 --- a/lib/travis/addons/handlers/email.rb +++ b/lib/travis/addons/handlers/email.rb @@ -34,9 +34,11 @@ def configured_emails end def default_emails - emails = [commit.author_email, commit.committer_email] + emails = [commit.author_email&.downcase, commit.committer_email&.downcase] user_ids = object.repository.permissions.pluck(:user_id) - ::Email.where(email: emails, user_id: user_ids).pluck(:email).uniq + ::Email.where(user_id: user_ids).pluck(:email).uniq.each do |email| + email if emails.include? email.downcase + end end def unsubscribed_emails From 459ff15fd71e24399438439e9788c7f017ae6ac2 Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 21 Apr 2021 14:55:39 +0200 Subject: [PATCH 04/29] Ext gem update (#250) * security updates * revert activerecord from 5 to 4 * bundler version --- Gemfile | 2 +- Gemfile.lock | 24 ++++++++++++------------ lib/travis/hub/model/build.rb | 2 +- lib/travis/hub/model/job.rb | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index c51cca394..a323752a7 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem 'redis' gem 'redis-namespace' gem 'rollout', '~> 1.1.0' gem 'dalli' -gem 'activerecord' +gem 'activerecord', '~> 4' gem 'faraday' gem 'faraday_middleware' diff --git a/Gemfile.lock b/Gemfile.lock index c049a4dd6..418499111 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,14 +72,14 @@ GEM remote: https://gems.contribsys.com/ specs: HDRHistogram (0.1.3) - activemodel (4.2.10) - activesupport (= 4.2.10) + activemodel (4.2.11.3) + activesupport (= 4.2.11.3) builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) + activerecord (4.2.11.3) + activemodel (= 4.2.11.3) + activesupport (= 4.2.11.3) arel (~> 6.0) - activesupport (4.2.10) + activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) @@ -93,12 +93,12 @@ GEM backports (3.8.0) bourne (1.6.0) mocha (~> 1.1) - builder (3.2.3) + builder (3.2.4) bunny (2.9.2) amq-protocol (~> 2.3.0) coder (0.4.0) coderay (1.1.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.8) connection_pool (2.2.1) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -142,7 +142,7 @@ GEM http (~> 2.0) metaclass (0.0.4) method_source (0.9.0) - minitest (5.11.3) + minitest (5.14.4) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.12.1) @@ -156,7 +156,7 @@ GEM method_source (~> 0.9.0) puma (4.3.5) nio4r (~> 2.0) - rack (1.6.12) + rack (1.6.13) rack-protection (1.5.5) rack rack-ssl (1.4.1) @@ -208,7 +208,7 @@ GEM tilt (2.0.8) travis-encrypt (0.0.5) travis-rollout (0.0.2) - tzinfo (1.2.5) + tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -222,7 +222,7 @@ PLATFORMS ruby DEPENDENCIES - activerecord + activerecord (~> 4) bourne bunny coder diff --git a/lib/travis/hub/model/build.rb b/lib/travis/hub/model/build.rb index f5cfb6d7a..2b9cfe7f6 100644 --- a/lib/travis/hub/model/build.rb +++ b/lib/travis/hub/model/build.rb @@ -22,7 +22,7 @@ class Build < ActiveRecord::Base belongs_to :repository belongs_to :owner, polymorphic: true - belongs_to :config, foreign_key: :config_id, class_name: BuildConfig + belongs_to :config, foreign_key: :config_id, class_name: 'BuildConfig' belongs_to :sender, polymorphic: true has_many :jobs, -> { order(:id) }, as: :source has_many :stages, -> { order(:id) } diff --git a/lib/travis/hub/model/job.rb b/lib/travis/hub/model/job.rb index 0124da171..8cb503aed 100644 --- a/lib/travis/hub/model/job.rb +++ b/lib/travis/hub/model/job.rb @@ -22,8 +22,8 @@ class Job < ActiveRecord::Base belongs_to :build, polymorphic: true, foreign_key: :source_id, foreign_type: :source_type belongs_to :commit belongs_to :stage - belongs_to :config, foreign_key: :config_id, class_name: JobConfig - has_many :versions, class_name: JobVersion + belongs_to :config, foreign_key: :config_id, class_name: 'JobConfig' + has_many :versions, class_name: 'JobVersion' has_one :queueable self.initial_state = :persisted # TODO go away once there's `queueable` From 52f92b65dd31d65a9a0a605d8f86edc58c581d97 Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 2 Jun 2021 12:28:30 +0200 Subject: [PATCH 05/29] rack,sinatra,activerecord update (#252) --- Gemfile | 5 +- Gemfile.lock | 66 ++++++++++++----------- spec/travis/addons/handlers/email_spec.rb | 4 +- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/Gemfile b/Gemfile index a323752a7..75194917d 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem 'redis' gem 'redis-namespace' gem 'rollout', '~> 1.1.0' gem 'dalli' -gem 'activerecord', '~> 4' +gem 'activerecord', '~> 5' gem 'faraday' gem 'faraday_middleware' @@ -40,8 +40,9 @@ gem 'coder' gem 'redlock' gem 'puma' +gem 'rack', '~> 2' gem 'rack-ssl' -gem 'sinatra' +gem 'sinatra', '~> 2' gem 'jwt' gem 'libhoney' diff --git a/Gemfile.lock b/Gemfile.lock index 418499111..b76d78fdf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,28 +72,26 @@ GEM remote: https://gems.contribsys.com/ specs: HDRHistogram (0.1.3) - activemodel (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - activerecord (4.2.11.3) - activemodel (= 4.2.11.3) - activesupport (= 4.2.11.3) - arel (~> 6.0) - activesupport (4.2.11.3) - i18n (~> 0.7) + activemodel (5.2.6) + activesupport (= 5.2.6) + activerecord (5.2.6) + activemodel (= 5.2.6) + activesupport (= 5.2.6) + arel (>= 9.0) + activesupport (5.2.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.4.0) amq-protocol (2.3.0) - arel (6.0.4) + arel (9.0.0) atomic (1.1.99) avl_tree (1.2.1) atomic (~> 1.1) - backports (3.8.0) + backports (3.21.0) bourne (1.6.0) mocha (~> 1.1) - builder (3.2.4) bunny (2.9.2) amq-protocol (~> 2.3.0) coder (0.4.0) @@ -132,7 +130,7 @@ GEM domain_name (~> 0.5) http-form_data (1.0.3) http_parser.rb (0.6.0) - i18n (0.9.5) + i18n (1.8.10) concurrent-ruby (~> 1.0) jemalloc (1.0.1) jwt (1.5.4) @@ -145,8 +143,10 @@ GEM minitest (5.14.4) mocha (1.1.0) metaclass (~> 0.0.1) - multi_json (1.12.1) + multi_json (1.15.0) multipart-post (2.0.0) + mustermann (1.1.1) + ruby2_keywords (~> 0.0.1) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) nio4r (2.5.2) @@ -156,13 +156,13 @@ GEM method_source (~> 0.9.0) puma (4.3.5) nio4r (~> 2.0) - rack (1.6.13) - rack-protection (1.5.5) + rack (2.2.3) + rack-protection (2.1.0) rack rack-ssl (1.4.1) rack - rack-test (0.6.3) - rack (>= 1.0) + rack-test (1.1.0) + rack (>= 1.0, < 3) rake (13.0.1) redis (3.3.5) redis-namespace (1.5.2) @@ -183,6 +183,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) + ruby2_keywords (0.0.4) safe_yaml (1.0.4) sentry-raven (2.4.0) faraday (>= 0.7.6, < 1.0) @@ -193,19 +194,19 @@ GEM redis (>= 3.3.4, < 5) sidekiq-pro (3.5.3) sidekiq (>= 4.1.5) - sinatra (1.4.8) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) - sinatra-contrib (1.4.7) - backports (>= 2.0) + sinatra (2.1.0) + mustermann (~> 1.0) + rack (~> 2.2) + rack-protection (= 2.1.0) + tilt (~> 2.0) + sinatra-contrib (2.1.0) multi_json - rack-protection - rack-test - sinatra (~> 1.4.0) - tilt (>= 1.3, < 3) + mustermann (~> 1.0) + rack-protection (= 2.1.0) + sinatra (= 2.1.0) + tilt (~> 2.0) thread_safe (0.3.6) - tilt (2.0.8) + tilt (2.0.10) travis-encrypt (0.0.5) travis-rollout (0.0.2) tzinfo (1.2.9) @@ -222,7 +223,7 @@ PLATFORMS ruby DEPENDENCIES - activerecord (~> 4) + activerecord (~> 5) bourne bunny coder @@ -244,6 +245,7 @@ DEPENDENCIES pg pry puma + rack (~> 2) rack-ssl rack-test rake @@ -255,7 +257,7 @@ DEPENDENCIES sentry-raven sidekiq-pro! simple_states! - sinatra + sinatra (~> 2) sinatra-contrib travis-config! travis-encrypt diff --git a/spec/travis/addons/handlers/email_spec.rb b/spec/travis/addons/handlers/email_spec.rb index 89c3f7fa8..44db4f7d7 100644 --- a/spec/travis/addons/handlers/email_spec.rb +++ b/spec/travis/addons/handlers/email_spec.rb @@ -133,7 +133,7 @@ end it 'does not return users who have the no emails global preference' do - user.update_attributes!(preferences: JSON.dump(build_emails: false)) + user.update_attributes(preferences: {:build_emails => false}) Email.create(user: user, email: committer) expect(handler.recipients).to be_empty end @@ -186,7 +186,7 @@ describe 'observes user-level no emails preference' do let(:config) { address } before { Email.create(user: user, email: address) } - before { user.update_attributes!(preferences: JSON.dump(build_emails: false)) } + before { user.update_attributes!(preferences: {:build_emails => false}) } it { expect(handler.recipients).to be_empty } end end From e0713ce056c108fb298326420e76bbead37ec91f Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Tue, 6 Jul 2021 16:08:52 +0200 Subject: [PATCH 06/29] docker fix+trivy --- .travis.yml | 2 +- Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bff669293..b74f457a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ jobs: addons: snaps: - name: docker - channel: latest/beta + channel: latest/stable before_install: echo "skipping" install: echo "skipping" before_sript: skip diff --git a/Makefile b/Makefile index 10a46d663..ce4eef83a 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ docker-push-latest-master: docker-push-branch: $(DOCKER) tag $(DOCKER_DEST) $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) $(DOCKER) push $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) + $(DOCKER) run --rm -v /tmp:/root/.cache/ aquasec/trivy --ignore-unfixed $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) .PHONY: ship ship: docker-build docker-login From dd4c864d7763bc8ec6fa0c6ef924f0900af66a17 Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Wed, 7 Jul 2021 09:24:58 +0200 Subject: [PATCH 07/29] trivy fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce4eef83a..f3e1d7240 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ docker-push-latest-master: docker-push-branch: $(DOCKER) tag $(DOCKER_DEST) $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) $(DOCKER) push $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) - $(DOCKER) run --rm -v /tmp:/root/.cache/ aquasec/trivy --ignore-unfixed $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) + $(DOCKER) run --rm -v /tmp:/root/.cache/ -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy --ignore-unfixed $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) .PHONY: ship ship: docker-build docker-login From 66306ac84dced59111648b5f9ed085d64b3c6776 Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Mon, 2 Aug 2021 14:23:15 +0200 Subject: [PATCH 08/29] gh update --- Gemfile | 2 +- Gemfile.lock | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 75194917d..c1b55e9bb 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,7 @@ gem 'activerecord', '~> 5' gem 'faraday' gem 'faraday_middleware' -gem 'gh' +gem 'gh', git: 'https://github.com/travis-ci/gh', ref: 'tcie3-0_15_1' gem 'keen' gem 'sentry-raven' gem 'simple_states', git: 'https://github.com/svenfuchs/simple_states' diff --git a/Gemfile.lock b/Gemfile.lock index b76d78fdf..1f1edacb9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,19 @@ GIT specs: simple_states (2.0.1) +GIT + remote: https://github.com/travis-ci/gh + revision: 49d4ed2bda65892e1080111ca437bf52b47a5a4b + ref: tcie3-0_15_1 + specs: + gh (0.15.1) + addressable (~> 2.4.0) + backports + faraday (~> 0.8) + multi_json (~> 1.0) + net-http-persistent (~> 2.9) + net-http-pipeline + GIT remote: https://github.com/travis-ci/marginalia revision: 1733a09de1dd8a4e9b6d92cee7413eacb38f0db1 @@ -107,17 +120,10 @@ GEM unf (>= 0.0.5, < 1.0.0) factory_girl (4.7.0) activesupport (>= 3.0.0) - faraday (0.12.1) + faraday (0.17.4) multipart-post (>= 1.2, < 3) faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) - gh (0.15.1) - addressable (~> 2.4.0) - backports - faraday (~> 0.8) - multi_json (~> 1.0) - net-http-persistent (~> 2.9) - net-http-pipeline hashdiff (0.3.0) hashr (2.0.0) hitimes (1.2.6) @@ -144,7 +150,7 @@ GEM mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.15.0) - multipart-post (2.0.0) + multipart-post (2.1.1) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) net-http-persistent (2.9.4) @@ -232,7 +238,7 @@ DEPENDENCIES factory_girl faraday faraday_middleware - gh + gh! jemalloc jwt keen From bf05debc356f1b75bb8a38b23c4a140e0b21b697 Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Thu, 21 Oct 2021 12:00:35 +0200 Subject: [PATCH 09/29] update to use latest docker --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b74f457a6..5fc7fdf6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: ruby +group: edge import: - travis-ci/build-configs:db-setup.yml@postgres-9.6 @@ -34,10 +35,6 @@ jobs: dist: bionic ruby: services: - addons: - snaps: - - name: docker - channel: latest/stable before_install: echo "skipping" install: echo "skipping" before_sript: skip From 64090a8cad841a260a024623c010b4d4633344f3 Mon Sep 17 00:00:00 2001 From: Maciej Kempin Date: Tue, 17 May 2022 12:25:20 +0100 Subject: [PATCH 10/29] Upgrade gems (#255) * proper logging for sidekiq * minimum for Ruby 2.5.9 + safe sidekiq * bump webmock * Trying with ruby-2.7.5 * force bundler to 2.3.7 * bundler in dockerfile * jemallock fix * Jemmaloc 1.1.3 * new sidekiq does not have -i/--index option * sidekiq pro 5.1.1 * join if respond_to * Ruby 2.5.9 * changes in API for Redis Co-authored-by: Maciej Kempin --- .ruby-version | 2 +- .travis.yml | 7 +- Dockerfile | 4 +- Gemfile | 28 ++-- Gemfile.lock | 151 ++++++++++++------- bin/sidekiq | 3 +- lib/travis/hub/api/jwt.rb | 2 +- lib/travis/hub/support/sidekiq.rb | 3 +- lib/travis/hub/support/sidekiq/log_format.rb | 3 +- 9 files changed, 120 insertions(+), 83 deletions(-) diff --git a/.ruby-version b/.ruby-version index 3f5987a5c..30f69e8cc 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.4.9 +2.5.9 diff --git a/.travis.yml b/.travis.yml index 5fc7fdf6d..975e6f065 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,7 @@ group: edge import: - travis-ci/build-configs:db-setup.yml@postgres-9.6 -rvm: 2.4.9 - -cache: bundler +rvm: 2.5.9 env: global: @@ -24,8 +22,9 @@ services: - rabbitmq before_install: + - gem uninstall -v '>=2' -i $(rvm gemdir)@global -ax bundler || true + - gem install bundler -v '2.3.7' - bundle config https://gems.contribsys.com/ $BUNDLE_GEMS__CONTRIBSYS__COM - - 'gem install bundler' jobs: include: diff --git a/Dockerfile b/Dockerfile index feb5517eb..19318cd60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4.9-slim +FROM ruby:2.5.9-slim LABEL maintainer Travis CI GmbH @@ -17,6 +17,8 @@ RUN ( \ rm -f yq_3.1-2_amd64.deb; \ ) +RUN gem install bundler -v '2.3.7' + # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 diff --git a/Gemfile b/Gemfile index c1b55e9bb..8d10496fe 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,9 @@ source 'https://rubygems.org' -ruby '2.4.9' +ruby '2.5.9' -gem 'sidekiq-pro', source: 'https://gems.contribsys.com' +gem 'sidekiq-pro', '~> 5.1.1', source: 'https://gems.contribsys.com' +gem 'sidekiq', '~> 6.4' gem 'travis-exceptions', git: 'https://github.com/travis-ci/travis-exceptions' gem 'travis-logger', git: 'https://github.com/travis-ci/travis-logger' @@ -17,29 +18,30 @@ gem 'travis-rollout', '~> 0.0.2' gem 'metriks', git: 'https://github.com/travis-ci/metriks' gem 'metriks-librato_metrics', git: 'https://github.com/travis-ci/metriks-librato_metrics' -gem 'marginalia', git: 'https://github.com/travis-ci/marginalia' +gem 'marginalia', git: 'https://github.com/travis-ci/marginalia', branch: '5.x' gem 'rake' -gem 'jemalloc' +gem 'jemalloc', git: 'https://github.com/travis-ci/jemalloc-rb', branch: 'jemalloc-v-3-new-rake' gem 'pg' gem 'bunny' -gem 'redis' -gem 'redis-namespace' +gem 'redis', '~> 4.2.0' +gem 'redis-namespace', '~> 1.8.1' gem 'rollout', '~> 1.1.0' gem 'dalli' -gem 'activerecord', '~> 5' +gem 'activerecord', '~> 5.2.6.1' gem 'faraday' -gem 'faraday_middleware' +gem 'faraday_middleware', '~> 1.0' +gem 'addressable', '~> 2.8.0' -gem 'gh', git: 'https://github.com/travis-ci/gh', ref: 'tcie3-0_15_1' +gem 'gh', git: 'https://github.com/travis-ci/gh', branch: 'tcie3-0_15_2' gem 'keen' -gem 'sentry-raven' +gem 'sentry-raven', '~> 3.1.2' gem 'simple_states', git: 'https://github.com/svenfuchs/simple_states' gem 'multi_json' gem 'coder' -gem 'redlock' +gem 'redlock', '~> 1.2.2' -gem 'puma' +gem 'puma', '~> 5.6.2' gem 'rack', '~> 2' gem 'rack-ssl' gem 'sinatra', '~> 2' @@ -52,7 +54,7 @@ group :test do gem 'bourne' gem 'database_cleaner' gem 'factory_girl' - gem 'webmock' + gem 'webmock', '~> 2.3.2' gem 'sinatra-contrib' gem 'rack-test' gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index 1f1edacb9..3f8dcaa88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,23 +6,31 @@ GIT GIT remote: https://github.com/travis-ci/gh - revision: 49d4ed2bda65892e1080111ca437bf52b47a5a4b - ref: tcie3-0_15_1 + revision: 7c4a4707dfbd060e93576eb1fa21cd2b7ba3e3ae + branch: tcie3-0_15_2 specs: gh (0.15.1) - addressable (~> 2.4.0) + addressable (~> 2.8.0) backports - faraday (~> 0.8) + faraday (~> 1.0) multi_json (~> 1.0) net-http-persistent (~> 2.9) net-http-pipeline +GIT + remote: https://github.com/travis-ci/jemalloc-rb + revision: af46aa864c867dbd2ad62b036401dba7b16dffd5 + branch: jemalloc-v-3-new-rake + specs: + jemalloc (1.1.3) + GIT remote: https://github.com/travis-ci/marginalia - revision: 1733a09de1dd8a4e9b6d92cee7413eacb38f0db1 + revision: 07f19a9ee5869a4557437a9f24608c7b1c4275bf + branch: 5.x specs: - marginalia (1.5.0) - activerecord (>= 2.3) + marginalia (1.6.0) + pg (~> 1.3) GIT remote: https://github.com/travis-ci/metriks @@ -81,38 +89,45 @@ GIT travis-support (0.0.1) GEM - remote: https://rubygems.org/ remote: https://gems.contribsys.com/ + specs: + sidekiq-pro (5.1.1) + connection_pool (>= 2.2.3) + sidekiq (>= 6.1.0) + +GEM + remote: https://rubygems.org/ specs: HDRHistogram (0.1.3) - activemodel (5.2.6) - activesupport (= 5.2.6) - activerecord (5.2.6) - activemodel (= 5.2.6) - activesupport (= 5.2.6) + activemodel (5.2.6.2) + activesupport (= 5.2.6.2) + activerecord (5.2.6.2) + activemodel (= 5.2.6.2) + activesupport (= 5.2.6.2) arel (>= 9.0) - activesupport (5.2.6) + activesupport (5.2.6.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.4.0) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) amq-protocol (2.3.0) arel (9.0.0) atomic (1.1.99) avl_tree (1.2.1) atomic (~> 1.1) - backports (3.21.0) + backports (3.23.0) bourne (1.6.0) mocha (~> 1.1) bunny (2.9.2) amq-protocol (~> 2.3.0) coder (0.4.0) coderay (1.1.2) - concurrent-ruby (1.1.8) - connection_pool (2.2.1) - crack (0.4.3) - safe_yaml (~> 1.0.0) + concurrent-ruby (1.1.9) + connection_pool (2.2.5) + crack (0.4.5) + rexml dalli (2.7.6) database_cleaner (1.7.0) diff-lcs (1.2.5) @@ -120,11 +135,32 @@ GEM unf (>= 0.0.5, < 1.0.0) factory_girl (4.7.0) activesupport (>= 3.0.0) - faraday (0.17.4) + faraday (1.10.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) multipart-post (>= 1.2, < 3) - faraday_middleware (0.12.2) - faraday (>= 0.7.4, < 1.0) - hashdiff (0.3.0) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + hashdiff (1.0.1) hashr (2.0.0) hitimes (1.2.6) http (2.2.2) @@ -136,9 +172,8 @@ GEM domain_name (~> 0.5) http-form_data (1.0.3) http_parser.rb (0.6.0) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) - jemalloc (1.0.1) jwt (1.5.4) keen (0.7.8) multi_json (~> 1.0) @@ -146,7 +181,7 @@ GEM http (~> 2.0) metaclass (0.0.4) method_source (0.9.0) - minitest (5.14.4) + minitest (5.15.0) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.15.0) @@ -155,12 +190,13 @@ GEM ruby2_keywords (~> 0.0.1) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) - nio4r (2.5.2) - pg (0.19.0) + nio4r (2.5.8) + pg (1.3.2) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) - puma (4.3.5) + public_suffix (4.0.6) + puma (5.6.2) nio4r (~> 2.0) rack (2.2.3) rack-protection (2.1.0) @@ -170,11 +206,12 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rake (13.0.1) - redis (3.3.5) - redis-namespace (1.5.2) - redis (~> 3.0, >= 3.0.4) - redlock (0.1.8) - redis (~> 3, >= 3.0.0) + redis (4.2.5) + redis-namespace (1.8.1) + redis (>= 3.0.4) + redlock (1.2.2) + redis (>= 3.0.0, < 5.0) + rexml (3.2.5) rollout (1.1.0) rspec (3.5.0) rspec-core (~> 3.5.0) @@ -190,16 +227,12 @@ GEM rspec-support (~> 3.5.0) rspec-support (3.5.0) ruby2_keywords (0.0.4) - safe_yaml (1.0.4) - sentry-raven (2.4.0) - faraday (>= 0.7.6, < 1.0) - sidekiq (5.0.5) - concurrent-ruby (~> 1.0) - connection_pool (~> 2.2, >= 2.2.0) - rack-protection (>= 1.5.0) - redis (>= 3.3.4, < 5) - sidekiq-pro (3.5.3) - sidekiq (>= 4.1.5) + sentry-raven (3.1.2) + faraday (>= 1.0) + sidekiq (6.4.1) + connection_pool (>= 2.2.2) + rack (~> 2.0) + redis (>= 4.2.0) sinatra (2.1.0) mustermann (~> 1.0) rack (~> 2.2) @@ -220,7 +253,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.5) - webmock (2.1.0) + webmock (2.3.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@ -229,7 +262,8 @@ PLATFORMS ruby DEPENDENCIES - activerecord (~> 5) + activerecord (~> 5.2.6.1) + addressable (~> 2.8.0) bourne bunny coder @@ -237,9 +271,9 @@ DEPENDENCIES database_cleaner factory_girl faraday - faraday_middleware + faraday_middleware (~> 1.0) gh! - jemalloc + jemalloc! jwt keen libhoney @@ -250,18 +284,19 @@ DEPENDENCIES multi_json pg pry - puma + puma (~> 5.6.2) rack (~> 2) rack-ssl rack-test rake - redis - redis-namespace - redlock + redis (~> 4.2.0) + redis-namespace (~> 1.8.1) + redlock (~> 1.2.2) rollout (~> 1.1.0) rspec - sentry-raven - sidekiq-pro! + sentry-raven (~> 3.1.2) + sidekiq (~> 6.4) + sidekiq-pro (~> 5.1.1)! simple_states! sinatra (~> 2) sinatra-contrib @@ -273,10 +308,10 @@ DEPENDENCIES travis-metrics! travis-rollout (~> 0.0.2) travis-support! - webmock + webmock (~> 2.3.2) RUBY VERSION - ruby 2.4.9p362 + ruby 2.5.9p362 BUNDLED WITH - 1.17.3 + 2.3.7 diff --git a/bin/sidekiq b/bin/sidekiq index adbcb8805..3481f98e8 100755 --- a/bin/sidekiq +++ b/bin/sidekiq @@ -1,6 +1,5 @@ #!/bin/bash -index=$(echo ${DYNO:-1} | sed 's/.*\.//') threads=$1 shift queues=$@ @@ -8,7 +7,7 @@ args= export RUBYOPT="-Ilib $RUBYOPT" -cmd="sidekiq -r ./lib/travis/hub/sidekiq.rb -c $threads -i $index" +cmd="sidekiq -r ./lib/travis/hub/sidekiq.rb -c $threads" for queue in $queues; do cmd="$cmd -q $queue" done diff --git a/lib/travis/hub/api/jwt.rb b/lib/travis/hub/api/jwt.rb index 6a698ecc4..a981b373b 100644 --- a/lib/travis/hub/api/jwt.rb +++ b/lib/travis/hub/api/jwt.rb @@ -13,7 +13,7 @@ def run def valid? return false unless refresh_token.valid? - return false unless redis.exists(refresh_key) + return false unless redis.exists?(refresh_key) redis.del(refresh_key) true end diff --git a/lib/travis/hub/support/sidekiq.rb b/lib/travis/hub/support/sidekiq.rb index 78db0fbfe..de4009909 100644 --- a/lib/travis/hub/support/sidekiq.rb +++ b/lib/travis/hub/support/sidekiq.rb @@ -8,9 +8,8 @@ module Travis module Sidekiq def setup(config) - ::Sidekiq::Logging.logger.level = Logger::WARN - ::Sidekiq.configure_server do |c| + c.logger.level = Logger::WARN c.redis = { url: config.redis.url, namespace: config.sidekiq.namespace, diff --git a/lib/travis/hub/support/sidekiq/log_format.rb b/lib/travis/hub/support/sidekiq/log_format.rb index f443e4a52..70163f5a4 100644 --- a/lib/travis/hub/support/sidekiq/log_format.rb +++ b/lib/travis/hub/support/sidekiq/log_format.rb @@ -15,7 +15,8 @@ def call(severity, time, progname, message) def context c = Thread.current[:sidekiq_context] - c.join(' ') if c && c.any? + c = c.join(' ') if c.respond_to?(:join) + c end end end From dd28822185bb42dce3d8d48d713307f6786098e9 Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Thu, 19 May 2022 13:01:55 +0200 Subject: [PATCH 11/29] gem updates (#258) --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3f8dcaa88..41ea47610 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -196,10 +196,10 @@ GEM coderay (~> 1.1.0) method_source (~> 0.9.0) public_suffix (4.0.6) - puma (5.6.2) + puma (5.6.4) nio4r (~> 2.0) rack (2.2.3) - rack-protection (2.1.0) + rack-protection (2.2.0) rack rack-ssl (1.4.1) rack @@ -226,23 +226,23 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) - ruby2_keywords (0.0.4) + ruby2_keywords (0.0.5) sentry-raven (3.1.2) faraday (>= 1.0) sidekiq (6.4.1) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) - sinatra (2.1.0) + sinatra (2.2.0) mustermann (~> 1.0) rack (~> 2.2) - rack-protection (= 2.1.0) + rack-protection (= 2.2.0) tilt (~> 2.0) - sinatra-contrib (2.1.0) + sinatra-contrib (2.2.0) multi_json mustermann (~> 1.0) - rack-protection (= 2.1.0) - sinatra (= 2.1.0) + rack-protection (= 2.2.0) + sinatra (= 2.2.0) tilt (~> 2.0) thread_safe (0.3.6) tilt (2.0.10) @@ -314,4 +314,4 @@ RUBY VERSION ruby 2.5.9p362 BUNDLED WITH - 2.3.7 + 2.3.14 From ef8cd2d701970426f1182e732f7e24d3d2a78aab Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Thu, 19 May 2022 15:08:23 +0200 Subject: [PATCH 12/29] removed trivy' --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index f3e1d7240..10a46d663 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,6 @@ docker-push-latest-master: docker-push-branch: $(DOCKER) tag $(DOCKER_DEST) $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) $(DOCKER) push $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) - $(DOCKER) run --rm -v /tmp:/root/.cache/ -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy --ignore-unfixed $(QUAY_IMAGE):$(VERSION_VALUE)-$(BRANCH) .PHONY: ship ship: docker-build docker-login From b766d14be475f0094f107df19f75a4f3d5fb7e27 Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Wed, 8 Jun 2022 11:15:09 +0200 Subject: [PATCH 13/29] rack update -> 2.2.3.1 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 41ea47610..355bb6caa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -198,7 +198,7 @@ GEM public_suffix (4.0.6) puma (5.6.4) nio4r (~> 2.0) - rack (2.2.3) + rack (2.2.3.1) rack-protection (2.2.0) rack rack-ssl (1.4.1) From 51352c259e86bbbff2457bba50f7c28f9741774f Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 29 Jun 2022 13:08:57 +0200 Subject: [PATCH 14/29] global webhook urls from installation config (#259) --- lib/travis/addons/handlers/webhook.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/travis/addons/handlers/webhook.rb b/lib/travis/addons/handlers/webhook.rb index 108265bac..bdf328820 100644 --- a/lib/travis/addons/handlers/webhook.rb +++ b/lib/travis/addons/handlers/webhook.rb @@ -18,7 +18,11 @@ def handle end def targets - @targets ||= config.values(:urls) + @targets ||= (config.values(:urls) || []) .push(*global_urls) + end + + def global_urls + @global_urls ||= ENV['TRAVIS_HUB_WEBHOOK_GLOBAL_URLS']&.split(';') || [] end class Instrument < Addons::Instrument From 5cc249dc9f7b85361eebc17c5073499215dab3e6 Mon Sep 17 00:00:00 2001 From: gabriel-arc Date: Thu, 21 Jul 2022 15:33:58 +0200 Subject: [PATCH 15/29] activerecord bump --- Gemfile | 2 +- Gemfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 8d10496fe..b075ba03b 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem 'redis', '~> 4.2.0' gem 'redis-namespace', '~> 1.8.1' gem 'rollout', '~> 1.1.0' gem 'dalli' -gem 'activerecord', '~> 5.2.6.1' +gem 'activerecord', '~> 5.2' gem 'faraday' gem 'faraday_middleware', '~> 1.0' gem 'addressable', '~> 2.8.0' diff --git a/Gemfile.lock b/Gemfile.lock index 355bb6caa..42a13f82c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,13 +99,13 @@ GEM remote: https://rubygems.org/ specs: HDRHistogram (0.1.3) - activemodel (5.2.6.2) - activesupport (= 5.2.6.2) - activerecord (5.2.6.2) - activemodel (= 5.2.6.2) - activesupport (= 5.2.6.2) + activemodel (5.2.8.1) + activesupport (= 5.2.8.1) + activerecord (5.2.8.1) + activemodel (= 5.2.8.1) + activesupport (= 5.2.8.1) arel (>= 9.0) - activesupport (5.2.6.2) + activesupport (5.2.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -124,7 +124,7 @@ GEM amq-protocol (~> 2.3.0) coder (0.4.0) coderay (1.1.2) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) connection_pool (2.2.5) crack (0.4.5) rexml @@ -172,7 +172,7 @@ GEM domain_name (~> 0.5) http-form_data (1.0.3) http_parser.rb (0.6.0) - i18n (1.10.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) jwt (1.5.4) keen (0.7.8) @@ -248,7 +248,7 @@ GEM tilt (2.0.10) travis-encrypt (0.0.5) travis-rollout (0.0.2) - tzinfo (1.2.9) + tzinfo (1.2.10) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -262,7 +262,7 @@ PLATFORMS ruby DEPENDENCIES - activerecord (~> 5.2.6.1) + activerecord (~> 5.2) addressable (~> 2.8.0) bourne bunny From 0046d204df3161129b0ab58848dd992093187048 Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:09:23 +0200 Subject: [PATCH 16/29] image size reduction [ship:docker] (#260) --- Dockerfile | 44 ++++++++++++++++++++++---------------------- Makefile | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 19318cd60..89a6889c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,36 +2,36 @@ FROM ruby:2.5.9-slim LABEL maintainer Travis CI GmbH -# packages required for bundle install RUN ( \ - apt-get update ; \ - # update to deb 10.8 - apt-get upgrade -y ; \ - apt-get install -y --no-install-recommends git make gcc g++ libpq-dev curl \ - && rm -rf /var/lib/apt/lists/* \ -) - -RUN ( \ - curl -sLO http://ppa.launchpad.net/rmescandon/yq/ubuntu/pool/main/y/yq/yq_3.1-2_amd64.deb && \ - dpkg -i yq_3.1-2_amd64.deb && \ - rm -f yq_3.1-2_amd64.deb; \ + bundle config set no-cache 'true'; \ + bundle config --global frozen 1; \ + bundle config set deployment 'true'; \ + mkdir -p /app; \ ) -RUN gem install bundler -v '2.3.7' - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 - -RUN mkdir -p /app WORKDIR /app COPY Gemfile /app COPY Gemfile.lock /app - ARG bundle_gems__contribsys__com -RUN bundle config https://gems.contribsys.com/ $bundle_gems__contribsys__com \ + +RUN ( \ + apt-get update ; \ + apt-get upgrade -y ; \ + apt-get install -y git make gcc g++ libpq-dev curl \ + && rm -rf /var/lib/apt/lists/*; \ + curl -sLO http://ppa.launchpad.net/rmescandon/yq/ubuntu/pool/main/y/yq/yq_3.1-2_amd64.deb && \ + dpkg -i yq_3.1-2_amd64.deb && \ + rm -f yq_3.1-2_amd64.deb; \ + gem install bundler -v '2.3.14'; \ + bundle config https://gems.contribsys.com/ $bundle_gems__contribsys__com \ && bundle install --deployment \ - && bundle config --delete https://gems.contribsys.com/ -RUN gem install --user-install executable-hooks + && bundle config --delete https://gems.contribsys.com/; \ + apt-get remove -y gcc g++ make git perl && apt-get -y autoremove; \ + bundle clean && rm -rf /app/vendor/bundle/ruby/2.5.0/cache/*; \ + rm -rf /usr/local/bundle/cache/\*.gem; \ + find /usr/local/bundle/gems/ \( -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.o' \) -delete; \ + find /app/vendor/ \( -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.o' \) -delete; \ +) COPY . /app diff --git a/Makefile b/Makefile index 10a46d663..628aca3f1 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ DOCKER ?= docker .PHONY: docker-build docker-build: - $(DOCKER) build --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) . + $(DOCKER) build --pull --no-cache --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) . .PHONY: docker-login docker-login: From aacc142ab90cb0c1254e92627fe6541e3d37fb8e Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:35:01 +0100 Subject: [PATCH 17/29] merge from master (#261) * merge from master * ship:docker --- config/travis.example.yml | 3 + lib/travis/addons/config/notify.rb | 4 +- lib/travis/addons/handlers.rb | 2 + lib/travis/addons/handlers/billing.rb | 161 +++++++++++++++++++ lib/travis/addons/handlers/intercom.rb | 53 ++++++ lib/travis/event.rb | 2 +- lib/travis/hub/config.rb | 5 +- lib/travis/hub/service/notify_workers.rb | 12 +- lib/travis/hub/service/update_job.rb | 2 +- lib/travis/sidekiq.rb | 8 + spec/support/factories.rb | 5 + spec/travis/addons/handlers/billing_spec.rb | 53 ++++++ spec/travis/hub/service/update_build_spec.rb | 4 +- spec/travis/hub/service/update_job_spec.rb | 8 +- 14 files changed, 306 insertions(+), 16 deletions(-) create mode 100644 lib/travis/addons/handlers/billing.rb create mode 100644 lib/travis/addons/handlers/intercom.rb create mode 100644 spec/travis/addons/handlers/billing_spec.rb diff --git a/config/travis.example.yml b/config/travis.example.yml index 2c6fad868..7499ea241 100644 --- a/config/travis.example.yml +++ b/config/travis.example.yml @@ -45,3 +45,6 @@ development: test: domain: test.travis-ci.local + billing: + url: 'http://localhost:9292' + auth_key: 't0Ps3Cr3t' diff --git a/lib/travis/addons/config/notify.rb b/lib/travis/addons/config/notify.rb index 23a779754..ae8d3b2e7 100644 --- a/lib/travis/addons/config/notify.rb +++ b/lib/travis/addons/config/notify.rb @@ -9,9 +9,9 @@ class Notify DEFAULTS = { start: { email: false, webhooks: false, campfire: false, hipchat: false, irc: false, flowdock: false, sqwiggle: false, slack: false, pushover: false }, - success: { email: :change, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always }, + success: { email: :change, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always, billing: :always }, failure: { email: :always, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always }, - canceled:{ email: :always, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always }, + canceled:{ email: :always, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always, billing: :always }, errored: { email: :always, webhooks: :always, campfire: :always, hipchat: :always, irc: :always, flowdock: :always, sqwiggle: :always, slack: :always, pushover: :always } } diff --git a/lib/travis/addons/handlers.rb b/lib/travis/addons/handlers.rb index d223ea34d..f531f58a4 100644 --- a/lib/travis/addons/handlers.rb +++ b/lib/travis/addons/handlers.rb @@ -16,3 +16,5 @@ require 'travis/addons/handlers/slack' require 'travis/addons/handlers/pushover' require 'travis/addons/handlers/metrics' +require 'travis/addons/handlers/intercom' +require 'travis/addons/handlers/billing' diff --git a/lib/travis/addons/handlers/billing.rb b/lib/travis/addons/handlers/billing.rb new file mode 100644 index 000000000..e4ddc4205 --- /dev/null +++ b/lib/travis/addons/handlers/billing.rb @@ -0,0 +1,161 @@ +require 'travis/addons/handlers/base' +require 'travis/addons/config' +require 'raven' + +module Travis + module Addons + module Handlers + class Billing < Base + EVENTS = ['job:started', 'job:finished', 'job:canceled'].freeze + KEY = :billing + + MSGS = { + failed: 'Failed to push stats to billing-v2: %s' + } + + def handle? + billing_url && billing_auth_key + end + + def handle + publish unless Travis::Hub.context.config.enterprise? + end + + private + + def billing_url + @billing_url ||= Travis::Hub.context.config.billing.url if Travis::Hub.context.config.billing + end + + def billing_auth_key + @billing_auth_key ||= Travis::Hub.context.config.billing.auth_key if Travis::Hub.context.config.billing + end + + def publish + send_usage(data) + rescue => e + logger.error MSGS[:failed] % e.message + end + + def send_usage(data) + logger.info "Hub usage #{data}" + Travis::Sidekiq.billing(data) + end + + def data + @data ||= serialize_data + end + + def serialize_data + { + job: job_data, + repository: repository_data, + owner: owner_data, + build: build_data + } + end + + def job_data + { + id: object.id, + os: config['os'] || 'linux', + instance_size: meta(:vm_size) || vm_size, + arch: config['arch'] || 'amd64', + started_at: object.started_at, + finished_at: object.finished_at, + virt_type: config['virt'], + queue: object.queue, + vm_size: vm_size, + finished: finished? + } + end + + def repository_data + { + id: repository.id, + slug: repository.slug, + private: repository.private + } + end + + def owner_data + { + type: object.owner_type, + id: object.owner_id, + login: object.owner ? object.owner.login : nil + } + end + + def build_data + { + id: object.build.id, + type: object.build.event_type, + number: object.build.number, + branch: object.build.branch, + sender: build_data_sender + } + end + + def build_data_sender + { + id: object.build.sender_id, + type: object.build.sender_type + } + end + + def meta(value) + params[:worker_meta][0][value] if params.has_key?(:worker_meta) && params[:worker_meta].is_a?(Array) && params[:worker_meta].first.respond_to?(:keys) + end + + def vm_size + config.dig('vm', 'size') + end + + def config + @config ||= object.config_id ? JobConfig.find(object.config_id).config : {} + end + + def connection + @connection ||= Faraday.new(url: billing_url, ssl: { ca_path: '/usr/lib/ssl/certs' }) do |conn| + conn.basic_auth '_', billing_auth_key + conn.headers['Content-Type'] = 'application/json' + conn.request :json + conn.response :json + conn.adapter :net_http + end + end + + def handle_usage_executions_response(response) + case response.status + when 404 + raise StandardError, "Not found #{response.body['error'] || response.body}" + when 400 + raise StandardError, "Client error #{response.body['error'] || response.body}" + when 422 + raise StandardError, "Unprocessable entity #{response.body['error'] || response.body}" + else + raise StandardError, "Server error #{response.body['error'] || response.body}" + end + end + + def logger + Addons.logger + end + + def finished? + event != 'job:started' + end + + # EventHandler + class EventHandler < Addons::Instrument + def notify_completed + publish + end + end + EventHandler.attach_to(self) + + class BillingError < StandardError; end + end + end + end +end diff --git a/lib/travis/addons/handlers/intercom.rb b/lib/travis/addons/handlers/intercom.rb new file mode 100644 index 000000000..444361f78 --- /dev/null +++ b/lib/travis/addons/handlers/intercom.rb @@ -0,0 +1,53 @@ +require 'travis/addons/handlers/base' +require 'travis/addons/handlers/task' + +module Travis + module Addons + module Handlers + class Intercom < Base + include Handlers::Task + + EVENTS = /(build):(created|started|restarted)/ + + def handle? + owner_type.downcase == 'user' + end + + def handle + params = { + event: :report_build, + owner_id: owner_id, + last_build_at: last_build_at + } + run_task(:intercom, {}, params) + end + + class Instrument < Addons::Instrument + def notify_completed + publish + end + end + Instrument.attach_to(self) + + private + + def last_build_at + DateTime.now + end + + def owner + object.owner || nil + end + + def owner_id + owner.id.to_s if owner + end + + def owner_type + owner ? owner.class.name : '' + end + + end + end + end +end diff --git a/lib/travis/event.rb b/lib/travis/event.rb index d9e7241ef..cab05a57c 100644 --- a/lib/travis/event.rb +++ b/lib/travis/event.rb @@ -33,7 +33,7 @@ def subscriptions def notify(event, *args) prefix = Underscore.new(self.class.name).string event = PastTense.new(event).string - Event.dispatch("#{prefix}:#{event}", id: id, attrs: attributes) + Event.dispatch("#{prefix}:#{event}", id: id, attrs: attributes, worker_meta: args) end end end diff --git a/lib/travis/hub/config.rb b/lib/travis/hub/config.rb index 8ff8bb3c3..0821d1e2a 100644 --- a/lib/travis/hub/config.rb +++ b/lib/travis/hub/config.rb @@ -38,8 +38,9 @@ def jwt_key(type) repository: { ssl_key: { size: 4096 } }, queue: 'builds', limit: { resets: { max: 50, after: 6 * 60 * 60 } }, - notifications: [], - auth: { jwt_private_key: jwt_key(:private), jwt_public_key: jwt_key(:public), http_basic_auth: http_basic_auth } + notifications: [ 'billing' ], + auth: { jwt_private_key: jwt_key(:private), jwt_public_key: jwt_key(:public), http_basic_auth: http_basic_auth }, + billing: { url: ENV['BILLING_URL'] || 'http://localhost:9292', auth_key: ENV['BILLING_AUTH_KEY'] || 't0Ps3Cr3t' } def metrics # TODO cleanup keychain? diff --git a/lib/travis/hub/service/notify_workers.rb b/lib/travis/hub/service/notify_workers.rb index 7f53bb626..a8dc5057e 100644 --- a/lib/travis/hub/service/notify_workers.rb +++ b/lib/travis/hub/service/notify_workers.rb @@ -11,9 +11,9 @@ class NotifyWorkers < Struct.new(:context) job_board_cancel: 'Canceling via Job Board delete for ' } - def cancel(job) + def cancel(job, reason = '') cancel_via_job_board(job) - cancel_via_amqp(job) + cancel_via_amqp(job, reason) end private @@ -25,11 +25,15 @@ def cancel_via_job_board(job) job_board.cancel(job.id) end - def cancel_via_amqp(job) + def cancel_via_amqp(job, reason) info :amqp_cancel, job.id, job.state + context.amqp.fanout( 'worker.commands', - type: 'cancel_job', job_id: job.id, source: 'hub' + type: 'cancel_job', + job_id: job.id, + source: 'hub', + reason: reason ) end diff --git a/lib/travis/hub/service/update_job.rb b/lib/travis/hub/service/update_job.rb index 41157f142..7d8eead69 100644 --- a/lib/travis/hub/service/update_job.rb +++ b/lib/travis/hub/service/update_job.rb @@ -109,7 +109,7 @@ def error_job end def notify - NotifyWorkers.new(context).cancel(job) if job.reload.state == :canceled + NotifyWorkers.new(context).cancel(job, data[:reason]) if job.reload.state == :canceled NotifyTraceProcessor.new(context).notify(job, data) if event == :finish end diff --git a/lib/travis/sidekiq.rb b/lib/travis/sidekiq.rb index df90d13d2..04d20aefc 100644 --- a/lib/travis/sidekiq.rb +++ b/lib/travis/sidekiq.rb @@ -54,6 +54,14 @@ def logsearch(*args) ) end + def billing(*args) + default_client.push( + 'queue' => 'billing', + 'class' => 'Travis::Billing::Worker', + 'args' => [nil, "Travis::Billing::Services::UsageTracker", 'perform', *args] + ) + end + private def default_client diff --git a/spec/support/factories.rb b/spec/support/factories.rb index 0822d52b7..bcfb35f2a 100644 --- a/spec/support/factories.rb +++ b/spec/support/factories.rb @@ -61,6 +61,11 @@ def config=(config) state :created end + factory :job_config do + key 'key' + config { { arch: 'amd64', os: 'linux', virt: 'vm' } } + end + factory :user do end diff --git a/spec/travis/addons/handlers/billing_spec.rb b/spec/travis/addons/handlers/billing_spec.rb new file mode 100644 index 000000000..97f08e308 --- /dev/null +++ b/spec/travis/addons/handlers/billing_spec.rb @@ -0,0 +1,53 @@ +describe Travis::Addons::Handlers::Billing do + let(:build) { FactoryGirl.create(:build) } + let(:job_config) { FactoryGirl.create(:job_config, repository_id: build.repository_id) } + let(:job) { FactoryGirl.create(:job, owner: owner, config_id: job_config.id) } + let(:owner) { FactoryGirl.create(:user) } + let!(:request) do + stub_request(:put, 'http://localhost:9292/usage/executions') + .to_return(status: 200, body: '', headers: {}) + end + + describe 'handle' do + let(:handler) { described_class.new(event_name, id: job.id) } + + context 'job:finished' do + let(:event_name) { 'job:finished' } + + it 'publishes event to billing' do + ::Sidekiq::Client.any_instance.expects(:push).with do |payload| + expect(payload['queue']).to eq('billing') + expect(payload['class']).to eq('Travis::Billing::Worker') + expect(payload['args'][1]).to eq('Travis::Billing::Services::UsageTracker') + end + handler.handle + end + end + + context 'job:canceled' do + let(:event_name) { 'job:canceled' } + + it 'publishes event to billing' do + ::Sidekiq::Client.any_instance.expects(:push).with do |payload| + expect(payload['queue']).to eq('billing') + expect(payload['class']).to eq('Travis::Billing::Worker') + expect(payload['args'][1]).to eq('Travis::Billing::Services::UsageTracker') + end + handler.handle + end + end + + context 'job:started' do + let(:event_name) { 'job:started' } + + it 'publishes event to billing' do + ::Sidekiq::Client.any_instance.expects(:push).with do |payload| + expect(payload['queue']).to eq('billing') + expect(payload['class']).to eq('Travis::Billing::Worker') + expect(payload['args'][1]).to eq('Travis::Billing::Services::UsageTracker') + end + handler.handle + end + end + end +end diff --git a/spec/travis/hub/service/update_build_spec.rb b/spec/travis/hub/service/update_build_spec.rb index 87a5f904b..0206346b2 100644 --- a/spec/travis/hub/service/update_build_spec.rb +++ b/spec/travis/hub/service/update_build_spec.rb @@ -135,7 +135,7 @@ end it 'notifies workers' do - amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub') + amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub', reason: '') subject.run end @@ -168,7 +168,7 @@ end it 'notifies workers' do - amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub') + amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub', reason: '') subject.run end diff --git a/spec/travis/hub/service/update_job_spec.rb b/spec/travis/hub/service/update_job_spec.rb index 59a53994b..8219b5924 100644 --- a/spec/travis/hub/service/update_job_spec.rb +++ b/spec/travis/hub/service/update_job_spec.rb @@ -47,7 +47,7 @@ end it 'broadcasts a cancel message' do - amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub') + amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub', reason: '') subject.run end end @@ -77,7 +77,7 @@ end it 'broadcasts a cancel message' do - amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub') + amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub', reason: '') subject.run end end @@ -102,7 +102,7 @@ describe 'cancel event' do let(:state) { :created } let(:event) { :cancel } - let(:data) { { id: job.id } } + let(:data) { { id: job.id, reason: 'Insufficient funds' } } let(:now) { Time.now } it 'updates the job' do @@ -112,7 +112,7 @@ end it 'notifies workers' do - amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub') + amqp.expects(:fanout).with('worker.commands', type: 'cancel_job', job_id: job.id, source: 'hub', reason: 'Insufficient funds') subject.run end From 69c0f1df97ffe97639d2a6b5563fc64780c653c9 Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Wed, 28 Dec 2022 10:22:50 +0100 Subject: [PATCH 18/29] sinatra update to 2.2.3 (#262) --- Dockerfile | 1 + Gemfile.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89a6889c2..97361c913 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN ( \ rm -f yq_3.1-2_amd64.deb; \ gem install bundler -v '2.3.14'; \ bundle config https://gems.contribsys.com/ $bundle_gems__contribsys__com \ + && bundle config set without 'development test' \ && bundle install --deployment \ && bundle config --delete https://gems.contribsys.com/; \ apt-get remove -y gcc g++ make git perl && apt-get -y autoremove; \ diff --git a/Gemfile.lock b/Gemfile.lock index 42a13f82c..90610855b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,7 +186,7 @@ GEM metaclass (~> 0.0.1) multi_json (1.15.0) multipart-post (2.1.1) - mustermann (1.1.1) + mustermann (2.0.2) ruby2_keywords (~> 0.0.1) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) @@ -198,8 +198,8 @@ GEM public_suffix (4.0.6) puma (5.6.4) nio4r (~> 2.0) - rack (2.2.3.1) - rack-protection (2.2.0) + rack (2.2.4) + rack-protection (2.2.3) rack rack-ssl (1.4.1) rack @@ -233,19 +233,19 @@ GEM connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) - sinatra (2.2.0) - mustermann (~> 1.0) + sinatra (2.2.3) + mustermann (~> 2.0) rack (~> 2.2) - rack-protection (= 2.2.0) + rack-protection (= 2.2.3) tilt (~> 2.0) - sinatra-contrib (2.2.0) + sinatra-contrib (2.2.3) multi_json - mustermann (~> 1.0) - rack-protection (= 2.2.0) - sinatra (= 2.2.0) + mustermann (~> 2.0) + rack-protection (= 2.2.3) + sinatra (= 2.2.3) tilt (~> 2.0) thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.0.11) travis-encrypt (0.0.5) travis-rollout (0.0.2) tzinfo (1.2.10) From 58df2417a9d7ed42b089124c517a1463b37113c6 Mon Sep 17 00:00:00 2001 From: GbArc Date: Wed, 18 Oct 2023 13:34:59 +0200 Subject: [PATCH 19/29] jemalloc/gh rev fix ship:docker --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 90610855b..9b5da74bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ GIT GIT remote: https://github.com/travis-ci/gh - revision: 7c4a4707dfbd060e93576eb1fa21cd2b7ba3e3ae + revision: 3319c500df8b8bdde82ee7c330cc7f971fee2c20 branch: tcie3-0_15_2 specs: gh (0.15.1) @@ -19,7 +19,7 @@ GIT GIT remote: https://github.com/travis-ci/jemalloc-rb - revision: af46aa864c867dbd2ad62b036401dba7b16dffd5 + revision: 1568ca3fefcfff2a0f9094c0e3ffbaba7f73c0ad branch: jemalloc-v-3-new-rake specs: jemalloc (1.1.3) From 30aab1cb96403cabcae5dc5a12d4888375d661b9 Mon Sep 17 00:00:00 2001 From: SebastianKarpetaDev <161722641+SebastianKarpetaDev@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:56:31 +0100 Subject: [PATCH 20/29] Update Gemfile --- Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 36651713f..95b1404f5 100644 --- a/Gemfile +++ b/Gemfile @@ -26,16 +26,16 @@ gem 'faraday' gem 'pg', '~> 1' gem 'rake' gem 'redis' -gem 'rollout', git: 'https://github.com/travis-ci/rollout', '~> 1.0' +gem 'rollout', git: 'https://github.com/travis-ci/rollout' gem 'addressable', '~> 2.8.0' gem 'coder' -gem 'gh', git: 'https://github.com/travis-ci/gh', git: 'https://github.com/travis-ci/gh', branch: 'tcie3-0_15_2' +gem 'gh', git: 'https://github.com/travis-ci/gh', branch: 'tcie3-0_15_2' gem 'keen' gem 'multi_json' gem 'redlock' gem 'sentry-ruby' -gem 'simple_states', git: 'https://github.com/travis-ci/simple_states', branch: 'master', '~> 1.2.2' +gem 'simple_states', git: 'https://github.com/travis-ci/simple_states', branch: 'master' gem 'jwt' gem 'libhoney' From 348d7080fc25f19f7942b9d0d96fc48af301ade8 Mon Sep 17 00:00:00 2001 From: Sebastian Karpeta Date: Mon, 18 Mar 2024 13:03:29 +0100 Subject: [PATCH 21/29] Hub merge. Enterprise to master. --- Gemfile | 10 ++++----- Gemfile.lock | 61 +++++++++++++++++++++------------------------------- Makefile | 2 +- 3 files changed, 31 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 95b1404f5..11ccd69b4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' ruby '3.2.2' -gem 'sidekiq-pro', '~> 5.1.1', source: 'https://gems.contribsys.com' +gem 'sidekiq-pro', source: 'https://gems.contribsys.com' gem 'sidekiq', '~> 6.4' gem 'travis-exceptions', git: 'https://github.com/travis-ci/travis-exceptions' @@ -17,7 +17,7 @@ gem 'travis-support', git: 'https://github.com/travis-ci/travis-support' gem 'metriks', git: 'https://github.com/travis-ci/metriks' gem 'metriks-librato_metrics', git: 'https://github.com/travis-ci/metriks-librato_metrics' -gem 'marginalia', git: 'https://github.com/travis-ci/marginalia', branch: '5.x' +gem 'marginalia', git: 'https://github.com/travis-ci/marginalia' gem 'activerecord', '~> 7' gem 'bunny' @@ -27,10 +27,10 @@ gem 'pg', '~> 1' gem 'rake' gem 'redis' gem 'rollout', git: 'https://github.com/travis-ci/rollout' -gem 'addressable', '~> 2.8.0' +gem 'addressable', '~> 2.8.6' gem 'coder' -gem 'gh', git: 'https://github.com/travis-ci/gh', branch: 'tcie3-0_15_2' +gem 'gh', git: 'https://github.com/travis-ci/gh' gem 'keen' gem 'multi_json' gem 'redlock' @@ -49,7 +49,7 @@ group :test do gem 'mocha', '~> 2' gem 'pry' gem 'rack-test' - gem 'rspec', '~> 3.12', '~> 2.3.2' + gem 'rspec', '~> 3.12' gem 'sinatra-contrib' gem 'webmock' end diff --git a/Gemfile.lock b/Gemfile.lock index f2799ee46..0a4beda5e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,23 +1,21 @@ GIT remote: https://github.com/travis-ci/gh - revision: e1fcd75786ffa75667e47d3d824b54d1bd0017fe + revision: 3319c500df8b8bdde82ee7c330cc7f971fee2c20 specs: - gh (0.21.0) - activesupport (~> 7.0.8) - addressable (~> 2.8) - faraday (~> 2) - faraday-retry - faraday-typhoeus - multi_json (~> 1) - net-http-persistent (~> 4) + gh (0.15.1) + addressable (~> 2.8.0) + backports + faraday (~> 1.0) + multi_json (~> 1.0) + net-http-persistent (~> 2.9) net-http-pipeline GIT remote: https://github.com/travis-ci/marginalia - revision: d7c711abd60517b435e50b499fc8997ab67ababe + revision: 07f19a9ee5869a4557437a9f24608c7b1c4275bf specs: marginalia (1.6.0) - pg + pg (~> 1.3) GIT remote: https://github.com/travis-ci/metriks @@ -103,8 +101,9 @@ GIT GEM remote: https://gems.contribsys.com/ specs: - sidekiq-pro (7.2.0) - sidekiq (>= 7.2.0, < 8) + sidekiq-pro (5.1.1) + connection_pool (>= 2.2.3) + sidekiq (>= 6.1.0) GEM remote: https://rubygems.org/ @@ -128,6 +127,7 @@ GEM atomic (1.1.101) avl_tree (1.2.1) atomic (~> 1.1) + backports (3.25.0) base64 (0.2.0) bigdecimal (3.1.6) bunny (2.22.0) @@ -150,20 +150,12 @@ GEM diff-lcs (1.5.1) docile (1.4.0) domain_name (0.6.20240107) - ethon (0.16.0) - ffi (>= 1.15.0) excon (0.109.0) factory_bot (6.4.6) activesupport (>= 5.0.0) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) - net-http - faraday-retry (2.2.0) - faraday (~> 2.0) - faraday-typhoeus (1.1.0) - faraday (~> 2.0) - typhoeus (~> 1.4) + faraday (1.2.0) + multipart-post (>= 1.2, < 3) + ruby2_keywords ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -201,12 +193,10 @@ GEM mocha (2.1.0) ruby2_keywords (>= 0.0.5) multi_json (1.15.0) + multipart-post (2.4.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - net-http (0.4.1) - uri - net-http-persistent (4.0.2) - connection_pool (~> 2.2) + net-http-persistent (2.9.4) net-http-pipeline (1.0.1) nio4r (2.7.0) parallel (1.24.0) @@ -281,11 +271,10 @@ GEM sentry-ruby (5.16.1) concurrent-ruby (~> 1.0, >= 1.0.2) set (1.1.0) - sidekiq (7.2.2) - concurrent-ruby (< 2) - connection_pool (>= 2.3.0) - rack (>= 2.2.4) - redis-client (>= 0.19.0) + sidekiq (6.5.12) + connection_pool (>= 2.2.5, < 3) + rack (~> 2.0) + redis (>= 4.5.0, < 5) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -313,22 +302,21 @@ GEM terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tilt (2.3.0) - typhoeus (1.4.1) - ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - uri (0.13.0) webmock (3.23.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS + arm64-darwin-23 x86_64-linux DEPENDENCIES activerecord (~> 7) + addressable (~> 2.8.6) bunny coder dalli @@ -358,6 +346,7 @@ DEPENDENCIES rubocop-performance rubocop-rspec sentry-ruby + sidekiq (~> 6.4) sidekiq-pro! simple_states! simplecov diff --git a/Makefile b/Makefile index 05de34aca..1bf2c5699 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ DOCKER ?= docker .PHONY: docker-build docker-build: - $(DOCKER) build --pull --no-cache --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) . -f Dockerfile.tcie + $(DOCKER) build --pull --no-cache --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) . -f Dockerfile .PHONY: docker-login docker-login: From f39447a445761901a6386987c90086a516e75607 Mon Sep 17 00:00:00 2001 From: Sebastian Karpeta Date: Mon, 18 Mar 2024 13:29:21 +0100 Subject: [PATCH 22/29] Hub merge. Enterprise to master. --- Gemfile | 2 +- Gemfile.lock | 41 ++++++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 11ccd69b4..539ed20a4 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ gem 'rollout', git: 'https://github.com/travis-ci/rollout' gem 'addressable', '~> 2.8.6' gem 'coder' -gem 'gh', git: 'https://github.com/travis-ci/gh' +gem 'gh', git: 'https://github.com/travis-ci/gh', branch: 'master' gem 'keen' gem 'multi_json' gem 'redlock' diff --git a/Gemfile.lock b/Gemfile.lock index 0a4beda5e..60127536b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,16 @@ GIT remote: https://github.com/travis-ci/gh - revision: 3319c500df8b8bdde82ee7c330cc7f971fee2c20 + revision: e1fcd75786ffa75667e47d3d824b54d1bd0017fe + branch: master specs: - gh (0.15.1) - addressable (~> 2.8.0) - backports - faraday (~> 1.0) - multi_json (~> 1.0) - net-http-persistent (~> 2.9) + gh (0.21.0) + activesupport (~> 7.0.8) + addressable (~> 2.8) + faraday (~> 2) + faraday-retry + faraday-typhoeus + multi_json (~> 1) + net-http-persistent (~> 4) net-http-pipeline GIT @@ -127,7 +130,6 @@ GEM atomic (1.1.101) avl_tree (1.2.1) atomic (~> 1.1) - backports (3.25.0) base64 (0.2.0) bigdecimal (3.1.6) bunny (2.22.0) @@ -150,12 +152,20 @@ GEM diff-lcs (1.5.1) docile (1.4.0) domain_name (0.6.20240107) + ethon (0.16.0) + ffi (>= 1.15.0) excon (0.109.0) factory_bot (6.4.6) activesupport (>= 5.0.0) - faraday (1.2.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + faraday-retry (2.2.0) + faraday (~> 2.0) + faraday-typhoeus (1.1.0) + faraday (~> 2.0) + typhoeus (~> 1.4) ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -193,10 +203,12 @@ GEM mocha (2.1.0) ruby2_keywords (>= 0.0.5) multi_json (1.15.0) - multipart-post (2.4.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - net-http-persistent (2.9.4) + net-http (0.4.1) + uri + net-http-persistent (4.0.2) + connection_pool (~> 2.2) net-http-pipeline (1.0.1) nio4r (2.7.0) parallel (1.24.0) @@ -302,9 +314,12 @@ GEM terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tilt (2.3.0) + typhoeus (1.4.1) + ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + uri (0.13.0) webmock (3.23.0) addressable (>= 2.8.0) crack (>= 0.3.2) From 24fd60edc11ad9159294572c80a98e0207f97544 Mon Sep 17 00:00:00 2001 From: Sebastian Karpeta Date: Mon, 18 Mar 2024 13:33:54 +0100 Subject: [PATCH 23/29] Hub merge. Enterprise to master. --- Gemfile | 2 +- Gemfile.lock | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 539ed20a4..92904b9d1 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' ruby '3.2.2' gem 'sidekiq-pro', source: 'https://gems.contribsys.com' -gem 'sidekiq', '~> 6.4' +gem 'sidekiq', '~> 7.2.0' gem 'travis-exceptions', git: 'https://github.com/travis-ci/travis-exceptions' gem 'travis-logger', git: 'https://github.com/travis-ci/travis-logger' diff --git a/Gemfile.lock b/Gemfile.lock index 60127536b..4a947f173 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -283,10 +283,11 @@ GEM sentry-ruby (5.16.1) concurrent-ruby (~> 1.0, >= 1.0.2) set (1.1.0) - sidekiq (6.5.12) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + sidekiq (7.2.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.19.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -361,7 +362,7 @@ DEPENDENCIES rubocop-performance rubocop-rspec sentry-ruby - sidekiq (~> 6.4) + sidekiq (~> 7.2.0) sidekiq-pro! simple_states! simplecov From 61e3ee989adc46e3f567a53520bd4f47b7915a01 Mon Sep 17 00:00:00 2001 From: Sebastian Karpeta Date: Mon, 18 Mar 2024 13:39:50 +0100 Subject: [PATCH 24/29] Hub merge. Enterprise to master. --- Gemfile.lock | 48 +++--- Gemfile.lock.origin | 386 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 410 insertions(+), 24 deletions(-) create mode 100644 Gemfile.lock.origin diff --git a/Gemfile.lock b/Gemfile.lock index 4a947f173..1f25f9510 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,10 +38,10 @@ GIT GIT remote: https://github.com/travis-ci/rollout - revision: 4a7a0b96dc038f7ca057ca771693d8f5a7c90583 + revision: ec4db3ae6bbf8cf56ce4adce0814247c46195a0e specs: - rollout (2.5.0) - redis (~> 4.0) + rollout (3.0.0) + redis (~> 5.0) GIT remote: https://github.com/travis-ci/simple_states @@ -104,9 +104,8 @@ GIT GEM remote: https://gems.contribsys.com/ specs: - sidekiq-pro (5.1.1) - connection_pool (>= 2.2.3) - sidekiq (>= 6.1.0) + sidekiq-pro (7.2.0) + sidekiq (>= 7.2.0, < 8) GEM remote: https://rubygems.org/ @@ -131,7 +130,7 @@ GEM avl_tree (1.2.1) atomic (~> 1.1) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.7) bunny (2.22.0) amq-protocol (~> 2.3, >= 2.3.1) sorted_set (~> 1, >= 1.0.2) @@ -154,7 +153,7 @@ GEM domain_name (0.6.20240107) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.109.0) + excon (0.110.0) factory_bot (6.4.6) activesupport (>= 5.0.0) faraday (2.9.0) @@ -167,8 +166,8 @@ GEM faraday (~> 2.0) typhoeus (~> 1.4) ffi (1.16.3) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) rake hashdiff (1.1.0) hashr (2.0.1) @@ -182,16 +181,16 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) json (2.7.1) - jwt (2.8.0) + jwt (2.8.1) base64 keen (1.1.1) addressable (~> 2.5) multi_json (~> 1.12) language_server-protocol (3.17.0.3) - libhoney (2.2.0) + libhoney (2.3.0) addressable (~> 2.0) excon http (>= 2.0, < 6.0) @@ -199,7 +198,7 @@ GEM ffi-compiler (~> 1.0) rake (~> 13.0) method_source (1.0.0) - minitest (5.22.2) + minitest (5.22.3) mocha (2.1.0) ruby2_keywords (>= 0.0.5) multi_json (1.15.0) @@ -215,7 +214,7 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc - pg (1.5.5) + pg (1.5.6) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -234,8 +233,9 @@ GEM rainbow (3.1.1) rake (13.1.0) rbtree (0.4.6) - redis (4.8.1) - redis-client (0.20.0) + redis (5.1.0) + redis-client (>= 0.17.0) + redis-client (0.21.0) connection_pool redlock (2.0.6) redis-client (>= 0.14.1, < 1.0.0) @@ -254,7 +254,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.60.2) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -262,11 +262,11 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-factory_bot (2.25.1) @@ -274,13 +274,14 @@ GEM rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rspec (2.26.1) + rubocop-rspec (2.27.1) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - sentry-ruby (5.16.1) + sentry-ruby (5.17.1) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) set (1.1.0) sidekiq (7.2.2) @@ -328,7 +329,6 @@ GEM PLATFORMS arm64-darwin-23 - x86_64-linux DEPENDENCIES activerecord (~> 7) diff --git a/Gemfile.lock.origin b/Gemfile.lock.origin new file mode 100644 index 000000000..4a947f173 --- /dev/null +++ b/Gemfile.lock.origin @@ -0,0 +1,386 @@ +GIT + remote: https://github.com/travis-ci/gh + revision: e1fcd75786ffa75667e47d3d824b54d1bd0017fe + branch: master + specs: + gh (0.21.0) + activesupport (~> 7.0.8) + addressable (~> 2.8) + faraday (~> 2) + faraday-retry + faraday-typhoeus + multi_json (~> 1) + net-http-persistent (~> 4) + net-http-pipeline + +GIT + remote: https://github.com/travis-ci/marginalia + revision: 07f19a9ee5869a4557437a9f24608c7b1c4275bf + specs: + marginalia (1.6.0) + pg (~> 1.3) + +GIT + remote: https://github.com/travis-ci/metriks + revision: ca03449b2928962e41c8389283bd092053e91670 + specs: + metriks (0.9.9.8) + HDRHistogram (~> 0.1) + atomic (~> 1.0) + avl_tree (~> 1.2) + hitimes (~> 1.3) + +GIT + remote: https://github.com/travis-ci/metriks-librato_metrics + revision: e876ca2f0e1abcc745260c3772118e63fb946c8a + specs: + metriks-librato_metrics (1.0.6) + +GIT + remote: https://github.com/travis-ci/rollout + revision: 4a7a0b96dc038f7ca057ca771693d8f5a7c90583 + specs: + rollout (2.5.0) + redis (~> 4.0) + +GIT + remote: https://github.com/travis-ci/simple_states + revision: 240cebde9178f7e8a520e3566ed9875bf69799ac + branch: master + specs: + simple_states (2.0.1) + +GIT + remote: https://github.com/travis-ci/travis-config + revision: 601e9a6dcb799dc14944c40153c60aaf935629ee + specs: + travis-config (2.0.0) + hashr (~> 2.0) + +GIT + remote: https://github.com/travis-ci/travis-encrypt + revision: 71c202ac2bcabd772f31f5904f8ab06c911e9389 + specs: + travis-encrypt (0.0.6) + +GIT + remote: https://github.com/travis-ci/travis-exceptions + revision: 7da3ea3b38349d66ea8f27c33d643e4af5087599 + specs: + travis-exceptions (0.1.0) + sentry-ruby + +GIT + remote: https://github.com/travis-ci/travis-lock + revision: aeee7b5d11e3d44f19d0a113c2e54ec54756f20f + specs: + travis-lock (0.2.0) + +GIT + remote: https://github.com/travis-ci/travis-logger + revision: c754e91f959015ac9ebe98e5082efdaf3754863d + specs: + travis-logger (0.1.0) + +GIT + remote: https://github.com/travis-ci/travis-metrics + revision: 0b6a8accc70685a1cb65f1ec5305bceab41ad777 + specs: + travis-metrics (3.0.0) + metriks-librato_metrics (~> 1.0) + +GIT + remote: https://github.com/travis-ci/travis-rollout + revision: 4e89a17a4b5ca1f6269fb8bc1d067faabc49ac92 + specs: + travis-rollout (0.1.0) + +GIT + remote: https://github.com/travis-ci/travis-support + revision: 8b566a94502267b3115c901f8409dc2165b6539b + specs: + travis-support (0.1.0) + +GEM + remote: https://gems.contribsys.com/ + specs: + sidekiq-pro (5.1.1) + connection_pool (>= 2.2.3) + sidekiq (>= 6.1.0) + +GEM + remote: https://rubygems.org/ + specs: + HDRHistogram (0.1.11) + activemodel (7.0.8.1) + activesupport (= 7.0.8.1) + activerecord (7.0.8.1) + activemodel (= 7.0.8.1) + activesupport (= 7.0.8.1) + activesupport (7.0.8.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + amq-protocol (2.3.2) + ansi (1.5.0) + ast (2.4.2) + atomic (1.1.101) + avl_tree (1.2.1) + atomic (~> 1.1) + base64 (0.2.0) + bigdecimal (3.1.6) + bunny (2.22.0) + amq-protocol (~> 2.3, >= 2.3.1) + sorted_set (~> 1, >= 1.0.2) + coder (0.4.0) + coderay (1.1.3) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal + rexml + dalli (3.2.8) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.1.0) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + diff-lcs (1.5.1) + docile (1.4.0) + domain_name (0.6.20240107) + ethon (0.16.0) + ffi (>= 1.15.0) + excon (0.109.0) + factory_bot (6.4.6) + activesupport (>= 5.0.0) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + faraday-retry (2.2.0) + faraday (~> 2.0) + faraday-typhoeus (1.1.0) + faraday (~> 2.0) + typhoeus (~> 1.4) + ffi (1.16.3) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake + hashdiff (1.1.0) + hashr (2.0.1) + hitimes (1.3.1) + http (5.2.0) + addressable (~> 2.8) + base64 (~> 0.1) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.5.0) + http-cookie (1.0.5) + domain_name (~> 0.5) + http-form_data (2.3.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + jwt (2.8.0) + base64 + keen (1.1.1) + addressable (~> 2.5) + multi_json (~> 1.12) + language_server-protocol (3.17.0.3) + libhoney (2.2.0) + addressable (~> 2.0) + excon + http (>= 2.0, < 6.0) + llhttp-ffi (0.5.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) + method_source (1.0.0) + minitest (5.22.2) + mocha (2.1.0) + ruby2_keywords (>= 0.0.5) + multi_json (1.15.0) + mustermann (3.0.0) + ruby2_keywords (~> 0.0.1) + net-http (0.4.1) + uri + net-http-persistent (4.0.2) + connection_pool (~> 2.2) + net-http-pipeline (1.0.1) + nio4r (2.7.0) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + pg (1.5.5) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (5.0.4) + puma (6.4.2) + nio4r (~> 2.0) + racc (1.7.3) + rack (2.2.8.1) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-ssl (1.4.1) + rack + rack-test (2.1.0) + rack (>= 1.3) + rainbow (3.1.1) + rake (13.1.0) + rbtree (0.4.6) + redis (4.8.1) + redis-client (0.20.0) + connection_pool + redlock (2.0.6) + redis-client (>= 0.14.1, < 1.0.0) + regexp_parser (2.9.0) + rexml (3.2.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (1.60.2) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rspec (2.26.1) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sentry-ruby (5.16.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + set (1.1.0) + sidekiq (7.2.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.19.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-console (0.9.1) + ansi + simplecov + terminal-table + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) + tilt (~> 2.0) + sinatra-contrib (3.2.0) + multi_json (>= 0.0.2) + mustermann (~> 3.0) + rack-protection (= 3.2.0) + sinatra (= 3.2.0) + tilt (~> 2.0) + sorted_set (1.0.3) + rbtree + set (~> 1.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + tilt (2.3.0) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + uri (0.13.0) + webmock (3.23.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + +PLATFORMS + arm64-darwin-23 + x86_64-linux + +DEPENDENCIES + activerecord (~> 7) + addressable (~> 2.8.6) + bunny + coder + dalli + database_cleaner + factory_bot + faraday + gh! + jwt + keen + libhoney + marginalia! + metriks! + metriks-librato_metrics! + mocha (~> 2) + multi_json + pg (~> 1) + pry + puma (~> 6) + rack-ssl + rack-test + rake + redis + redlock + rollout! + rspec (~> 3.12) + rubocop + rubocop-performance + rubocop-rspec + sentry-ruby + sidekiq (~> 7.2.0) + sidekiq-pro! + simple_states! + simplecov + simplecov-console + sinatra (~> 3) + sinatra-contrib + travis-config! + travis-encrypt! + travis-exceptions! + travis-lock! + travis-logger! + travis-metrics! + travis-rollout! + travis-support! + webmock + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.19 From dd223816cce7ada5db5e690dc5bfd090edf56dcf Mon Sep 17 00:00:00 2001 From: SebastianKarpetaDev <161722641+SebastianKarpetaDev@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:40:45 +0100 Subject: [PATCH 25/29] Delete Gemfile.lock.origin --- Gemfile.lock.origin | 386 -------------------------------------------- 1 file changed, 386 deletions(-) delete mode 100644 Gemfile.lock.origin diff --git a/Gemfile.lock.origin b/Gemfile.lock.origin deleted file mode 100644 index 4a947f173..000000000 --- a/Gemfile.lock.origin +++ /dev/null @@ -1,386 +0,0 @@ -GIT - remote: https://github.com/travis-ci/gh - revision: e1fcd75786ffa75667e47d3d824b54d1bd0017fe - branch: master - specs: - gh (0.21.0) - activesupport (~> 7.0.8) - addressable (~> 2.8) - faraday (~> 2) - faraday-retry - faraday-typhoeus - multi_json (~> 1) - net-http-persistent (~> 4) - net-http-pipeline - -GIT - remote: https://github.com/travis-ci/marginalia - revision: 07f19a9ee5869a4557437a9f24608c7b1c4275bf - specs: - marginalia (1.6.0) - pg (~> 1.3) - -GIT - remote: https://github.com/travis-ci/metriks - revision: ca03449b2928962e41c8389283bd092053e91670 - specs: - metriks (0.9.9.8) - HDRHistogram (~> 0.1) - atomic (~> 1.0) - avl_tree (~> 1.2) - hitimes (~> 1.3) - -GIT - remote: https://github.com/travis-ci/metriks-librato_metrics - revision: e876ca2f0e1abcc745260c3772118e63fb946c8a - specs: - metriks-librato_metrics (1.0.6) - -GIT - remote: https://github.com/travis-ci/rollout - revision: 4a7a0b96dc038f7ca057ca771693d8f5a7c90583 - specs: - rollout (2.5.0) - redis (~> 4.0) - -GIT - remote: https://github.com/travis-ci/simple_states - revision: 240cebde9178f7e8a520e3566ed9875bf69799ac - branch: master - specs: - simple_states (2.0.1) - -GIT - remote: https://github.com/travis-ci/travis-config - revision: 601e9a6dcb799dc14944c40153c60aaf935629ee - specs: - travis-config (2.0.0) - hashr (~> 2.0) - -GIT - remote: https://github.com/travis-ci/travis-encrypt - revision: 71c202ac2bcabd772f31f5904f8ab06c911e9389 - specs: - travis-encrypt (0.0.6) - -GIT - remote: https://github.com/travis-ci/travis-exceptions - revision: 7da3ea3b38349d66ea8f27c33d643e4af5087599 - specs: - travis-exceptions (0.1.0) - sentry-ruby - -GIT - remote: https://github.com/travis-ci/travis-lock - revision: aeee7b5d11e3d44f19d0a113c2e54ec54756f20f - specs: - travis-lock (0.2.0) - -GIT - remote: https://github.com/travis-ci/travis-logger - revision: c754e91f959015ac9ebe98e5082efdaf3754863d - specs: - travis-logger (0.1.0) - -GIT - remote: https://github.com/travis-ci/travis-metrics - revision: 0b6a8accc70685a1cb65f1ec5305bceab41ad777 - specs: - travis-metrics (3.0.0) - metriks-librato_metrics (~> 1.0) - -GIT - remote: https://github.com/travis-ci/travis-rollout - revision: 4e89a17a4b5ca1f6269fb8bc1d067faabc49ac92 - specs: - travis-rollout (0.1.0) - -GIT - remote: https://github.com/travis-ci/travis-support - revision: 8b566a94502267b3115c901f8409dc2165b6539b - specs: - travis-support (0.1.0) - -GEM - remote: https://gems.contribsys.com/ - specs: - sidekiq-pro (5.1.1) - connection_pool (>= 2.2.3) - sidekiq (>= 6.1.0) - -GEM - remote: https://rubygems.org/ - specs: - HDRHistogram (0.1.11) - activemodel (7.0.8.1) - activesupport (= 7.0.8.1) - activerecord (7.0.8.1) - activemodel (= 7.0.8.1) - activesupport (= 7.0.8.1) - activesupport (7.0.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) - amq-protocol (2.3.2) - ansi (1.5.0) - ast (2.4.2) - atomic (1.1.101) - avl_tree (1.2.1) - atomic (~> 1.1) - base64 (0.2.0) - bigdecimal (3.1.6) - bunny (2.22.0) - amq-protocol (~> 2.3, >= 2.3.1) - sorted_set (~> 1, >= 1.0.2) - coder (0.4.0) - coderay (1.1.3) - concurrent-ruby (1.2.3) - connection_pool (2.4.1) - crack (1.0.0) - bigdecimal - rexml - dalli (3.2.8) - database_cleaner (2.0.2) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) - activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) - database_cleaner-core (2.0.1) - diff-lcs (1.5.1) - docile (1.4.0) - domain_name (0.6.20240107) - ethon (0.16.0) - ffi (>= 1.15.0) - excon (0.109.0) - factory_bot (6.4.6) - activesupport (>= 5.0.0) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) - net-http - faraday-retry (2.2.0) - faraday (~> 2.0) - faraday-typhoeus (1.1.0) - faraday (~> 2.0) - typhoeus (~> 1.4) - ffi (1.16.3) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) - rake - hashdiff (1.1.0) - hashr (2.0.1) - hitimes (1.3.1) - http (5.2.0) - addressable (~> 2.8) - base64 (~> 0.1) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - llhttp-ffi (~> 0.5.0) - http-cookie (1.0.5) - domain_name (~> 0.5) - http-form_data (2.3.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - json (2.7.1) - jwt (2.8.0) - base64 - keen (1.1.1) - addressable (~> 2.5) - multi_json (~> 1.12) - language_server-protocol (3.17.0.3) - libhoney (2.2.0) - addressable (~> 2.0) - excon - http (>= 2.0, < 6.0) - llhttp-ffi (0.5.0) - ffi-compiler (~> 1.0) - rake (~> 13.0) - method_source (1.0.0) - minitest (5.22.2) - mocha (2.1.0) - ruby2_keywords (>= 0.0.5) - multi_json (1.15.0) - mustermann (3.0.0) - ruby2_keywords (~> 0.0.1) - net-http (0.4.1) - uri - net-http-persistent (4.0.2) - connection_pool (~> 2.2) - net-http-pipeline (1.0.1) - nio4r (2.7.0) - parallel (1.24.0) - parser (3.3.0.5) - ast (~> 2.4.1) - racc - pg (1.5.5) - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (5.0.4) - puma (6.4.2) - nio4r (~> 2.0) - racc (1.7.3) - rack (2.2.8.1) - rack-protection (3.2.0) - base64 (>= 0.1.0) - rack (~> 2.2, >= 2.2.4) - rack-ssl (1.4.1) - rack - rack-test (2.1.0) - rack (>= 1.3) - rainbow (3.1.1) - rake (13.1.0) - rbtree (0.4.6) - redis (4.8.1) - redis-client (0.20.0) - connection_pool - redlock (2.0.6) - redis-client (>= 0.14.1, < 1.0.0) - regexp_parser (2.9.0) - rexml (3.2.6) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.1) - rubocop (1.60.2) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-performance (1.20.2) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rspec (2.26.1) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - sentry-ruby (5.16.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - set (1.1.0) - sidekiq (7.2.2) - concurrent-ruby (< 2) - connection_pool (>= 2.3.0) - rack (>= 2.2.4) - redis-client (>= 0.19.0) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-console (0.9.1) - ansi - simplecov - terminal-table - simplecov-html (0.12.3) - simplecov_json_formatter (0.1.4) - sinatra (3.2.0) - mustermann (~> 3.0) - rack (~> 2.2, >= 2.2.4) - rack-protection (= 3.2.0) - tilt (~> 2.0) - sinatra-contrib (3.2.0) - multi_json (>= 0.0.2) - mustermann (~> 3.0) - rack-protection (= 3.2.0) - sinatra (= 3.2.0) - tilt (~> 2.0) - sorted_set (1.0.3) - rbtree - set (~> 1.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - tilt (2.3.0) - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) - uri (0.13.0) - webmock (3.23.0) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - -PLATFORMS - arm64-darwin-23 - x86_64-linux - -DEPENDENCIES - activerecord (~> 7) - addressable (~> 2.8.6) - bunny - coder - dalli - database_cleaner - factory_bot - faraday - gh! - jwt - keen - libhoney - marginalia! - metriks! - metriks-librato_metrics! - mocha (~> 2) - multi_json - pg (~> 1) - pry - puma (~> 6) - rack-ssl - rack-test - rake - redis - redlock - rollout! - rspec (~> 3.12) - rubocop - rubocop-performance - rubocop-rspec - sentry-ruby - sidekiq (~> 7.2.0) - sidekiq-pro! - simple_states! - simplecov - simplecov-console - sinatra (~> 3) - sinatra-contrib - travis-config! - travis-encrypt! - travis-exceptions! - travis-lock! - travis-logger! - travis-metrics! - travis-rollout! - travis-support! - webmock - -RUBY VERSION - ruby 3.2.2p53 - -BUNDLED WITH - 2.4.19 From 44e837ed9d658e88bf5ad677bf0c6d8d328e34ae Mon Sep 17 00:00:00 2001 From: Sebastian Karpeta Date: Mon, 18 Mar 2024 14:03:32 +0100 Subject: [PATCH 26/29] Hub merge. Enterprise to master. --- Gemfile.lock | 1 + lib/travis/hub/config.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1f25f9510..2686896d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -329,6 +329,7 @@ GEM PLATFORMS arm64-darwin-23 + x86_64-linux DEPENDENCIES activerecord (~> 7) diff --git a/lib/travis/hub/config.rb b/lib/travis/hub/config.rb index c04761d6b..02dc591b0 100644 --- a/lib/travis/hub/config.rb +++ b/lib/travis/hub/config.rb @@ -42,7 +42,6 @@ def jwt_key(type) limit: { resets: { max: 50, after: 6 * 60 * 60 } }, notifications: ['billing'], auth: { jwt_private_key: jwt_key(:private), jwt_public_key: jwt_key(:public), http_basic_auth: }, - billing: { url: ENV['BILLING_URL'] || 'http://localhost:9292', auth_key: ENV['BILLING_AUTH_KEY'] || 't0Ps3Cr3t' }, billing: { url: ENV['BILLING_URL'] || 'http://localhost:9292', auth_key: ENV['BILLING_AUTH_KEY'] || 't0Ps3Cr3t' } def metrics From 4fc31b5f457e363a0f28e8000f33bc224937e90b Mon Sep 17 00:00:00 2001 From: GbArc Date: Tue, 2 Apr 2024 13:37:25 +0200 Subject: [PATCH 27/29] dist up to focal, ship:docker --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index acb12773f..836739f9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ jobs: - stage: "testing time" script: bundle exec rspec - stage: ":ship: it to quay.io" - dist: bionic + dist: focal ruby: services: before_install: echo "skipping" From c88df50f18919492de5ebb0a3555bb04f128b17e Mon Sep 17 00:00:00 2001 From: gabriel-arc <57348209+GbArc@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:10:39 +0200 Subject: [PATCH 28/29] removed duplicate method --- lib/travis/sidekiq.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/travis/sidekiq.rb b/lib/travis/sidekiq.rb index eb044be11..ebc895ac2 100644 --- a/lib/travis/sidekiq.rb +++ b/lib/travis/sidekiq.rb @@ -62,14 +62,6 @@ def billing(*args) ) end - def billing(*args) - default_client.push( - 'queue' => 'billing', - 'class' => 'Travis::Billing::Worker', - 'args' => [nil, "Travis::Billing::Services::UsageTracker", 'perform', *args] - ) - end - private def default_client From 9398f8794ffc21190498aa3f0003915d38e8a5e2 Mon Sep 17 00:00:00 2001 From: GbArc Date: Tue, 16 Apr 2024 12:24:46 +0200 Subject: [PATCH 29/29] spec- removed duplicated --- spec/support/factories.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/spec/support/factories.rb b/spec/support/factories.rb index c69f05c42..d58720896 100644 --- a/spec/support/factories.rb +++ b/spec/support/factories.rb @@ -66,11 +66,6 @@ def config=(config) config { { arch: 'amd64', os: 'linux', virt: 'vm' } } end - factory :job_config do - key 'key' - config { { arch: 'amd64', os: 'linux', virt: 'vm' } } - end - factory :user do end