Conversation
keep netrc
Added preferences method implementation to User and Organization classes.
When we migrate a build history it's possible that some jobs are still running on .org. We shouldn't count them towards concurrency limits because they're technically running on .org
When we migrate build history some of the builds may be in the created state. We don't want to enqueue them as then they would be running on both platforms.
ws_config is a Hashr, which doesn't have `#key?`
*_settings is redundant.
…190) I've already attempted it to fix the problem in 01139a4, but I only fixed one code path, which is currently not used, so the changes didn't go into effect. This commit applies the changes to the other code path as well. The reason we need to do it is because when we migrate jobs from .org to .com they might still be in a state that is considered by gatekeeper. So they might be started but they're running on .org not .com, thus we shouldn't count them as running on .com. The same with new jobs - we don't want to start them as they would start on .org anyway. I decided to filter these jobs in code instead of in the database because the number of jobs that we fetch from the database is relatively small and if I had to do it in the DB I would have to always join jobs with repositories, which actually might be slower.
cherry pick commits from the public repo
This reverts commit 455b3f0.
This reverts commit e8f725d.
Allow ARM builds for Open Source only
Allow IBM power builds for Open Source only
Allow IBM z builds for Open Source only
Revert "Allow IBM z builds for Open Source only"
Stop cancelled build jobs from being queued
queue the job if there is an exception
Restrict ruby gem-update to 3.4.22 because it still supports ruby 2.6
lib/travis/scheduler/config.rb
Outdated
| billing: { url: 'http://localhost:9292/', auth_key: 'auth_keys' },host: 'https://travis-ci.com', | ||
| interval: 2, | ||
| limit: { public: 5, education: 1, default: 5, by_owner: {}, delegate: {} }, | ||
| limit: { public: 93939, education: 92929, default: 91919, by_owner: {}, delegate: {} }, |
There was a problem hiding this comment.
leave at 5,1,5 , the 93939 were tcie debug only
| super if !on_metered_plan? || billing_allowed?(job) | ||
| end | ||
|
|
||
| def accept?(job) |
lib/travis/scheduler/record/job.rb
Outdated
| config = record&.config_json if record.respond_to?(:config_json) # TODO: remove once we've rolled over | ||
| config ||= record&.config | ||
| config ||= read_attribute(:config) if has_attribute?(:config) | ||
| config = JSON.parse(config) if config.is_a?(String) |
lib/travis/scheduler/record/user.rb
Outdated
| billing_client.get_plan(self).to_h | ||
| end | ||
| return false if plan[:error] || plan['plan_name'].nil? | ||
| return false if plan[:error] || plan["plan_name"].nil? |
lib/travis/scheduler/record/user.rb
Outdated
| return false if plan[:error] || plan["plan_name"].nil? | ||
|
|
||
| plan['hybrid'] || !plan['plan_name'].include?('free') | ||
| plan["hybrid"] || !plan["plan_name"].include?('free') |
| description: repo.description, | ||
| server_type: repo.server_type || 'git' | ||
| ) | ||
| server_type: repo.server_type || 'git',) |
There was a problem hiding this comment.
double setting and ',' (see 119)
| def vm_configs | ||
| config[:vm_configs] || {} | ||
| end | ||
| def vm_configs |
spec/travis/scheduler/jobs_spec.rb
Outdated
| end | ||
| end | ||
|
|
||
| context 'when user is on a metered plan' do |
There was a problem hiding this comment.
if something related to billing is on enterprise branch and isn't on master - it was removed for some reason, better don't bring it back there
| vm_type: :default, | ||
| vm_config: {}, | ||
| vm_type: :default, | ||
| vm_size: nil, |
| let(:owner) { FactoryBot.create(:user) } | ||
| let(:build) { FactoryBot.create(:build, repository: repo, owner:, jobs: [job]) } | ||
| let(:job) { FactoryBot.create(:job, private: true, state: :created, config: config.to_h) } | ||
| let(:job_stage) { FactoryGirl.create(:stage) } |
There was a problem hiding this comment.
FactoryBot, there's no FactoryGirl anymore
| let(:repo) { FactoryBot.create(:repo, owner:) } | ||
| let(:owner) { FactoryBot.create(:user) } | ||
| let(:commit) { FactoryBot.create(:commit) } | ||
| let(:build) { FactoryGirl.create(:build, repository: repo, owner: owner, jobs: [job]) } |
There was a problem hiding this comment.
FactoryBot, there's no FactoryGirl anymore
| it { expect(log).to include 'Evaluating jobs for owner group: user svenfuchs, org travis-ci' } | ||
| it { expect(log).to include "enqueueing job #{Job.first.id} (svenfuchs/gem-release)" } | ||
| it { expect(log).to include 'user svenfuchs, org travis-ci capacities: public max=5, config max=1' } | ||
| # it { expect(log).to include 'user svenfuchs, org travis-ci capacities: public max=5, config max=1' } |
There was a problem hiding this comment.
this was debug only for tcie, can be enabled
| expect(log).to include "I 1234 Owner group scheduler.owners-svenfuchs is locked and already being evaluated. Dropping event build:created for build=#{build.id}" | ||
| } | ||
| end | ||
|
|
There was a problem hiding this comment.
for some reason removed on master, don't add it (also factorygirl used)
|
|
||
| describe Travis::Scheduler::Service::Notify do | ||
| let(:job) { FactoryBot.create(:job, state: :queued, queued_at: Time.parse('2016-01-01T10:30:00Z'), config: {}) } | ||
| let(:build) { FactoryGirl.create(:build, repository: repo, owner: owner, jobs: [job]) } |
There was a problem hiding this comment.
factorygirl -> factorybot
There was a problem hiding this comment.
factorygirl is still here for 'build'
gbarc-dt
left a comment
There was a problem hiding this comment.
found some factorygirl calls - pls grep the sources and replace all with factorybot
|
|
||
| describe Travis::Scheduler::Service::Notify do | ||
| let(:job) { FactoryBot.create(:job, state: :queued, queued_at: Time.parse('2016-01-01T10:30:00Z'), config: {}) } | ||
| let(:build) { FactoryGirl.create(:build, repository: repo, owner: owner, jobs: [job]) } |
There was a problem hiding this comment.
factorygirl is still here for 'build'
| let(:owner) { FactoryBot.create(:user) } | ||
| let(:commit) { FactoryBot.create(:commit) } | ||
| let(:build) { FactoryBot.create(:build, repository: repo, owner: owner, jobs: [job]) } | ||
| let(:job_stage) { FactoryGirl.create(:stage) } |
There was a problem hiding this comment.
factorygirl for 'job_stage' - change to factorybot
| end | ||
|
|
||
| context 'when head repo is present' do | ||
| let(:head_repo) { FactoryGirl.create(:repository, github_id: 549744) } |
There was a problem hiding this comment.
factorygirl - change to factorybot
| let(:user) { FactoryBot.create(:user) } | ||
| let(:repo) { FactoryBot.create(:repository) } | ||
| let(:authorize_build_url) { "http://localhost:9292/users/#{user.id}/plan" } | ||
| let(:repo) { FactoryGirl.create(:repository) } |
There was a problem hiding this comment.
factorygirl - change to factorybot
| rescue => e | ||
| puts "ERROR while trying to queue: #{e.message}" | ||
| puts "Backtrace:" | ||
| puts e.backtrace.join("\n")@queue ||= redirect(Queue.new(job, config, logger).select) |
No description provided.