From 6ba3e2e7470ec526d5b5de7a84176dd97cc7a666 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 13 Sep 2021 10:23:50 +0200 Subject: [PATCH 01/88] removing whole users and orgs wip --- lib/travis-backup.rb | 40 +++++++++++++++++++++++++++++----------- spec/backup_spec.rb | 22 +++++++++++++++++++++- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/lib/travis-backup.rb b/lib/travis-backup.rb index eb82ce7..8e5ff7b 100644 --- a/lib/travis-backup.rb +++ b/lib/travis-backup.rb @@ -38,20 +38,14 @@ def run(args={}) repo_id = args[:repo_id] || @config.repo_id org_id = args[:org_id] || @config.org_id - if user_id - owner_id = user_id - owner_type = 'User' - elsif org_id - owner_id = org_id - owner_type = 'Organization' - end - if @config.move_logs move_logs elsif @config.remove_orphans remove_orphans - elsif owner_id - process_repos_for_owner(owner_id, owner_type) + elsif user_id + process_user(user_id) + elsif org_id + process_organization(org_id) elsif repo_id process_repo_with_id(repo_id) else @@ -61,6 +55,22 @@ def run(args={}) print_dry_run_report if @config.dry_run end + def process_user(user_id) + if @config.threshold + process_repos_for_owner(user_id, 'User') + else + remove_user_with_dependencies(user_id) + end + end + + def process_organization(org_id) + if @config.threshold + process_repos_for_owner(org_id, 'Organization') + else + remove_org_with_dependencies(org_id) + end + end + def process_repos_for_owner(owner_id, owner_type) Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| process_repo(repository) @@ -68,7 +78,15 @@ def process_repos_for_owner(owner_id, owner_type) end def process_repo_with_id(repo_id) - process_repo(Repository.find(repo_id)) + if @config.threshold + process_repo(Repository.find(repo_id)) + else + remove_repo_with_dependencies(repo_id) + end + end + + def remove_repo_with_dependencies(repo_id) + end def process_all_repos diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index 8772bac..67e2d5a 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -237,7 +237,7 @@ def destination_logs_size FactoryBot.create(:organization_with_repos) } - context 'when no arguments are given' do + context 'when no id arguments are given' do it 'processes every repository' do Repository.all.each do |repository| expect(backup).to receive(:process_repo_builds).once.with(repository) @@ -282,6 +282,26 @@ def destination_logs_size end end + context 'when threshold is not given' do + context 'when user_id is given' do + it 'removes the user with all dependencies' do + + end + end + + context 'when org_id is given' do + it 'removes the organisation with all dependencies' do + + end + end + + context 'when repo_id is given' do + it 'removes the repo with all dependencies' do + + end + end + end + context 'when move logs mode is on' do let!(:backup) { Backup.new(files_location: files_location, limit: 5, move_logs: true) } From e841b3768abe87d50a71ca2721a6786945f3f540 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 22 Sep 2021 14:04:58 +0200 Subject: [PATCH 02/88] removing users and orgs - wip --- .../{remove_old.rb => remove_specified.rb} | 2 +- lib/config.rb | 13 ++-- lib/models/abuse.rb | 7 +++ lib/models/email.rb | 7 +++ lib/models/membership.rb | 7 +++ lib/models/permission.rb | 7 +++ lib/models/star.rb | 7 +++ lib/models/token.rb | 7 +++ lib/models/user_beta_feature.rb | 7 +++ lib/travis-backup.rb | 4 +- ...e_old_spec.rb => remove_specified_spec.rb} | 61 +++++++++---------- spec/backup_spec.rb | 45 +++++++++++--- 12 files changed, 124 insertions(+), 50 deletions(-) rename lib/backup/{remove_old.rb => remove_specified.rb} (99%) create mode 100644 lib/models/abuse.rb create mode 100644 lib/models/email.rb create mode 100644 lib/models/membership.rb create mode 100644 lib/models/permission.rb create mode 100644 lib/models/star.rb create mode 100644 lib/models/token.rb create mode 100644 lib/models/user_beta_feature.rb rename spec/backup/{remove_old_spec.rb => remove_specified_spec.rb} (81%) diff --git a/lib/backup/remove_old.rb b/lib/backup/remove_specified.rb similarity index 99% rename from lib/backup/remove_old.rb rename to lib/backup/remove_specified.rb index ed6178a..655c0ad 100644 --- a/lib/backup/remove_old.rb +++ b/lib/backup/remove_specified.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Backup - class RemoveOld + class RemoveSpecified attr_reader :config def initialize(config, dry_run_reporter=nil) diff --git a/lib/config.rb b/lib/config.rb index ead7726..1f6987a 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -105,9 +105,10 @@ def set_values(args) end def check_values - if !@move_logs && !@remove_orphans && !@threshold + if !@move_logs && !@remove_orphans && !@threshold && !@user_id && !org_id && !repo_id message = abort_message("Please provide the threshold argument. Data younger than it will be omitted. " + - "Threshold defines number of months from now.") + "Threshold defines number of months from now. Alternatively you can define user_id, org_id or repo_id " + + "to remove whole user, organization or repository with all dependencies.") abort message end @@ -126,10 +127,12 @@ def check_values end def abort_message(intro) - "\n#{intro} Example usage:\n"+ - "\n $ bin/travis_backup 'postgres://my_database_url' --threshold 6\n" + + "\n#{intro}\n\nExample usage:\n"+ + "\n $ bin/travis_backup 'postgres://my_database_url' --threshold 6" + + "\n $ bin/travis_backup 'postgres://my_database_url' --user_id 1\n" + "\nor using in code:\n" + - "\n Backup.new(database_url: 'postgres://my_database_url', threshold: 6)\n" + + "\n Backup.new(database_url: 'postgres://my_database_url', threshold: 6)" + + "\n Backup.new(database_url: 'postgres://my_database_url', user_id: 1)\n" + "\nYou can also set it using environment variables or configuration files.\n" end diff --git a/lib/models/abuse.rb b/lib/models/abuse.rb new file mode 100644 index 0000000..573bb6e --- /dev/null +++ b/lib/models/abuse.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Abuse < Model + self.table_name = 'abuses' +end diff --git a/lib/models/email.rb b/lib/models/email.rb new file mode 100644 index 0000000..5467fa4 --- /dev/null +++ b/lib/models/email.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Email < Model + self.table_name = 'emails' +end diff --git a/lib/models/membership.rb b/lib/models/membership.rb new file mode 100644 index 0000000..b62d530 --- /dev/null +++ b/lib/models/membership.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Membership < Model + self.table_name = 'memberships' +end diff --git a/lib/models/permission.rb b/lib/models/permission.rb new file mode 100644 index 0000000..65e3594 --- /dev/null +++ b/lib/models/permission.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Permission < Model + self.table_name = 'permissions' +end diff --git a/lib/models/star.rb b/lib/models/star.rb new file mode 100644 index 0000000..14b2e24 --- /dev/null +++ b/lib/models/star.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Star < Model + self.table_name = 'stars' +end diff --git a/lib/models/token.rb b/lib/models/token.rb new file mode 100644 index 0000000..bc147fd --- /dev/null +++ b/lib/models/token.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Token < Model + self.table_name = 'tokens' +end diff --git a/lib/models/user_beta_feature.rb b/lib/models/user_beta_feature.rb new file mode 100644 index 0000000..2b281b9 --- /dev/null +++ b/lib/models/user_beta_feature.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class UserBetaFeature < Model + self.table_name = 'user_beta_features' +end diff --git a/lib/travis-backup.rb b/lib/travis-backup.rb index b0306d6..6f8ce8c 100644 --- a/lib/travis-backup.rb +++ b/lib/travis-backup.rb @@ -17,7 +17,7 @@ require 'models/stage' require 'backup/move_logs' require 'backup/remove_orphans' -require 'backup/remove_old' +require 'backup/remove_specified' # main travis-backup class class Backup @@ -42,7 +42,7 @@ def run(args={}) elsif @config.remove_orphans Backup::RemoveOrphans.new(@config, @dry_run_reporter).run else - Backup::RemoveOld.new(@config, @dry_run_reporter).run(args) + Backup::RemoveSpecified.new(@config, @dry_run_reporter).run(args) end @dry_run_reporter.print_report if @config.dry_run diff --git a/spec/backup/remove_old_spec.rb b/spec/backup/remove_specified_spec.rb similarity index 81% rename from spec/backup/remove_old_spec.rb rename to spec/backup/remove_specified_spec.rb index 8f56683..c406889 100644 --- a/spec/backup/remove_old_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -12,7 +12,7 @@ require 'pry' -describe Backup::RemoveOld do +describe Backup::RemoveSpecified do before(:all) do BeforeTests.new.run end @@ -20,22 +20,21 @@ let(:files_location) { "dump/tests" } let!(:config) { Config.new(files_location: files_location, limit: 5) } let!(:db_helper) { DbHelper.new(config) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - describe 'process_repo' do let!(:repository) { FactoryBot.create(:repository) } it 'processes repository builds' do - expect(remove_old).to receive(:process_repo_builds).once.with(repository) - remove_old.process_repo(repository) + expect(remove_specified).to receive(:process_repo_builds).once.with(repository) + remove_specified.process_repo(repository) end it 'processes repository requests' do - expect(remove_old).to receive(:process_repo_requests).once.with(repository) - remove_old.process_repo(repository) + expect(remove_specified).to receive(:process_repo_requests).once.with(repository) + remove_specified.process_repo(repository) end end @@ -87,13 +86,13 @@ shared_context 'removing builds and jobs' do it 'should delete all builds of the repository' do - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) expect(Build.all.map(&:repository_id)).to eq([repository2.id]) end it 'should delete all jobs of removed builds and leave the rest' do expect { - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) }.to change { Job.all.size }.by -4 build_id = Build.first.id @@ -102,7 +101,7 @@ it 'should delete all logs of removed jobs and leave the rest' do expect { - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) }.to change { Log.all.size }.by -8 build_id = Build.first.id @@ -113,7 +112,7 @@ shared_context 'not saving JSON to file' do it 'should not save JSON to file' do expect(File).not_to receive(:open) - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end @@ -125,7 +124,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end @@ -139,7 +138,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end @@ -155,7 +154,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end @@ -174,7 +173,7 @@ match_mode: :match, arguments_to_check: :first ) do - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end @@ -183,19 +182,19 @@ context 'when path with nonexistent folders is given' do let(:random_files_location) { "dump/tests/#{rand(100000)}" } let!(:config) { Config.new(files_location: random_files_location, limit: 2) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it 'should create needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) end end end context 'when if_backup config is set to false' do let!(:config) { Config.new(files_location: files_location, limit: 2, if_backup: false) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving JSON to file' it_behaves_like 'removing builds and jobs' @@ -203,19 +202,19 @@ context 'when dry_run config is set to true' do let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving JSON to file' it 'should not delete builds' do expect { - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) }.not_to change { Build.all.size } end it 'should not delete jobs' do expect { - remove_old.process_repo_builds(repository) + remove_specified.process_repo_builds(repository) }.not_to change { Job.all.size } end end @@ -243,15 +242,13 @@ requests_count: 1 ) } - - let!(:expected_requests_json) { ExpectedFiles.new(repository, datetime).requests_json } shared_context 'removing requests' do it 'should delete all requests of the repository' do - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) expect(Request.all.map(&:repository_id)).to eq([repository2.id]) end end @@ -259,19 +256,19 @@ shared_context 'not saving JSON to file' do it 'should not save JSON to file' do expect(File).not_to receive(:open) - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) end end context 'when if_backup config is set to true' do it 'should save proper build JSON to file' do expect_any_instance_of(File).to receive(:write).once.with(JSON.pretty_generate(expected_requests_json)) - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) end it 'should save JSON to file at proper path' do expect(File).to receive(:open).once.with(Regexp.new(files_location), 'w') - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) end it_behaves_like 'removing requests' @@ -279,18 +276,18 @@ context 'when path with nonexistent folders is given' do let(:random_files_location) { "dump/tests/#{rand(100000)}" } let!(:config) { Config.new(files_location: random_files_location, limit: 2) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it 'should create needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) end end end context 'when if_backup config is set to false' do let!(:config) { Config.new(files_location: files_location, limit: 2, if_backup: false) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving JSON to file' it_behaves_like 'removing requests' @@ -298,13 +295,13 @@ context 'when dry_run config is set to true' do let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } - let!(:remove_old) { Backup::RemoveOld.new(config, DryRunReporter.new) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving JSON to file' it 'should not delete requests' do expect { - remove_old.process_repo_requests(repository) + remove_specified.process_repo_requests(repository) }.not_to change { Request.all.size } end end diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index b52c010..f0df059 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -49,7 +49,7 @@ context 'when no id arguments are given' do it 'processes every repository' do Repository.all.each do |repository| - expect_any_instance_of(Backup::RemoveOld).to receive(:process_repo_builds).once.with(repository) + expect_any_instance_of(Backup::RemoveSpecified).to receive(:process_repo_builds).once.with(repository) end backup.run end @@ -60,7 +60,7 @@ user_repos = Repository.where('owner_id = ? and owner_type = ?', user1.id, 'User') expect_method_calls_on( - Backup::RemoveOld, + Backup::RemoveSpecified, :process_repo_builds, user_repos, allow_instances: true, @@ -76,7 +76,7 @@ org_repos = Repository.where('owner_id = ? and owner_type = ?', organization1.id, 'Organization') expect_method_calls_on( - Backup::RemoveOld, + Backup::RemoveSpecified, :process_repo_builds, org_repos, allow_instances: true, @@ -90,27 +90,52 @@ context 'when repo_id is given' do it 'processes only the repository with the given id' do repo = Repository.first - expect_any_instance_of(Backup::RemoveOld).to receive(:process_repo_builds).once.with(repo) + expect_any_instance_of(Backup::RemoveSpecified).to receive(:process_repo_builds).once.with(repo) backup.run(repo_id: repo.id) end end context 'when threshold is not given' do context 'when user_id is given' do - it 'removes the user with all dependencies' do - + let!(:backup) { Backup.new( + files_location: files_location, + limit: 5, + threshold: false, + user_id: user1.id + ) } + it 'removes the user with all dependencies' do + expect_any_instance_of(Backup::RemoveSpecified) + .to receive(:remove_user_with_dependencies).once.with(user1.id) + backup.run(user_id: user1.id) end end - + context 'when org_id is given' do + let!(:backup) { Backup.new( + files_location: files_location, + limit: 5, + threshold: false, + org_id: user1.id + ) } it 'removes the organisation with all dependencies' do - + expect_any_instance_of(Backup::RemoveSpecified) + .to receive(:remove_org_with_dependencies).once.with(organization1.id) + backup.run(org_id: organization1.id) end end - + context 'when repo_id is given' do + let!(:backup) { Backup.new( + files_location: files_location, + limit: 5, + threshold: false, + repo_id: user1.id + ) } it 'removes the repo with all dependencies' do - + repo = Repository.first + expect_any_instance_of(Backup::RemoveSpecified) + .to receive(:remove_repo_with_dependencies).once.with(repo.id) + backup.run(repo_id: repo.id) end end end From adf10b2f51b55f088fc3f1d8e6eee3cb7fc0da84 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 23 Sep 2021 00:59:11 +0200 Subject: [PATCH 03/88] factories separated and removing methods wip --- lib/backup/remove_specified.rb | 8 + spec/backup/remove_specified_spec.rb | 27 +- spec/support/factories.rb | 393 +------------------------ spec/support/factories/branch.rb | 21 ++ spec/support/factories/build.rb | 96 ++++++ spec/support/factories/commit.rb | 31 ++ spec/support/factories/cron.rb | 16 + spec/support/factories/job.rb | 50 ++++ spec/support/factories/log.rb | 13 + spec/support/factories/organization.rb | 21 ++ spec/support/factories/pull_request.rb | 15 + spec/support/factories/repository.rb | 68 +++++ spec/support/factories/request.rb | 39 +++ spec/support/factories/ssl_key.rb | 15 + spec/support/factories/stage.rb | 15 + spec/support/factories/tag.rb | 23 ++ spec/support/factories/user.rb | 21 ++ 17 files changed, 485 insertions(+), 387 deletions(-) create mode 100644 spec/support/factories/branch.rb create mode 100644 spec/support/factories/build.rb create mode 100644 spec/support/factories/commit.rb create mode 100644 spec/support/factories/cron.rb create mode 100644 spec/support/factories/job.rb create mode 100644 spec/support/factories/log.rb create mode 100644 spec/support/factories/organization.rb create mode 100644 spec/support/factories/pull_request.rb create mode 100644 spec/support/factories/repository.rb create mode 100644 spec/support/factories/request.rb create mode 100644 spec/support/factories/ssl_key.rb create mode 100644 spec/support/factories/stage.rb create mode 100644 spec/support/factories/tag.rb create mode 100644 spec/support/factories/user.rb diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 655c0ad..3b0afaf 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -59,6 +59,14 @@ def process_repo_with_id(repo_id) end end + def remove_user_with_dependencies(user_id) + + end + + def remove_org_with_dependencies(org_id) + + end + def remove_repo_with_dependencies(repo_id) end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index c406889..72e91ba 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -48,14 +48,13 @@ let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } let!(:repository) { - ActiveRecord::Base.connection.execute('set session_replication_role = replica;') - repository = FactoryBot.create( - :repository_with_builds_jobs_and_logs, - created_at: datetime, - updated_at: datetime - ) - ActiveRecord::Base.connection.execute('set session_replication_role = default;') - repository + db_helper.do_without_triggers do + FactoryBot.create( + :repository_with_builds_jobs_and_logs, + created_at: datetime, + updated_at: datetime + ) + end } let!(:repository2) { FactoryBot.create( @@ -306,4 +305,16 @@ end end end + + describe 'remove_user_with_dependencies' do + + end + + describe 'remove_org_with_dependencies' do + + end + + describe 'remove_repo_with_dependencies' do + + end end diff --git a/spec/support/factories.rb b/spec/support/factories.rb index cf345f6..2e9f9b0 100644 --- a/spec/support/factories.rb +++ b/spec/support/factories.rb @@ -1,379 +1,14 @@ -# frozen_string_literal: true - -require 'factory_bot' - -FactoryBot.define do - factory :organization do - factory :organization_with_repos do - transient do - repos_count { 3 } - end - after(:create) do |organization, evaluator| - create_list( - :repository_with_builds_jobs_and_logs, - evaluator.repos_count, - owner_id: organization.id, - owner_type: 'Organization' - ) - end - end - end - - factory :user do - factory :user_with_repos do - transient do - repos_count { 3 } - end - after(:create) do |user, evaluator| - create_list( - :repository_with_builds_jobs_and_logs, - evaluator.repos_count, - owner_id: user.id, - owner_type: 'User' - ) - end - end - end - - factory :repository do - factory :repository_with_builds_jobs_and_logs do - transient do - builds_count { 2 } - end - after(:create) do |repository, evaluator| - create_list( - :build_with_jobs_and_logs, - evaluator.builds_count, - repository: repository, - created_at: repository.created_at, - updated_at: repository.updated_at - ) - end - end - - factory :repository_with_builds do - transient do - builds_count { 2 } - end - after(:create) do |repository, evaluator| - create_list( - :build, - evaluator.builds_count, - repository: repository, - created_at: repository.created_at, - updated_at: repository.updated_at - ) - end - end - - factory :repository_orphaned_on_current_build_id do - current_build_id { 2_000_000_000 } - end - - factory :repository_with_current_build_id do - current_build_id { Build.first.id } - end - - factory :repository_orphaned_on_last_build_id do - last_build_id { 2_000_000_000 } - end - - factory :repository_with_last_build_id do - last_build_id { Build.first.id } - end - - factory :repository_with_requests do - transient do - requests_count { 2 } - end - after(:create) do |repository, evaluator| - create_list( - :request, - evaluator.requests_count, - repository: repository, - created_at: repository.created_at, - updated_at: repository.updated_at - ) - end - end - end - - factory :build do - factory :build_with_jobs_and_logs do - transient do - jobs_count { 2 } - end - after(:create) do |build, evaluator| - create_list( - :job_with_logs, - evaluator.jobs_count, - repository: build.repository, - source_type: 'Build', - source_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - end - end - - factory :build_with_repo do - after(:create) do |build| - create( - :repository, - current_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - end - - factory :build_orphaned_on_repository_id_with_mutually_related_repo do - repository_id { 2_000_000_000 } - end - end - - factory :build_with_repository_id do - repository_id { Repository.first.id } - end - - factory :build_with_mutually_related_repo do - after(:create) do |build| - repo = create( - :repository, - current_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - build.repository_id = repo.id - build.save! - end - - factory :build_orphaned_on_commit_id_with_mutually_related_repo do - commit_id { 2_000_000_000 } - end - - factory :build_orphaned_on_request_id_with_mutually_related_repo do - request_id { 2_000_000_000 } - end - - factory :build_orphaned_on_pull_request_id_with_mutually_related_repo do - pull_request_id { 2_000_000_000 } - end - - factory :build_orphaned_on_branch_id_with_mutually_related_repo do - branch_id { 2_000_000_000 } - end - - factory :build_orphaned_on_tag_id_with_mutually_related_repo do - tag_id { 2_000_000_000 } - end - end - - factory :build_with_commit_id do - commit_id { Commit.first.id } - end - - factory :build_with_request_id do - request_id { Request.first.id } - end - - factory :build_with_pull_request_id do - pull_request_id { PullRequest.first.id } - end - - factory :build_with_branch_id do - branch_id { Branch.first.id } - end - - factory :build_with_tag_id do - tag_id { Tag.first.id } - end - end - - factory :job do - factory :job_with_logs do - transient do - logs_count { 2 } - end - after(:create) do |job, evaluator| - create_list( - :log, - evaluator.logs_count, - job_id: job.id, - content: 'some log content', - removed_by: nil, - archiving: false, - archive_verified: true, - created_at: job.created_at, - updated_at: job.updated_at - ) - end - end - - factory :job_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :job_with_repository_id do - repository_id { Repository.first.id } - end - - factory :job_orphaned_on_commit_id do - commit_id { 2_000_000_000 } - end - - factory :job_with_commit_id do - commit_id { Commit.first.id } - end - - factory :job_orphaned_on_stage_id do - stage_id { 2_000_000_000 } - end - - factory :job_with_stage_id do - stage_id { Stage.first.id } - end - end - - factory :log do - job_id { 1 } - content { 'some log content' } - removed_by { 1 } - archiving { false } - archive_verified { true } - end - - factory :branch do - name { "branch_#{Time.now.to_f}" } - repository_id { 1 } - factory :branch_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :branch_orphaned_on_last_build_id do - last_build_id { 2_000_000_000 } - end - - factory :branch_with_last_build_id do - last_build_id { Build.first.id } - end - end - - factory :tag do - factory :tag_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :tag_with_repository_id do - repository_id { Repository.first.id } - end - - factory :tag_orphaned_on_last_build_id do - last_build_id { 2_000_000_000 } - end - - factory :tag_with_last_build_id do - last_build_id { Build.first.id } - end - end - - factory :commit do - factory :commit_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :commit_with_repository_id do - repository_id { Repository.first.id } - end - - factory :commit_orphaned_on_branch_id do - branch_id { 2_000_000_000 } - end - - factory :commit_with_branch_id do - branch_id { Branch.first.id } - end - - factory :commit_orphaned_on_tag_id do - tag_id { 2_000_000_000 } - end - - factory :commit_with_tag_id do - tag_id { Tag.first.id } - end - end - - factory :cron do - interval { 'test' } - factory :cron_orphaned_on_branch_id do - branch_id { 2_000_000_000 } - end - - factory :cron_with_branch_id do - branch_id { Branch.first.id } - end - end - - factory :pull_request do - factory :pull_request_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :pull_request_with_repository_id do - repository_id { Repository.first.id } - end - end - - factory :ssl_key do - factory :ssl_key_orphaned_on_repository_id do - repository_id { 2_000_000_000 } - end - - factory :ssl_key_with_repository_id do - repository_id { Repository.first.id } - end - end - - factory :request do - factory :request_orphaned_on_commit_id do - commit_id { 2_000_000_000 } - end - - factory :request_with_commit_id do - commit_id { Commit.first.id } - end - - factory :request_orphaned_on_pull_request_id do - pull_request_id { 2_000_000_000 } - end - - factory :request_with_pull_request_id do - pull_request_id { PullRequest.first.id } - end - - factory :request_orphaned_on_branch_id do - branch_id { 2_000_000_000 } - end - - factory :request_with_branch_id do - branch_id { Branch.first.id } - end - - factory :request_orphaned_on_tag_id do - tag_id { 2_000_000_000 } - end - - factory :request_with_tag_id do - tag_id { Tag.first.id } - end - end - - factory :stage do - factory :stage_orphaned_on_build_id do - build_id { 2_000_000_000 } - end - - factory :stage_with_build_id do - build_id { Build.first.id } - end - end -end +require 'support/factories/branch' +require 'support/factories/build' +require 'support/factories/commit' +require 'support/factories/cron' +require 'support/factories/job' +require 'support/factories/log' +require 'support/factories/organization' +require 'support/factories/pull_request' +require 'support/factories/repository' +require 'support/factories/request' +require 'support/factories/ssl_key' +require 'support/factories/stage' +require 'support/factories/tag' +require 'support/factories/user' diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb new file mode 100644 index 0000000..3bbb594 --- /dev/null +++ b/spec/support/factories/branch.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :branch do + name { "branch_#{Time.now.to_f}" } + repository_id { 1 } + factory :branch_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :branch_orphaned_on_last_build_id do + last_build_id { 2_000_000_000 } + end + + factory :branch_with_last_build_id do + last_build_id { Build.first.id } + end + end +end diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb new file mode 100644 index 0000000..0cc4488 --- /dev/null +++ b/spec/support/factories/build.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :build do + factory :build_with_jobs_and_logs do + transient do + jobs_count { 2 } + end + after(:create) do |build, evaluator| + create_list( + :job_with_logs, + evaluator.jobs_count, + repository: build.repository, + source_type: 'Build', + source_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + end + end + + factory :build_with_repo do + after(:create) do |build| + create( + :repository, + current_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + end + + factory :build_orphaned_on_repository_id_with_mutually_related_repo do + repository_id { 2_000_000_000 } + end + end + + factory :build_with_repository_id do + repository_id { Repository.first.id } + end + + factory :build_with_mutually_related_repo do + after(:create) do |build| + repo = create( + :repository, + current_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + build.repository_id = repo.id + build.save! + end + + factory :build_orphaned_on_commit_id_with_mutually_related_repo do + commit_id { 2_000_000_000 } + end + + factory :build_orphaned_on_request_id_with_mutually_related_repo do + request_id { 2_000_000_000 } + end + + factory :build_orphaned_on_pull_request_id_with_mutually_related_repo do + pull_request_id { 2_000_000_000 } + end + + factory :build_orphaned_on_branch_id_with_mutually_related_repo do + branch_id { 2_000_000_000 } + end + + factory :build_orphaned_on_tag_id_with_mutually_related_repo do + tag_id { 2_000_000_000 } + end + end + + factory :build_with_commit_id do + commit_id { Commit.first.id } + end + + factory :build_with_request_id do + request_id { Request.first.id } + end + + factory :build_with_pull_request_id do + pull_request_id { PullRequest.first.id } + end + + factory :build_with_branch_id do + branch_id { Branch.first.id } + end + + factory :build_with_tag_id do + tag_id { Tag.first.id } + end + end +end diff --git a/spec/support/factories/commit.rb b/spec/support/factories/commit.rb new file mode 100644 index 0000000..23f0db3 --- /dev/null +++ b/spec/support/factories/commit.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :commit do + factory :commit_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :commit_with_repository_id do + repository_id { Repository.first.id } + end + + factory :commit_orphaned_on_branch_id do + branch_id { 2_000_000_000 } + end + + factory :commit_with_branch_id do + branch_id { Branch.first.id } + end + + factory :commit_orphaned_on_tag_id do + tag_id { 2_000_000_000 } + end + + factory :commit_with_tag_id do + tag_id { Tag.first.id } + end + end +end diff --git a/spec/support/factories/cron.rb b/spec/support/factories/cron.rb new file mode 100644 index 0000000..5ecbb71 --- /dev/null +++ b/spec/support/factories/cron.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :cron do + interval { 'test' } + factory :cron_orphaned_on_branch_id do + branch_id { 2_000_000_000 } + end + + factory :cron_with_branch_id do + branch_id { Branch.first.id } + end + end +end diff --git a/spec/support/factories/job.rb b/spec/support/factories/job.rb new file mode 100644 index 0000000..fb3029c --- /dev/null +++ b/spec/support/factories/job.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :job do + factory :job_with_logs do + transient do + logs_count { 2 } + end + after(:create) do |job, evaluator| + create_list( + :log, + evaluator.logs_count, + job_id: job.id, + content: 'some log content', + removed_by: nil, + archiving: false, + archive_verified: true, + created_at: job.created_at, + updated_at: job.updated_at + ) + end + end + + factory :job_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :job_with_repository_id do + repository_id { Repository.first.id } + end + + factory :job_orphaned_on_commit_id do + commit_id { 2_000_000_000 } + end + + factory :job_with_commit_id do + commit_id { Commit.first.id } + end + + factory :job_orphaned_on_stage_id do + stage_id { 2_000_000_000 } + end + + factory :job_with_stage_id do + stage_id { Stage.first.id } + end + end +end diff --git a/spec/support/factories/log.rb b/spec/support/factories/log.rb new file mode 100644 index 0000000..e0c3694 --- /dev/null +++ b/spec/support/factories/log.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :log do + job_id { 1 } + content { 'some log content' } + removed_by { 1 } + archiving { false } + archive_verified { true } + end +end diff --git a/spec/support/factories/organization.rb b/spec/support/factories/organization.rb new file mode 100644 index 0000000..49cc786 --- /dev/null +++ b/spec/support/factories/organization.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :organization do + factory :organization_with_repos do + transient do + repos_count { 3 } + end + after(:create) do |organization, evaluator| + create_list( + :repository_with_builds_jobs_and_logs, + evaluator.repos_count, + owner_id: organization.id, + owner_type: 'Organization' + ) + end + end + end +end diff --git a/spec/support/factories/pull_request.rb b/spec/support/factories/pull_request.rb new file mode 100644 index 0000000..d78d678 --- /dev/null +++ b/spec/support/factories/pull_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :pull_request do + factory :pull_request_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :pull_request_with_repository_id do + repository_id { Repository.first.id } + end + end +end diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb new file mode 100644 index 0000000..3e5f052 --- /dev/null +++ b/spec/support/factories/repository.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :repository do + factory :repository_with_builds_jobs_and_logs do + transient do + builds_count { 2 } + end + after(:create) do |repository, evaluator| + create_list( + :build_with_jobs_and_logs, + evaluator.builds_count, + repository: repository, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + end + end + + factory :repository_with_builds do + transient do + builds_count { 2 } + end + after(:create) do |repository, evaluator| + create_list( + :build, + evaluator.builds_count, + repository: repository, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + end + end + + factory :repository_orphaned_on_current_build_id do + current_build_id { 2_000_000_000 } + end + + factory :repository_with_current_build_id do + current_build_id { Build.first.id } + end + + factory :repository_orphaned_on_last_build_id do + last_build_id { 2_000_000_000 } + end + + factory :repository_with_last_build_id do + last_build_id { Build.first.id } + end + + factory :repository_with_requests do + transient do + requests_count { 2 } + end + after(:create) do |repository, evaluator| + create_list( + :request, + evaluator.requests_count, + repository: repository, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + end + end + end +end diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb new file mode 100644 index 0000000..0e9844e --- /dev/null +++ b/spec/support/factories/request.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :request do + factory :request_orphaned_on_commit_id do + commit_id { 2_000_000_000 } + end + + factory :request_with_commit_id do + commit_id { Commit.first.id } + end + + factory :request_orphaned_on_pull_request_id do + pull_request_id { 2_000_000_000 } + end + + factory :request_with_pull_request_id do + pull_request_id { PullRequest.first.id } + end + + factory :request_orphaned_on_branch_id do + branch_id { 2_000_000_000 } + end + + factory :request_with_branch_id do + branch_id { Branch.first.id } + end + + factory :request_orphaned_on_tag_id do + tag_id { 2_000_000_000 } + end + + factory :request_with_tag_id do + tag_id { Tag.first.id } + end + end +end diff --git a/spec/support/factories/ssl_key.rb b/spec/support/factories/ssl_key.rb new file mode 100644 index 0000000..9bb0124 --- /dev/null +++ b/spec/support/factories/ssl_key.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :ssl_key do + factory :ssl_key_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :ssl_key_with_repository_id do + repository_id { Repository.first.id } + end + end +end diff --git a/spec/support/factories/stage.rb b/spec/support/factories/stage.rb new file mode 100644 index 0000000..3ecff96 --- /dev/null +++ b/spec/support/factories/stage.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :stage do + factory :stage_orphaned_on_build_id do + build_id { 2_000_000_000 } + end + + factory :stage_with_build_id do + build_id { Build.first.id } + end + end +end diff --git a/spec/support/factories/tag.rb b/spec/support/factories/tag.rb new file mode 100644 index 0000000..33c033b --- /dev/null +++ b/spec/support/factories/tag.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :tag do + factory :tag_orphaned_on_repository_id do + repository_id { 2_000_000_000 } + end + + factory :tag_with_repository_id do + repository_id { Repository.first.id } + end + + factory :tag_orphaned_on_last_build_id do + last_build_id { 2_000_000_000 } + end + + factory :tag_with_last_build_id do + last_build_id { Build.first.id } + end + end +end diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb new file mode 100644 index 0000000..6965a1c --- /dev/null +++ b/spec/support/factories/user.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :user do + factory :user_with_repos do + transient do + repos_count { 3 } + end + after(:create) do |user, evaluator| + create_list( + :repository_with_builds_jobs_and_logs, + evaluator.repos_count, + owner_id: user.id, + owner_type: 'User' + ) + end + end + end +end From b8fd13d2d8c3ee3aa5b27ae05a6b0969b5636baf Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 24 Sep 2021 22:52:42 +0200 Subject: [PATCH 04/88] factories for user with all dependencies --- lib/models/annotation.rb | 7 ++ lib/models/broadcast.rb | 7 ++ lib/models/invoice.rb | 7 ++ lib/models/message.rb | 7 ++ lib/models/owner_group.rb | 7 ++ lib/models/queueable_job.rb | 7 ++ lib/models/subscription.rb | 7 ++ lib/models/trial.rb | 7 ++ lib/models/trial_allowance.rb | 7 ++ spec/support/factories.rb | 19 ++++ spec/support/factories/branch.rb | 36 +++++++ spec/support/factories/build.rb | 84 ++++++++++++++++ spec/support/factories/commit.rb | 23 +++++ spec/support/factories/job.rb | 23 +++++ spec/support/factories/pull_request.rb | 17 ++++ spec/support/factories/repository.rb | 129 +++++++++++++++++++++++++ spec/support/factories/request.rb | 24 +++++ spec/support/factories/subscription.rb | 18 ++++ spec/support/factories/tag.rb | 23 +++++ spec/support/factories/trial.rb | 18 ++++ spec/support/factories/user.rb | 119 +++++++++++++++++++++++ 21 files changed, 596 insertions(+) create mode 100644 lib/models/annotation.rb create mode 100644 lib/models/broadcast.rb create mode 100644 lib/models/invoice.rb create mode 100644 lib/models/message.rb create mode 100644 lib/models/owner_group.rb create mode 100644 lib/models/queueable_job.rb create mode 100644 lib/models/subscription.rb create mode 100644 lib/models/trial.rb create mode 100644 lib/models/trial_allowance.rb create mode 100644 spec/support/factories/subscription.rb create mode 100644 spec/support/factories/trial.rb diff --git a/lib/models/annotation.rb b/lib/models/annotation.rb new file mode 100644 index 0000000..5975561 --- /dev/null +++ b/lib/models/annotation.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Annotation < Model + self.table_name = 'annotations' +end diff --git a/lib/models/broadcast.rb b/lib/models/broadcast.rb new file mode 100644 index 0000000..f7fa7ab --- /dev/null +++ b/lib/models/broadcast.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Broadcast < Model + self.table_name = 'broadcasts' +end diff --git a/lib/models/invoice.rb b/lib/models/invoice.rb new file mode 100644 index 0000000..3e327a9 --- /dev/null +++ b/lib/models/invoice.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Invoice < Model + self.table_name = 'invoices' +end diff --git a/lib/models/message.rb b/lib/models/message.rb new file mode 100644 index 0000000..0be904d --- /dev/null +++ b/lib/models/message.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Message < Model + self.table_name = 'messages' +end diff --git a/lib/models/owner_group.rb b/lib/models/owner_group.rb new file mode 100644 index 0000000..d615cd6 --- /dev/null +++ b/lib/models/owner_group.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class OwnerGroup < Model + self.table_name = 'owner_groups' +end diff --git a/lib/models/queueable_job.rb b/lib/models/queueable_job.rb new file mode 100644 index 0000000..7310142 --- /dev/null +++ b/lib/models/queueable_job.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class QueueableJob < Model + self.table_name = 'queueable_jobs' +end diff --git a/lib/models/subscription.rb b/lib/models/subscription.rb new file mode 100644 index 0000000..54db3b3 --- /dev/null +++ b/lib/models/subscription.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Subscription < Model + self.table_name = 'subscriptions' +end diff --git a/lib/models/trial.rb b/lib/models/trial.rb new file mode 100644 index 0000000..1edb894 --- /dev/null +++ b/lib/models/trial.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class Trial < Model + self.table_name = 'trials' +end diff --git a/lib/models/trial_allowance.rb b/lib/models/trial_allowance.rb new file mode 100644 index 0000000..00dc5ee --- /dev/null +++ b/lib/models/trial_allowance.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'models/model' + +class TrialAllowance < Model + self.table_name = 'trial_allowances' +end diff --git a/spec/support/factories.rb b/spec/support/factories.rb index 2e9f9b0..d60ec8b 100644 --- a/spec/support/factories.rb +++ b/spec/support/factories.rb @@ -12,3 +12,22 @@ require 'support/factories/stage' require 'support/factories/tag' require 'support/factories/user' + +FactoryBot.define do + factory :email + factory :token + factory :star + factory :membership + factory :user_beta_feature + factory :permission + factory :trial + factory :trial_allowance + factory :broadcast + factory :subscription + factory :invoice + factory :owner_group + factory :message + factory :abuse + factory :annotation + factory :queueable_job +end \ No newline at end of file diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb index 3bbb594..7fb727e 100644 --- a/spec/support/factories/branch.rb +++ b/spec/support/factories/branch.rb @@ -17,5 +17,41 @@ factory :branch_with_last_build_id do last_build_id { Build.first.id } end + + factory :branch_with_all_dependencies do + after(:create) do |branch| + create_list( + :build_with_safe_dependencies, 2, + branch_id: branch.id, + created_at: branch.created_at, + updated_at: branch.updated_at + ) + create_list( + :cron, 2, + branch_id: branch.id, + created_at: branch.created_at, + updated_at: branch.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + source_id: branch.id, + source_type: 'Branch', + created_at: branch.created_at, + updated_at: branch.updated_at + ) + create_list( + :commit_with_all_dependencies, 2, + branch_id: branch.id, + created_at: branch.created_at, + updated_at: branch.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + branch_id: branch.id, + created_at: branch.created_at, + updated_at: branch.updated_at + ) + end + end end end diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 0cc4488..f427496 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -92,5 +92,89 @@ factory :build_with_tag_id do tag_id { Tag.first.id } end + + factory :build_with_all_dependencies do + after(:create) do |build| + create_list( + :tag_with_all_dependencies, 2, + build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :stage_with_jobs, 2, + build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + source_type: 'Build', + source_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :branch_with_all_dependencies, 2, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :repository_with_safe_dependencies, 2, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :repository_with_safe_dependencies, 2, + current_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + end + end + + factory :build_with_safe_dependencies do + after(:create) do |build| + create_list( + :tag, 2, + build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :stage_with_jobs, 2, + build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + source_type: 'Build', + source_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :branch, 2, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :repository, 2, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create_list( + :repository, 2, + current_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + end + end end end diff --git a/spec/support/factories/commit.rb b/spec/support/factories/commit.rb index 23f0db3..fcb9459 100644 --- a/spec/support/factories/commit.rb +++ b/spec/support/factories/commit.rb @@ -27,5 +27,28 @@ factory :commit_with_tag_id do tag_id { Tag.first.id } end + + factory :commit_with_all_dependencies do + after(:create) do |commit| + create_list( + :build_with_safe_dependencies, 2, + commit_id: commit.id, + created_at: commit.created_at, + updated_at: commit.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + commit_id: commit.id, + created_at: commit.created_at, + updated_at: commit.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + commit_id: commit.id, + created_at: commit.created_at, + updated_at: commit.updated_at + ) + end + end end end diff --git a/spec/support/factories/job.rb b/spec/support/factories/job.rb index fb3029c..9bd2d1d 100644 --- a/spec/support/factories/job.rb +++ b/spec/support/factories/job.rb @@ -46,5 +46,28 @@ factory :job_with_stage_id do stage_id { Stage.first.id } end + + factory :job_with_all_dependencies do + after(:create) do |job| + create_list( + :annotation, 2, + job_id: job.id, + created_at: job.created_at, + updated_at: job.updated_at + ) + create_list( + :queueable_job, 2, + job_id: job.id, + created_at: job.created_at, + updated_at: job.updated_at + ) + create_list( + :log, 2, + job_id: job.id, + created_at: job.created_at, + updated_at: job.updated_at + ) + end + end end end diff --git a/spec/support/factories/pull_request.rb b/spec/support/factories/pull_request.rb index d78d678..1c8094c 100644 --- a/spec/support/factories/pull_request.rb +++ b/spec/support/factories/pull_request.rb @@ -11,5 +11,22 @@ factory :pull_request_with_repository_id do repository_id { Repository.first.id } end + + factory :pull_request_with_all_dependencies do + after(:create) do |pull_request| + create_list( + :build_with_all_dependencies, 2, + pull_request_id: pull_request.id, + created_at: pull_request.created_at, + updated_at: pull_request.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + pull_request_id: pull_request.id, + created_at: pull_request.created_at, + updated_at: pull_request.updated_at + ) + end + end end end diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index 3e5f052..dc1522a 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -64,5 +64,134 @@ ) end end + + factory :repository_with_all_dependencies do + after(:create) do |repository| + create_list( + :build_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :branch_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :commit_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :ssl_key, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :permission, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :star, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :pull_request_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :tag_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + end + end + factory :repository_with_safe_dependencies do + after(:create) do |repository| + create_list( + :build, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :request, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :branch, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :commit, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :ssl_key, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :permission, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :star, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :pull_request, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create_list( + :tag, 2, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + end + end end end diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb index 0e9844e..1f5a9db 100644 --- a/spec/support/factories/request.rb +++ b/spec/support/factories/request.rb @@ -35,5 +35,29 @@ factory :request_with_tag_id do tag_id { Tag.first.id } end + + factory :request_with_all_dependencies do + after(:create) do |request| + create_list( + :abuse, 2, + request_id: request.id, + created_at: request.created_at, + updated_at: request.updated_at + ) + create_list( + :message, 2, + subject_id: request.id, + subject_type: 'Request', + created_at: request.created_at, + updated_at: request.updated_at + ) + create_list( + :build_with_safe_dependencies, 2, + request_id: request.id, + created_at: request.created_at, + updated_at: request.updated_at + ) + end + end end end diff --git a/spec/support/factories/subscription.rb b/spec/support/factories/subscription.rb new file mode 100644 index 0000000..321d84f --- /dev/null +++ b/spec/support/factories/subscription.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :subscription do + factory :subscription_with_invoices do + after(:create) do |subscription| + create_list( + :invoice, 2, + subscription_id: tag.id, + created_at: tag.created_at, + updated_at: tag.updated_at + ) + end + end + end +end diff --git a/spec/support/factories/tag.rb b/spec/support/factories/tag.rb index 33c033b..013c038 100644 --- a/spec/support/factories/tag.rb +++ b/spec/support/factories/tag.rb @@ -19,5 +19,28 @@ factory :tag_with_last_build_id do last_build_id { Build.first.id } end + + factory :tag_with_all_dependencies do + after(:create) do |tag| + create_list( + :build_with_safe_dependencies, 2, + tag_id: tag.id, + created_at: tag.created_at, + updated_at: tag.updated_at + ) + create_list( + :commit_with_all_dependencies, 2, + tag_id: tag.id, + created_at: tag.created_at, + updated_at: tag.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + tag_id: tag.id, + created_at: tag.created_at, + updated_at: tag.updated_at + ) + end + end end end diff --git a/spec/support/factories/trial.rb b/spec/support/factories/trial.rb new file mode 100644 index 0000000..09e3a28 --- /dev/null +++ b/spec/support/factories/trial.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'factory_bot' + +FactoryBot.define do + factory :trial do + factory :trial_with_allowances do + after(:create) do |trial| + create_list( + :trial_allowance, 2, + trial_id: trial.id, + created_at: trial.created_at, + updated_at: trial.updated_at + ) + end + end + end +end diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index 6965a1c..73f7291 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -17,5 +17,124 @@ ) end end + + factory :user_with_all_dependencies do + after(:create) do |user| + create_list(:email, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(:token, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(:star, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(:membership, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(:user_beta_feature, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(:permission, 3, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list(## + :repository_with_all_dependencies, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :build_with_all_dependencies, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :build_with_all_dependencies, 2, + sender_id: user.id, + sender_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + sender_id: user.id, + sender_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :request_with_all_dependencies, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :job_with_all_dependencies, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :subscription_with_invoices, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :trial_with_allowances, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :trial_allowance, 2, + creator_id: user.id, + creator_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :owner_group, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :broadcast, 2, + recipient_id: user.id, + recipient_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :abuse, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + end + end end end From 92fb92ecce82d61730f51f5c35d822da8dca849c Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Sat, 25 Sep 2021 22:19:42 +0200 Subject: [PATCH 05/88] wip --- spec/backup/remove_specified_spec.rb | 14 +++++++-- spec/support/factories.rb | 35 ++++++++++----------- spec/support/factories/abuse.rb | 11 +++++++ spec/support/factories/annotation.rb | 11 +++++++ spec/support/factories/broadcast.rb | 8 +++++ spec/support/factories/build.rb | 4 +-- spec/support/factories/email.rb | 8 +++++ spec/support/factories/invoice.rb | 8 +++++ spec/support/factories/job.rb | 4 +-- spec/support/factories/membership.rb | 8 +++++ spec/support/factories/message.rb | 8 +++++ spec/support/factories/owner_group.rb | 8 +++++ spec/support/factories/permission.rb | 8 +++++ spec/support/factories/queueable_job.rb | 8 +++++ spec/support/factories/repository.rb | 8 ++--- spec/support/factories/stage.rb | 15 +++++++++ spec/support/factories/star.rb | 8 +++++ spec/support/factories/subscription.rb | 6 ++-- spec/support/factories/token.rb | 8 +++++ spec/support/factories/trial_allowance.rb | 8 +++++ spec/support/factories/user.rb | 9 ++---- spec/support/factories/user_beta_feature.rb | 8 +++++ 22 files changed, 170 insertions(+), 43 deletions(-) create mode 100644 spec/support/factories/abuse.rb create mode 100644 spec/support/factories/annotation.rb create mode 100644 spec/support/factories/broadcast.rb create mode 100644 spec/support/factories/email.rb create mode 100644 spec/support/factories/invoice.rb create mode 100644 spec/support/factories/membership.rb create mode 100644 spec/support/factories/message.rb create mode 100644 spec/support/factories/owner_group.rb create mode 100644 spec/support/factories/permission.rb create mode 100644 spec/support/factories/queueable_job.rb create mode 100644 spec/support/factories/star.rb create mode 100644 spec/support/factories/token.rb create mode 100644 spec/support/factories/trial_allowance.rb create mode 100644 spec/support/factories/user_beta_feature.rb diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 72e91ba..2f351f5 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -21,6 +21,7 @@ let!(:config) { Config.new(files_location: files_location, limit: 5) } let!(:db_helper) { DbHelper.new(config) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } describe 'process_repo' do let!(:repository) { @@ -46,7 +47,6 @@ Log.destroy_all end - let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } let!(:repository) { db_helper.do_without_triggers do FactoryBot.create( @@ -225,7 +225,6 @@ Request.destroy_all end - let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } let!(:repository) { FactoryBot.create( :repository_with_requests, @@ -307,7 +306,16 @@ end describe 'remove_user_with_dependencies' do - + let!(:user) { + FactoryBot.create( + :user_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + } + it do + expect(true).not_to be(false) + end end describe 'remove_org_with_dependencies' do diff --git a/spec/support/factories.rb b/spec/support/factories.rb index d60ec8b..2f3485e 100644 --- a/spec/support/factories.rb +++ b/spec/support/factories.rb @@ -12,22 +12,19 @@ require 'support/factories/stage' require 'support/factories/tag' require 'support/factories/user' - -FactoryBot.define do - factory :email - factory :token - factory :star - factory :membership - factory :user_beta_feature - factory :permission - factory :trial - factory :trial_allowance - factory :broadcast - factory :subscription - factory :invoice - factory :owner_group - factory :message - factory :abuse - factory :annotation - factory :queueable_job -end \ No newline at end of file +require 'support/factories/email' +require 'support/factories/token' +require 'support/factories/star' +require 'support/factories/membership' +require 'support/factories/user_beta_feature' +require 'support/factories/permission' +require 'support/factories/trial' +require 'support/factories/trial_allowance' +require 'support/factories/broadcast' +require 'support/factories/subscription' +require 'support/factories/invoice' +require 'support/factories/owner_group' +require 'support/factories/message' +require 'support/factories/abuse' +require 'support/factories/annotation' +require 'support/factories/queueable_job' diff --git a/spec/support/factories/abuse.rb b/spec/support/factories/abuse.rb new file mode 100644 index 0000000..fff6e58 --- /dev/null +++ b/spec/support/factories/abuse.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'models/abuse' +require 'factory_bot' + +FactoryBot.define do + factory :abuse do + level { 0 } + reason { 'some text' } + end +end diff --git a/spec/support/factories/annotation.rb b/spec/support/factories/annotation.rb new file mode 100644 index 0000000..1636be8 --- /dev/null +++ b/spec/support/factories/annotation.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'models/annotation' +require 'factory_bot' + +FactoryBot.define do + factory :annotation do + description { 'some text' } + annotation_provider_id { 0 } + end +end diff --git a/spec/support/factories/broadcast.rb b/spec/support/factories/broadcast.rb new file mode 100644 index 0000000..02c0fbb --- /dev/null +++ b/spec/support/factories/broadcast.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/broadcast' +require 'factory_bot' + +FactoryBot.define do + factory :broadcast +end diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index f427496..1d4fe3c 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -97,7 +97,7 @@ after(:create) do |build| create_list( :tag_with_all_dependencies, 2, - build_id: build.id, + last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) @@ -139,7 +139,7 @@ after(:create) do |build| create_list( :tag, 2, - build_id: build.id, + last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) diff --git a/spec/support/factories/email.rb b/spec/support/factories/email.rb new file mode 100644 index 0000000..b47722d --- /dev/null +++ b/spec/support/factories/email.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/email' +require 'factory_bot' + +FactoryBot.define do + factory :email +end diff --git a/spec/support/factories/invoice.rb b/spec/support/factories/invoice.rb new file mode 100644 index 0000000..19960ec --- /dev/null +++ b/spec/support/factories/invoice.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/invoice' +require 'factory_bot' + +FactoryBot.define do + factory :invoice +end diff --git a/spec/support/factories/job.rb b/spec/support/factories/job.rb index 9bd2d1d..c1447d4 100644 --- a/spec/support/factories/job.rb +++ b/spec/support/factories/job.rb @@ -57,9 +57,7 @@ ) create_list( :queueable_job, 2, - job_id: job.id, - created_at: job.created_at, - updated_at: job.updated_at + job_id: job.id ) create_list( :log, 2, diff --git a/spec/support/factories/membership.rb b/spec/support/factories/membership.rb new file mode 100644 index 0000000..5c1e7d4 --- /dev/null +++ b/spec/support/factories/membership.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/membership' +require 'factory_bot' + +FactoryBot.define do + factory :membership +end diff --git a/spec/support/factories/message.rb b/spec/support/factories/message.rb new file mode 100644 index 0000000..5404b97 --- /dev/null +++ b/spec/support/factories/message.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/message' +require 'factory_bot' + +FactoryBot.define do + factory :message +end diff --git a/spec/support/factories/owner_group.rb b/spec/support/factories/owner_group.rb new file mode 100644 index 0000000..fb51e17 --- /dev/null +++ b/spec/support/factories/owner_group.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/owner_group' +require 'factory_bot' + +FactoryBot.define do + factory :owner_group +end diff --git a/spec/support/factories/permission.rb b/spec/support/factories/permission.rb new file mode 100644 index 0000000..ea0bc52 --- /dev/null +++ b/spec/support/factories/permission.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/permission' +require 'factory_bot' + +FactoryBot.define do + factory :permission +end diff --git a/spec/support/factories/queueable_job.rb b/spec/support/factories/queueable_job.rb new file mode 100644 index 0000000..6c3b5c4 --- /dev/null +++ b/spec/support/factories/queueable_job.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/queueable_job' +require 'factory_bot' + +FactoryBot.define do + factory :queueable_job +end diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index dc1522a..0cf6673 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -105,9 +105,7 @@ ) create_list( :permission, 2, - repository_id: repository.id, - created_at: repository.created_at, - updated_at: repository.updated_at + repository_id: repository.id ) create_list( :star, 2, @@ -169,9 +167,7 @@ ) create_list( :permission, 2, - repository_id: repository.id, - created_at: repository.created_at, - updated_at: repository.updated_at + repository_id: repository.id ) create_list( :star, 2, diff --git a/spec/support/factories/stage.rb b/spec/support/factories/stage.rb index 3ecff96..504f9cf 100644 --- a/spec/support/factories/stage.rb +++ b/spec/support/factories/stage.rb @@ -11,5 +11,20 @@ factory :stage_with_build_id do build_id { Build.first.id } end + + factory :stage_with_jobs do + transient do + created_at { nil } + updated_at { nil } + end + after(:create) do |stage, evaluator| + create_list( + :job, 2, + stage_id: stage.id, + created_at: evaluator.created_at, + updated_at: evaluator.updated_at + ) + end + end end end diff --git a/spec/support/factories/star.rb b/spec/support/factories/star.rb new file mode 100644 index 0000000..0257442 --- /dev/null +++ b/spec/support/factories/star.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/star' +require 'factory_bot' + +FactoryBot.define do + factory :star +end diff --git a/spec/support/factories/subscription.rb b/spec/support/factories/subscription.rb index 321d84f..da291f7 100644 --- a/spec/support/factories/subscription.rb +++ b/spec/support/factories/subscription.rb @@ -8,9 +8,9 @@ after(:create) do |subscription| create_list( :invoice, 2, - subscription_id: tag.id, - created_at: tag.created_at, - updated_at: tag.updated_at + subscription_id: subscription.id, + created_at: subscription.created_at, + updated_at: subscription.updated_at ) end end diff --git a/spec/support/factories/token.rb b/spec/support/factories/token.rb new file mode 100644 index 0000000..2528514 --- /dev/null +++ b/spec/support/factories/token.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/token' +require 'factory_bot' + +FactoryBot.define do + factory :token +end diff --git a/spec/support/factories/trial_allowance.rb b/spec/support/factories/trial_allowance.rb new file mode 100644 index 0000000..541ea31 --- /dev/null +++ b/spec/support/factories/trial_allowance.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/trial_allowance' +require 'factory_bot' + +FactoryBot.define do + factory :trial_allowance +end diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index 73f7291..67fe8ec 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'factory_bot' +require 'models/user' FactoryBot.define do factory :user do @@ -37,20 +38,14 @@ ) create_list(:membership, 3, user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at ) create_list(:user_beta_feature, 3, user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at ) create_list(:permission, 3, user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at ) - create_list(## + create_list( :repository_with_all_dependencies, 2, owner_id: user.id, owner_type: 'User', diff --git a/spec/support/factories/user_beta_feature.rb b/spec/support/factories/user_beta_feature.rb new file mode 100644 index 0000000..dddd00d --- /dev/null +++ b/spec/support/factories/user_beta_feature.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'models/user_beta_feature' +require 'factory_bot' + +FactoryBot.define do + factory :user_beta_feature +end From 43b8545a746b4b7397ea04cce4128245d5c088a2 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 27 Sep 2021 11:09:59 +0200 Subject: [PATCH 06/88] working user_with_all_dependencies factory --- spec/support/factories/abuse.rb | 2 +- spec/support/factories/branch.rb | 1 + spec/support/factories/build.rb | 1 + spec/support/factories/commit.rb | 1 + spec/support/factories/cron.rb | 1 + spec/support/factories/job.rb | 1 + spec/support/factories/log.rb | 1 + spec/support/factories/organization.rb | 1 + spec/support/factories/pull_request.rb | 1 + spec/support/factories/repository.rb | 1 + spec/support/factories/request.rb | 1 + spec/support/factories/ssl_key.rb | 1 + spec/support/factories/stage.rb | 1 + spec/support/factories/subscription.rb | 1 + spec/support/factories/tag.rb | 1 + spec/support/factories/trial.rb | 1 + spec/support/factories/user.rb | 2 +- 17 files changed, 17 insertions(+), 2 deletions(-) diff --git a/spec/support/factories/abuse.rb b/spec/support/factories/abuse.rb index fff6e58..4c24718 100644 --- a/spec/support/factories/abuse.rb +++ b/spec/support/factories/abuse.rb @@ -5,7 +5,7 @@ FactoryBot.define do factory :abuse do - level { 0 } + sequence(:level) { |n| n } reason { 'some text' } end end diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb index 7fb727e..03d6b22 100644 --- a/spec/support/factories/branch.rb +++ b/spec/support/factories/branch.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/branch' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 1d4fe3c..c2bba00 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/build' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/commit.rb b/spec/support/factories/commit.rb index fcb9459..600bcc0 100644 --- a/spec/support/factories/commit.rb +++ b/spec/support/factories/commit.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/build' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/cron.rb b/spec/support/factories/cron.rb index 5ecbb71..cf03306 100644 --- a/spec/support/factories/cron.rb +++ b/spec/support/factories/cron.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/cron' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/job.rb b/spec/support/factories/job.rb index c1447d4..139697c 100644 --- a/spec/support/factories/job.rb +++ b/spec/support/factories/job.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/job' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/log.rb b/spec/support/factories/log.rb index e0c3694..4ba7830 100644 --- a/spec/support/factories/log.rb +++ b/spec/support/factories/log.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/log' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/organization.rb b/spec/support/factories/organization.rb index 49cc786..1624f5b 100644 --- a/spec/support/factories/organization.rb +++ b/spec/support/factories/organization.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/organization' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/pull_request.rb b/spec/support/factories/pull_request.rb index 1c8094c..47b8cd5 100644 --- a/spec/support/factories/pull_request.rb +++ b/spec/support/factories/pull_request.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/pull_request' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index 0cf6673..19fb4f9 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/repository' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb index 1f5a9db..0a2b3ee 100644 --- a/spec/support/factories/request.rb +++ b/spec/support/factories/request.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/request' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/ssl_key.rb b/spec/support/factories/ssl_key.rb index 9bb0124..dc31b54 100644 --- a/spec/support/factories/ssl_key.rb +++ b/spec/support/factories/ssl_key.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/ssl_key' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/stage.rb b/spec/support/factories/stage.rb index 504f9cf..5014923 100644 --- a/spec/support/factories/stage.rb +++ b/spec/support/factories/stage.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/stage' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/subscription.rb b/spec/support/factories/subscription.rb index da291f7..e17911f 100644 --- a/spec/support/factories/subscription.rb +++ b/spec/support/factories/subscription.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/subscription' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/tag.rb b/spec/support/factories/tag.rb index 013c038..c15b3fc 100644 --- a/spec/support/factories/tag.rb +++ b/spec/support/factories/tag.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/tag' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/trial.rb b/spec/support/factories/trial.rb index 09e3a28..6ebf52b 100644 --- a/spec/support/factories/trial.rb +++ b/spec/support/factories/trial.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'models/trial' require 'factory_bot' FactoryBot.define do diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index 67fe8ec..f866cae 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'factory_bot' require 'models/user' +require 'factory_bot' FactoryBot.define do factory :user do From 8013b52af08d72caa5fb3b9849bfe38154c0a3c0 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 27 Sep 2021 11:27:44 +0200 Subject: [PATCH 07/88] wip --- spec/backup/remove_specified_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 2f351f5..893f04d 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -313,7 +313,11 @@ updated_at: datetime ) } - it do + it 'removes user with all his dependencies' do + Model.subclasses.each do |subclass| + puts subclass.to_s + puts subclass.all.size + end expect(true).not_to be(false) end end From fc2e8c42948230bfa452bc866040f7f94a1de346 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 27 Sep 2021 12:40:10 +0200 Subject: [PATCH 08/88] factories with siblings --- lib/models/model.rb | 3 ++ spec/support/factories/branch.rb | 24 ++++++++++----- spec/support/factories/build.rb | 34 +++++++++++++-------- spec/support/factories/commit.rb | 17 +++++++---- spec/support/factories/job.rb | 5 +++ spec/support/factories/pull_request.rb | 13 +++++--- spec/support/factories/repository.rb | 42 ++++++++++++++++---------- spec/support/factories/request.rb | 9 ++++-- spec/support/factories/tag.rb | 17 +++++++---- spec/support/factories/user.rb | 24 +++++++-------- 10 files changed, 122 insertions(+), 66 deletions(-) diff --git a/lib/models/model.rb b/lib/models/model.rb index 9cc102a..c98e448 100644 --- a/lib/models/model.rb +++ b/lib/models/model.rb @@ -5,4 +5,7 @@ # Model class class Model < ActiveRecord::Base self.abstract_class = true + def attributes_without_id + self.attributes.reject{|k, v| k == "id"} + end end diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb index 03d6b22..ef39667 100644 --- a/spec/support/factories/branch.rb +++ b/spec/support/factories/branch.rb @@ -21,8 +21,8 @@ factory :branch_with_all_dependencies do after(:create) do |branch| - create_list( - :build_with_safe_dependencies, 2, + create( + :build_with_safe_dependencies_and_sibling, branch_id: branch.id, created_at: branch.created_at, updated_at: branch.updated_at @@ -33,26 +33,34 @@ created_at: branch.created_at, updated_at: branch.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, source_id: branch.id, source_type: 'Branch', created_at: branch.created_at, updated_at: branch.updated_at ) - create_list( - :commit_with_all_dependencies, 2, + create( + :commit_with_all_dependencies_and_sibling, branch_id: branch.id, created_at: branch.created_at, updated_at: branch.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, branch_id: branch.id, created_at: branch.created_at, updated_at: branch.updated_at ) end + factory :branch_with_all_dependencies_and_sibling do + after(:create) do |branch| + create(:branch, { + **branch.attributes_without_id.symbolize_keys.reject {|k, v| k == :name}, + name: "branch_#{Time.now.to_f}_2" + }) + end + end end end end diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index c2bba00..62f7cbd 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -96,8 +96,8 @@ factory :build_with_all_dependencies do after(:create) do |build| - create_list( - :tag_with_all_dependencies, 2, + create( + :tag_with_all_dependencies_and_sibling, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at @@ -108,32 +108,37 @@ created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, source_type: 'Build', source_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :branch_with_all_dependencies, 2, + create( + :branch_with_all_dependencies_and_sibling, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :repository_with_safe_dependencies, 2, + create( + :repository_with_safe_dependencies_and_sibling, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :repository_with_safe_dependencies, 2, + create( + :repository_with_safe_dependencies_and_sibling, current_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) end + factory :build_with_all_dependencies_and_sibling do + after(:create) do |build| + create(:build, build.attributes_without_id.symbolize_keys) + end + end end factory :build_with_safe_dependencies do @@ -150,8 +155,8 @@ created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, source_type: 'Build', source_id: build.id, created_at: build.created_at, @@ -176,6 +181,11 @@ updated_at: build.updated_at ) end + factory :build_with_safe_dependencies_and_sibling do + after(:create) do |build| + create(:build, build.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/commit.rb b/spec/support/factories/commit.rb index 600bcc0..e03493a 100644 --- a/spec/support/factories/commit.rb +++ b/spec/support/factories/commit.rb @@ -31,25 +31,30 @@ factory :commit_with_all_dependencies do after(:create) do |commit| - create_list( - :build_with_safe_dependencies, 2, + create( + :build_with_safe_dependencies_and_sibling, commit_id: commit.id, created_at: commit.created_at, updated_at: commit.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, commit_id: commit.id, created_at: commit.created_at, updated_at: commit.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, commit_id: commit.id, created_at: commit.created_at, updated_at: commit.updated_at ) end + factory :commit_with_all_dependencies_and_sibling do + after(:create) do |commit| + create(:commit, commit.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/job.rb b/spec/support/factories/job.rb index 139697c..9616169 100644 --- a/spec/support/factories/job.rb +++ b/spec/support/factories/job.rb @@ -67,6 +67,11 @@ updated_at: job.updated_at ) end + factory :job_with_all_dependencies_and_sibling do + after(:create) do |job| + create(:job, job.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/pull_request.rb b/spec/support/factories/pull_request.rb index 47b8cd5..9dee754 100644 --- a/spec/support/factories/pull_request.rb +++ b/spec/support/factories/pull_request.rb @@ -15,19 +15,24 @@ factory :pull_request_with_all_dependencies do after(:create) do |pull_request| - create_list( - :build_with_all_dependencies, 2, + create( + :build_with_all_dependencies_and_sibling, pull_request_id: pull_request.id, created_at: pull_request.created_at, updated_at: pull_request.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, pull_request_id: pull_request.id, created_at: pull_request.created_at, updated_at: pull_request.updated_at ) end + factory :pull_request_with_all_dependencies_and_sibling do + after(:create) do |pull_request| + create(:pull_request, pull_request.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index 19fb4f9..db36749 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -68,32 +68,32 @@ factory :repository_with_all_dependencies do after(:create) do |repository| - create_list( - :build_with_all_dependencies, 2, + create( + :build_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :branch_with_all_dependencies, 2, + create( + :branch_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :commit_with_all_dependencies, 2, + create( + :commit_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at @@ -114,19 +114,24 @@ created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :pull_request_with_all_dependencies, 2, + create( + :pull_request_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :tag_with_all_dependencies, 2, + create( + :tag_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) end + factory :repository_with_all_dependencies_and_sibling do + after(:create) do |repository| + create(:repository, repository.attributes_without_id.symbolize_keys) + end + end end factory :repository_with_safe_dependencies do after(:create) do |repository| @@ -142,8 +147,8 @@ created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at @@ -189,6 +194,11 @@ updated_at: repository.updated_at ) end + factory :repository_with_safe_dependencies_and_sibling do + after(:create) do |repository| + create(:repository, repository.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb index 0a2b3ee..9d2bde2 100644 --- a/spec/support/factories/request.rb +++ b/spec/support/factories/request.rb @@ -52,13 +52,18 @@ created_at: request.created_at, updated_at: request.updated_at ) - create_list( - :build_with_safe_dependencies, 2, + create( + :build_with_safe_dependencies_and_sibling, request_id: request.id, created_at: request.created_at, updated_at: request.updated_at ) end + factory :request_with_all_dependencies_and_sibling do + after(:create) do |request| + create(:request, request.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/tag.rb b/spec/support/factories/tag.rb index c15b3fc..13ff4cf 100644 --- a/spec/support/factories/tag.rb +++ b/spec/support/factories/tag.rb @@ -23,25 +23,30 @@ factory :tag_with_all_dependencies do after(:create) do |tag| - create_list( - :build_with_safe_dependencies, 2, + create( + :build_with_safe_dependencies_and_sibling, tag_id: tag.id, created_at: tag.created_at, updated_at: tag.updated_at ) - create_list( - :commit_with_all_dependencies, 2, + create( + :commit_with_all_dependencies_and_sibling, tag_id: tag.id, created_at: tag.created_at, updated_at: tag.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, tag_id: tag.id, created_at: tag.created_at, updated_at: tag.updated_at ) end + factory :tag_with_all_dependencies_and_sibling do + after(:create) do |tag| + create(:tag, tag.attributes_without_id.symbolize_keys) + end + end end end end diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index f866cae..f4ebcbb 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -45,43 +45,43 @@ create_list(:permission, 3, user_id: user.id, ) - create_list( - :repository_with_all_dependencies, 2, + create( + :repository_with_all_dependencies_and_sibling, owner_id: user.id, owner_type: 'User', created_at: user.created_at, updated_at: user.updated_at ) - create_list( - :build_with_all_dependencies, 2, + create( + :build_with_all_dependencies_and_sibling, owner_id: user.id, owner_type: 'User', created_at: user.created_at, updated_at: user.updated_at ) - create_list( - :build_with_all_dependencies, 2, + create( + :build_with_all_dependencies_and_sibling, sender_id: user.id, sender_type: 'User', created_at: user.created_at, updated_at: user.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, sender_id: user.id, sender_type: 'User', created_at: user.created_at, updated_at: user.updated_at ) - create_list( - :request_with_all_dependencies, 2, + create( + :request_with_all_dependencies_and_sibling, owner_id: user.id, owner_type: 'User', created_at: user.created_at, updated_at: user.updated_at ) - create_list( - :job_with_all_dependencies, 2, + create( + :job_with_all_dependencies_and_sibling, owner_id: user.id, owner_type: 'User', created_at: user.created_at, From 316a89552523ab1c735fc7123400bd40a960b22f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 27 Sep 2021 13:11:33 +0200 Subject: [PATCH 09/88] lighter factories with safe dependencies --- spec/support/factories/build.rb | 26 +++++++++---------- spec/support/factories/repository.rb | 38 ++++++++++++++-------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 62f7cbd..057bba9 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -143,39 +143,37 @@ factory :build_with_safe_dependencies do after(:create) do |build| - create_list( - :tag, 2, + create( + :tag, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :stage_with_jobs, 2, - build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at + create( + :stage, + build_id: build.id ) create( - :job_with_all_dependencies_and_sibling, + :job, source_type: 'Build', source_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :branch, 2, + create( + :branch, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :repository, 2, + create( + :repository, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at ) - create_list( - :repository, 2, + create( + :repository, current_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index db36749..7eae034 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -135,60 +135,60 @@ end factory :repository_with_safe_dependencies do after(:create) do |repository| - create_list( - :build, 2, + create( + :build, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :request, 2, + create( + :request, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) create( - :job_with_all_dependencies_and_sibling, + :job, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :branch, 2, + create( + :branch, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :commit, 2, + create( + :commit, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :ssl_key, 2, + create( + :ssl_key, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :permission, 2, + create( + :permission, repository_id: repository.id ) - create_list( - :star, 2, + create( + :star, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :pull_request, 2, + create( + :pull_request, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at ) - create_list( - :tag, 2, + create( + :tag, repository_id: repository.id, created_at: repository.created_at, updated_at: repository.updated_at From 0468a22dfd83caf677cd4fe8997ea5e74095c174 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 27 Sep 2021 14:55:03 +0200 Subject: [PATCH 10/88] unnecessary code from models removed --- lib/models/build.rb | 2 +- lib/models/job.rb | 2 +- lib/models/repository.rb | 4 ++-- spec/backup/remove_specified_spec.rb | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/models/build.rb b/lib/models/build.rb index b5aeb35..51722b8 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -7,7 +7,7 @@ # Build model class Build < Model belongs_to :repository - has_many :jobs, -> { order('id') }, foreign_key: :source_id, dependent: :destroy, class_name: 'Job' + has_many :jobs, -> { order('id') }, foreign_key: :source_id, dependent: :destroy has_one :repo_for_that_this_build_is_current, foreign_key: :current_build_id, dependent: :destroy, class_name: 'Repository' self.table_name = 'builds' diff --git a/lib/models/job.rb b/lib/models/job.rb index 10dbba3..28daa26 100644 --- a/lib/models/job.rb +++ b/lib/models/job.rb @@ -9,7 +9,7 @@ class Job < Model self.inheritance_column = :_type_disabled belongs_to :repository - has_many :logs, -> { order('id') }, foreign_key: :job_id, dependent: :destroy, class_name: 'Log' + has_many :logs, -> { order('id') }, dependent: :destroy self.table_name = 'jobs' end diff --git a/lib/models/repository.rb b/lib/models/repository.rb index fc7660f..ed759f5 100644 --- a/lib/models/repository.rb +++ b/lib/models/repository.rb @@ -6,8 +6,8 @@ # Repository model class Repository < Model - has_many :builds, -> { order('id') }, foreign_key: :repository_id, class_name: 'Build' - has_many :requests, -> { order('id') }, foreign_key: :repository_id, dependent: :destroy, class_name: 'Request' + has_many :builds, -> { order('id') } + has_many :requests, -> { order('id') }, dependent: :destroy self.table_name = 'repositories' end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 893f04d..df57e03 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -314,10 +314,10 @@ ) } it 'removes user with all his dependencies' do - Model.subclasses.each do |subclass| - puts subclass.to_s - puts subclass.all.size - end + # Model.subclasses.each do |subclass| + # puts subclass.to_s + # puts subclass.all.size + # end expect(true).not_to be(false) end end From 1f4f027b371352021ed0c620ff2e1bb3b9ed1fc5 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 29 Sep 2021 12:47:36 +0200 Subject: [PATCH 11/88] remove_user_with_dependencies first version --- lib/backup/remove_specified.rb | 8 ++++- lib/models/abuse.rb | 1 + lib/models/branch.rb | 6 ++++ lib/models/broadcast.rb | 1 + lib/models/build.rb | 9 +++-- lib/models/commit.rb | 4 +++ lib/models/job.rb | 3 ++ lib/models/model.rb | 26 ++++++++++++++ lib/models/owner_group.rb | 1 + lib/models/pull_request.rb | 3 ++ lib/models/repository.rb | 9 +++++ lib/models/request.rb | 6 ++++ lib/models/stage.rb | 2 ++ lib/models/subscription.rb | 2 ++ lib/models/tag.rb | 4 +++ lib/models/trial.rb | 2 ++ lib/models/trial_allowance.rb | 1 + lib/models/user.rb | 21 ++++++++++++ lib/utils.rb | 15 ++++++++ spec/backup/remove_specified_spec.rb | 24 ++++++++++++- spec/support/factories/request.rb | 7 ++++ spec/support/factories/user.rb | 18 ++++++---- spec/support/utils.rb | 51 ++++++++++++++-------------- spec/utils_spec.rb | 27 +++++++++++++++ 24 files changed, 215 insertions(+), 36 deletions(-) create mode 100644 lib/utils.rb create mode 100644 spec/utils_spec.rb diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 3b0afaf..42b509a 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -60,7 +60,13 @@ def process_repo_with_id(repo_id) end def remove_user_with_dependencies(user_id) - + user = User.find(user_id) + # puts user.ids_of_all_dependencies + user.ids_of_all_dependencies.each do |name, ids| + model = Model.subclasses.find{ |model| model.name == name.to_s.camelcase } + model.delete(ids) + end + user.delete end def remove_org_with_dependencies(org_id) diff --git a/lib/models/abuse.rb b/lib/models/abuse.rb index 573bb6e..7fb0187 100644 --- a/lib/models/abuse.rb +++ b/lib/models/abuse.rb @@ -3,5 +3,6 @@ require 'models/model' class Abuse < Model + belongs_to :owner, polymorphic: true self.table_name = 'abuses' end diff --git a/lib/models/branch.rb b/lib/models/branch.rb index ed099f7..78cfaea 100644 --- a/lib/models/branch.rb +++ b/lib/models/branch.rb @@ -3,5 +3,11 @@ require 'models/model' class Branch < Model + has_many :builds + has_many :commits + has_many :crons + has_many :jobs, as: :source + has_many :requests + self.table_name = 'branches' end diff --git a/lib/models/broadcast.rb b/lib/models/broadcast.rb index f7fa7ab..95d79cf 100644 --- a/lib/models/broadcast.rb +++ b/lib/models/broadcast.rb @@ -3,5 +3,6 @@ require 'models/model' class Broadcast < Model + belongs_to :recipient, polymorphic: true self.table_name = 'broadcasts' end diff --git a/lib/models/build.rb b/lib/models/build.rb index 51722b8..3cf88d5 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -7,8 +7,13 @@ # Build model class Build < Model belongs_to :repository - has_many :jobs, -> { order('id') }, foreign_key: :source_id, dependent: :destroy - has_one :repo_for_that_this_build_is_current, foreign_key: :current_build_id, dependent: :destroy, class_name: 'Repository' + belongs_to :owner, polymorphic: true + has_many :jobs, -> { order('id') }, as: :source, dependent: :destroy + has_many :repos_for_that_this_build_is_current, foreign_key: :current_build_id, dependent: :destroy, class_name: 'Repository' + has_many :repos_for_that_this_build_is_last, foreign_key: :last_build_id, class_name: 'Repository' + has_many :tags_for_that_this_build_is_last, foreign_key: :last_build_id, class_name: 'Tag' + has_many :branches_for_that_this_build_is_last, foreign_key: :last_build_id, class_name: 'Branch' + has_many :stages self.table_name = 'builds' end diff --git a/lib/models/commit.rb b/lib/models/commit.rb index 0cf4b0d..c2ce0fe 100644 --- a/lib/models/commit.rb +++ b/lib/models/commit.rb @@ -3,5 +3,9 @@ require 'models/model' class Commit < Model + has_many :builds + has_many :jobs + has_many :requests + self.table_name = 'commits' end diff --git a/lib/models/job.rb b/lib/models/job.rb index 28daa26..8daa7f5 100644 --- a/lib/models/job.rb +++ b/lib/models/job.rb @@ -8,8 +8,11 @@ class Job < Model self.inheritance_column = :_type_disabled + belongs_to :owner, polymorphic: true belongs_to :repository has_many :logs, -> { order('id') }, dependent: :destroy + has_many :annotations + has_many :queueable_jobs self.table_name = 'jobs' end diff --git a/lib/models/model.rb b/lib/models/model.rb index c98e448..4e6f173 100644 --- a/lib/models/model.rb +++ b/lib/models/model.rb @@ -1,11 +1,37 @@ # frozen_string_literal: true require 'active_record' +require './utils' # Model class class Model < ActiveRecord::Base self.abstract_class = true + def attributes_without_id self.attributes.reject{|k, v| k == "id"} end + + def ids_of_all_dependencies + result = {} + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + + self.send(association.name).map(&:id).map do |id| + if result[symbol].nil? + result[symbol] = [id] + else + result[symbol] << id + end + end + + grandchildren_hashes = self.send(association.name).map(&:ids_of_all_dependencies) + result = Utils.uniquely_join_hashes_of_arrays(result, *grandchildren_hashes) + end + result + end +end + +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.irregular 'abuse', 'abuses' end diff --git a/lib/models/owner_group.rb b/lib/models/owner_group.rb index d615cd6..912a8e0 100644 --- a/lib/models/owner_group.rb +++ b/lib/models/owner_group.rb @@ -3,5 +3,6 @@ require 'models/model' class OwnerGroup < Model + belongs_to :owner, polymorphic: true self.table_name = 'owner_groups' end diff --git a/lib/models/pull_request.rb b/lib/models/pull_request.rb index a9b5553..baf9548 100644 --- a/lib/models/pull_request.rb +++ b/lib/models/pull_request.rb @@ -3,5 +3,8 @@ require 'models/model' class PullRequest < Model + has_many :requests + has_many :builds + self.table_name = 'pull_requests' end diff --git a/lib/models/repository.rb b/lib/models/repository.rb index ed759f5..ded1612 100644 --- a/lib/models/repository.rb +++ b/lib/models/repository.rb @@ -6,8 +6,17 @@ # Repository model class Repository < Model + belongs_to :owner, polymorphic: true has_many :builds, -> { order('id') } has_many :requests, -> { order('id') }, dependent: :destroy + has_many :jobs + has_many :branches + has_many :ssl_keys + has_many :commits + has_many :permissions + has_many :stars + has_many :pull_requests + has_many :tags self.table_name = 'repositories' end diff --git a/lib/models/request.rb b/lib/models/request.rb index 4fb1408..26a9ae8 100644 --- a/lib/models/request.rb +++ b/lib/models/request.rb @@ -4,7 +4,13 @@ require 'models/repository' class Request < Model + belongs_to :owner, polymorphic: true + belongs_to :sender, polymorphic: true belongs_to :repository + has_many :abuses + has_many :messages, as: :subject + has_many :jobs, as: :source + has_many :builds self.table_name = 'requests' end diff --git a/lib/models/stage.rb b/lib/models/stage.rb index 38a675e..a0d5a35 100644 --- a/lib/models/stage.rb +++ b/lib/models/stage.rb @@ -3,5 +3,7 @@ require 'models/model' class Stage < Model + has_many :jobs + self.table_name = 'stages' end diff --git a/lib/models/subscription.rb b/lib/models/subscription.rb index 54db3b3..e1ba1c7 100644 --- a/lib/models/subscription.rb +++ b/lib/models/subscription.rb @@ -3,5 +3,7 @@ require 'models/model' class Subscription < Model + belongs_to :owner, polymorphic: true + has_many :invoices self.table_name = 'subscriptions' end diff --git a/lib/models/tag.rb b/lib/models/tag.rb index 9d6f9e7..a92de71 100644 --- a/lib/models/tag.rb +++ b/lib/models/tag.rb @@ -3,5 +3,9 @@ require 'models/model' class Tag < Model + has_many :builds + has_many :commits + has_many :requests + self.table_name = 'tags' end diff --git a/lib/models/trial.rb b/lib/models/trial.rb index 1edb894..e9c0314 100644 --- a/lib/models/trial.rb +++ b/lib/models/trial.rb @@ -3,5 +3,7 @@ require 'models/model' class Trial < Model + belongs_to :owner, polymorphic: true + has_many :trial_allowances self.table_name = 'trials' end diff --git a/lib/models/trial_allowance.rb b/lib/models/trial_allowance.rb index 00dc5ee..43dba2f 100644 --- a/lib/models/trial_allowance.rb +++ b/lib/models/trial_allowance.rb @@ -3,5 +3,6 @@ require 'models/model' class TrialAllowance < Model + belongs_to :creator, polymorphic: true self.table_name = 'trial_allowances' end diff --git a/lib/models/user.rb b/lib/models/user.rb index 380619f..a3c97c5 100644 --- a/lib/models/user.rb +++ b/lib/models/user.rb @@ -3,5 +3,26 @@ require 'models/model' class User < Model + has_many :builds_for_that_this_user_is_owner, as: :owner, class_name: 'Build' + has_many :builds_for_that_this_user_is_sender, as: :sender, class_name: 'Build' + has_many :repositories, as: :owner + has_many :jobs, as: :owner + has_many :requests_for_that_this_user_is_owner, as: :owner, class_name: 'Request' + has_many :abuses, as: :owner + has_many :subscriptions, as: :owner + has_many :owner_groups, as: :owner + has_many :trials, as: :owner + has_many :trial_allowances, as: :creator + has_many :broadcasts, as: :recipient + has_many :requests_for_that_this_user_is_sender, as: :sender, class_name: 'Request' + + has_many :stars + has_many :permissions + has_many :tokens + has_many :emails + has_many :memberships + has_many :user_beta_features + + self.table_name = 'users' end diff --git a/lib/utils.rb b/lib/utils.rb new file mode 100644 index 0000000..5f7201b --- /dev/null +++ b/lib/utils.rb @@ -0,0 +1,15 @@ +class Utils + def self.uniquely_join_hashes_of_arrays(*hashes) + result = {} + hashes.each do |hash| + hash.each do |key, array| + if result[key].nil? + result[key] = array + else + result[key].concat(array).uniq! + end + end + end + result + end +end \ No newline at end of file diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index df57e03..377d8b6 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -307,6 +307,10 @@ describe 'remove_user_with_dependencies' do let!(:user) { + # Model.subclasses.each do |subclass| + # puts subclass.to_s + # puts subclass.all.size + # end FactoryBot.create( :user_with_all_dependencies, created_at: datetime, @@ -318,7 +322,25 @@ # puts subclass.to_s # puts subclass.all.size # end - expect(true).not_to be(false) + # puts '---------------------------' + # # Build.reflect_on_all_associations.map do |x| + # # puts x.name + # # end + # # Build.reflect_on_all_associations.map do |x| + # # puts x.klass + # # end + db_helper.do_without_triggers do + remove_specified.remove_user_with_dependencies(user.id) + end + # Model.subclasses.each do |subclass| + # puts subclass.to_s + # puts subclass.all.size + # end + rows_number = Model.subclasses.map do |subclass| + subclass.all.size + end.reduce(:+) + + expect(rows_number).to eql(0) end end diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb index 9d2bde2..c960507 100644 --- a/spec/support/factories/request.rb +++ b/spec/support/factories/request.rb @@ -58,6 +58,13 @@ created_at: request.created_at, updated_at: request.updated_at ) + create( + :job_with_all_dependencies_and_sibling, + source_type: 'Request', + source_id: request.id, + created_at: request.created_at, + updated_at: request.updated_at + ) end factory :request_with_all_dependencies_and_sibling do after(:create) do |request| diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index f4ebcbb..cbdf238 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -21,28 +21,34 @@ factory :user_with_all_dependencies do after(:create) do |user| - create_list(:email, 3, + create_list( + :email, 2, user_id: user.id, created_at: user.created_at, updated_at: user.updated_at ) - create_list(:token, 3, + create_list( + :token, 2, user_id: user.id, created_at: user.created_at, updated_at: user.updated_at ) - create_list(:star, 3, + create_list( + :star, 2, user_id: user.id, created_at: user.created_at, updated_at: user.updated_at ) - create_list(:membership, 3, + create_list( + :membership, 2, user_id: user.id, ) - create_list(:user_beta_feature, 3, + create_list( + :user_beta_feature, 2, user_id: user.id, ) - create_list(:permission, 3, + create_list( + :permission, 2, user_id: user.id, ) create( diff --git a/spec/support/utils.rb b/spec/support/utils.rb index 6958d34..2c15ad6 100644 --- a/spec/support/utils.rb +++ b/spec/support/utils.rb @@ -1,30 +1,29 @@ def expect_method_calls_on(cl, method, call_with, options) - match_mode = options[:mode] || :including - allow_instances = options[:allow_instances] || false - arguments_to_check = options[:arguments_to_check] || :all - - calls_args = [] - - allowed = allow_instances ? allow_any_instance_of(cl) : allow(cl) - - allowed.to receive(method).and_wrap_original do |method, *args, &block| - if arguments_to_check == :all - calls_args.push(args) - else - calls_args.push(args.send(arguments_to_check)) # = args.first, args.second, args.third etc. - end - method.call(*args, &block) + match_mode = options[:mode] || :including + allow_instances = options[:allow_instances] || false + arguments_to_check = options[:arguments_to_check] || :all + + calls_args = [] + + allowed = allow_instances ? allow_any_instance_of(cl) : allow(cl) + + allowed.to receive(method).and_wrap_original do |method, *args, &block| + if arguments_to_check == :all + calls_args.push(args) + else + calls_args.push(args.send(arguments_to_check)) # = args.first, args.second, args.third etc. end - - yield - - case match_mode - when :including - call_with.each do |args| - expect(calls_args).to include(args) - end - when :match - expect(call_with).to match_array(calls_args) + method.call(*args, &block) + end + + yield + + case match_mode + when :including + call_with.each do |args| + expect(calls_args).to include(args) end + when :match + expect(call_with).to match_array(calls_args) end - \ No newline at end of file +end diff --git a/spec/utils_spec.rb b/spec/utils_spec.rb new file mode 100644 index 0000000..63d22b8 --- /dev/null +++ b/spec/utils_spec.rb @@ -0,0 +1,27 @@ +$: << 'lib' +require 'utils' + +describe Utils do + describe 'self.uniquely_join_hashes_of_arrays' do + context 'when proper hashes with arrays are given' do + let(:hash1) { + {a: [1, 2, 3], b: [2, 3, 4]} + } + let(:hash2) { + {a: [1, 2, 3, 4], b: [2, 5], c: [3, 4]} + } + let(:hash3) { + {a: [5, 1], d: [1, 3, 4]} + } + it 'returns proper hash with arrays joined uniquely' do + result = Utils.uniquely_join_hashes_of_arrays(hash1, hash2, hash3) + expect(result).to eql({ + a: [1, 2, 3, 4, 5], + b: [2, 3, 4, 5], + c: [3, 4], + d: [1, 3, 4] + }) + end + end + end +end \ No newline at end of file From 694eee599e6e456e33e460ef3bcb8e1e8f4b90c8 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 29 Sep 2021 12:48:05 +0200 Subject: [PATCH 12/88] comments removed --- lib/backup/remove_specified.rb | 1 - spec/backup/remove_specified_spec.rb | 20 +------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 42b509a..f8a30b0 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -61,7 +61,6 @@ def process_repo_with_id(repo_id) def remove_user_with_dependencies(user_id) user = User.find(user_id) - # puts user.ids_of_all_dependencies user.ids_of_all_dependencies.each do |name, ids| model = Model.subclasses.find{ |model| model.name == name.to_s.camelcase } model.delete(ids) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 377d8b6..9a2479e 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -307,10 +307,6 @@ describe 'remove_user_with_dependencies' do let!(:user) { - # Model.subclasses.each do |subclass| - # puts subclass.to_s - # puts subclass.all.size - # end FactoryBot.create( :user_with_all_dependencies, created_at: datetime, @@ -318,24 +314,10 @@ ) } it 'removes user with all his dependencies' do - # Model.subclasses.each do |subclass| - # puts subclass.to_s - # puts subclass.all.size - # end - # puts '---------------------------' - # # Build.reflect_on_all_associations.map do |x| - # # puts x.name - # # end - # # Build.reflect_on_all_associations.map do |x| - # # puts x.klass - # # end db_helper.do_without_triggers do remove_specified.remove_user_with_dependencies(user.id) end - # Model.subclasses.each do |subclass| - # puts subclass.to_s - # puts subclass.all.size - # end + rows_number = Model.subclasses.map do |subclass| subclass.all.size end.reduce(:+) From 64d6f1228c4311f6b43313e5959a432633d33bd0 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 29 Sep 2021 19:42:16 +0200 Subject: [PATCH 13/88] wip --- lib/backup/remove_specified.rb | 13 +- lib/model.rb | 58 ++++++++ lib/models/abuse.rb | 2 +- lib/models/annotation.rb | 2 +- lib/models/branch.rb | 2 +- lib/models/broadcast.rb | 2 +- lib/models/build.rb | 2 +- lib/models/commit.rb | 2 +- lib/models/cron.rb | 2 +- lib/models/email.rb | 2 +- lib/models/invoice.rb | 2 +- lib/models/job.rb | 2 +- lib/models/log.rb | 2 +- lib/models/membership.rb | 2 +- lib/models/message.rb | 2 +- lib/models/model.rb | 37 ----- lib/models/organization.rb | 2 +- lib/models/owner_group.rb | 2 +- lib/models/permission.rb | 2 +- lib/models/pull_request.rb | 2 +- lib/models/queueable_job.rb | 2 +- lib/models/repository.rb | 2 +- lib/models/request.rb | 2 +- lib/models/ssl_key.rb | 2 +- lib/models/stage.rb | 2 +- lib/models/star.rb | 2 +- lib/models/subscription.rb | 2 +- lib/models/tag.rb | 2 +- lib/models/token.rb | 2 +- lib/models/trial.rb | 2 +- lib/models/trial_allowance.rb | 2 +- lib/models/user.rb | 2 +- lib/models/user_beta_feature.rb | 2 +- spec/backup/remove_orphans_spec.rb | 2 +- spec/backup/remove_specified_spec.rb | 14 +- spec/model_spec.rb | 9 ++ spec/support/factories/branch.rb | 5 +- spec/support/factories/build.rb | 13 +- spec/support/factories/user.rb | 214 +++++++++++++-------------- 39 files changed, 241 insertions(+), 184 deletions(-) create mode 100644 lib/model.rb delete mode 100644 lib/models/model.rb create mode 100644 spec/model_spec.rb diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index f8a30b0..bede279 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -61,7 +61,18 @@ def process_repo_with_id(repo_id) def remove_user_with_dependencies(user_id) user = User.find(user_id) - user.ids_of_all_dependencies.each do |name, ids| + dependencies_to_filter = { + build: [ + :repos_for_that_this_build_is_current, + :repos_for_that_this_build_is_last, + :tags_for_that_this_build_is_last, + :branches_for_that_this_build_is_last + ] + } + ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) + puts '---' + puts ids_of_all_dependencies[:filtered_out] + ids_of_all_dependencies[:main].each do |name, ids| model = Model.subclasses.find{ |model| model.name == name.to_s.camelcase } model.delete(ids) end diff --git a/lib/model.rb b/lib/model.rb new file mode 100644 index 0000000..3da23d1 --- /dev/null +++ b/lib/model.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require 'active_record' +require './utils' + +# Model class +class Model < ActiveRecord::Base + self.abstract_class = true + + def attributes_without_id + self.attributes.reject{|k, v| k == "id"} + end + + def ids_of_all_dependencies(to_filter={}) + to_filter.default = [] + main = {} + filtered_out = {} + self_symbol = self.class.name.underscore.to_sym + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + self.send(association.name).map(&:id).map do |id| + # puts '.' + # puts self_symbol + # puts association.name + if to_filter[self_symbol].any? { |a| a == association.name } + hash_to_use = filtered_out + else + hash_to_use = main + end + + if hash_to_use[symbol].nil? + hash_to_use[symbol] = [id] + else + hash_to_use[symbol] << id + end + end + + grandchildren_hashes = self.send(association.name).map do |model| + next if to_filter[self_symbol].any? { |a| a == association.name } + model.ids_of_all_dependencies(to_filter) + end.compact + + grandchildren_main = grandchildren_hashes.map { |hash| hash[:main] } + grandchildren_filtered_out = grandchildren_hashes.map { |hash| hash[:filtered_out] } + + main = Utils.uniquely_join_hashes_of_arrays(main, *grandchildren_main) + filtered_out = Utils.uniquely_join_hashes_of_arrays(filtered_out, *grandchildren_filtered_out) + end + + { main: main, filtered_out: filtered_out } + end +end + +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.irregular 'abuse', 'abuses' +end diff --git a/lib/models/abuse.rb b/lib/models/abuse.rb index 7fb0187..7d2fa31 100644 --- a/lib/models/abuse.rb +++ b/lib/models/abuse.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Abuse < Model belongs_to :owner, polymorphic: true diff --git a/lib/models/annotation.rb b/lib/models/annotation.rb index 5975561..abdfcbb 100644 --- a/lib/models/annotation.rb +++ b/lib/models/annotation.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Annotation < Model self.table_name = 'annotations' diff --git a/lib/models/branch.rb b/lib/models/branch.rb index 78cfaea..5c53f92 100644 --- a/lib/models/branch.rb +++ b/lib/models/branch.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Branch < Model has_many :builds diff --git a/lib/models/broadcast.rb b/lib/models/broadcast.rb index 95d79cf..8d16fab 100644 --- a/lib/models/broadcast.rb +++ b/lib/models/broadcast.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Broadcast < Model belongs_to :recipient, polymorphic: true diff --git a/lib/models/build.rb b/lib/models/build.rb index 3cf88d5..204146c 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'models/job' -require 'models/model' +require 'model' require 'models/repository' # Build model diff --git a/lib/models/commit.rb b/lib/models/commit.rb index c2ce0fe..726be4e 100644 --- a/lib/models/commit.rb +++ b/lib/models/commit.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Commit < Model has_many :builds diff --git a/lib/models/cron.rb b/lib/models/cron.rb index cc8ef31..8f3a80a 100644 --- a/lib/models/cron.rb +++ b/lib/models/cron.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Cron < Model self.table_name = 'crons' diff --git a/lib/models/email.rb b/lib/models/email.rb index 5467fa4..d89673a 100644 --- a/lib/models/email.rb +++ b/lib/models/email.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Email < Model self.table_name = 'emails' diff --git a/lib/models/invoice.rb b/lib/models/invoice.rb index 3e327a9..7f2e502 100644 --- a/lib/models/invoice.rb +++ b/lib/models/invoice.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Invoice < Model self.table_name = 'invoices' diff --git a/lib/models/job.rb b/lib/models/job.rb index 8daa7f5..2a63ad4 100644 --- a/lib/models/job.rb +++ b/lib/models/job.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' require 'models/repository' require 'models/log' diff --git a/lib/models/log.rb b/lib/models/log.rb index bbb5f4c..e9e55f6 100644 --- a/lib/models/log.rb +++ b/lib/models/log.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Log < Model belongs_to :job diff --git a/lib/models/membership.rb b/lib/models/membership.rb index b62d530..36a5738 100644 --- a/lib/models/membership.rb +++ b/lib/models/membership.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Membership < Model self.table_name = 'memberships' diff --git a/lib/models/message.rb b/lib/models/message.rb index 0be904d..4f90a3e 100644 --- a/lib/models/message.rb +++ b/lib/models/message.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Message < Model self.table_name = 'messages' diff --git a/lib/models/model.rb b/lib/models/model.rb deleted file mode 100644 index 4e6f173..0000000 --- a/lib/models/model.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -require 'active_record' -require './utils' - -# Model class -class Model < ActiveRecord::Base - self.abstract_class = true - - def attributes_without_id - self.attributes.reject{|k, v| k == "id"} - end - - def ids_of_all_dependencies - result = {} - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - symbol = association.klass.name.underscore.to_sym - - self.send(association.name).map(&:id).map do |id| - if result[symbol].nil? - result[symbol] = [id] - else - result[symbol] << id - end - end - - grandchildren_hashes = self.send(association.name).map(&:ids_of_all_dependencies) - result = Utils.uniquely_join_hashes_of_arrays(result, *grandchildren_hashes) - end - result - end -end - -ActiveSupport::Inflector.inflections(:en) do |inflect| - inflect.irregular 'abuse', 'abuses' -end diff --git a/lib/models/organization.rb b/lib/models/organization.rb index edbd92c..6391f84 100644 --- a/lib/models/organization.rb +++ b/lib/models/organization.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Organization < Model self.table_name = 'organizations' diff --git a/lib/models/owner_group.rb b/lib/models/owner_group.rb index 912a8e0..4166128 100644 --- a/lib/models/owner_group.rb +++ b/lib/models/owner_group.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class OwnerGroup < Model belongs_to :owner, polymorphic: true diff --git a/lib/models/permission.rb b/lib/models/permission.rb index 65e3594..3350166 100644 --- a/lib/models/permission.rb +++ b/lib/models/permission.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Permission < Model self.table_name = 'permissions' diff --git a/lib/models/pull_request.rb b/lib/models/pull_request.rb index baf9548..e8bb853 100644 --- a/lib/models/pull_request.rb +++ b/lib/models/pull_request.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class PullRequest < Model has_many :requests diff --git a/lib/models/queueable_job.rb b/lib/models/queueable_job.rb index 7310142..68751f5 100644 --- a/lib/models/queueable_job.rb +++ b/lib/models/queueable_job.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class QueueableJob < Model self.table_name = 'queueable_jobs' diff --git a/lib/models/repository.rb b/lib/models/repository.rb index ded1612..e1db550 100644 --- a/lib/models/repository.rb +++ b/lib/models/repository.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' require 'models/build' require 'models/request' diff --git a/lib/models/request.rb b/lib/models/request.rb index 26a9ae8..948efec 100644 --- a/lib/models/request.rb +++ b/lib/models/request.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' require 'models/repository' class Request < Model diff --git a/lib/models/ssl_key.rb b/lib/models/ssl_key.rb index 0e0c7bb..4565054 100644 --- a/lib/models/ssl_key.rb +++ b/lib/models/ssl_key.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class SslKey < Model self.table_name = 'ssl_keys' diff --git a/lib/models/stage.rb b/lib/models/stage.rb index a0d5a35..5376cc6 100644 --- a/lib/models/stage.rb +++ b/lib/models/stage.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Stage < Model has_many :jobs diff --git a/lib/models/star.rb b/lib/models/star.rb index 14b2e24..8dd9dfe 100644 --- a/lib/models/star.rb +++ b/lib/models/star.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Star < Model self.table_name = 'stars' diff --git a/lib/models/subscription.rb b/lib/models/subscription.rb index e1ba1c7..46f20fb 100644 --- a/lib/models/subscription.rb +++ b/lib/models/subscription.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Subscription < Model belongs_to :owner, polymorphic: true diff --git a/lib/models/tag.rb b/lib/models/tag.rb index a92de71..8d9c911 100644 --- a/lib/models/tag.rb +++ b/lib/models/tag.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Tag < Model has_many :builds diff --git a/lib/models/token.rb b/lib/models/token.rb index bc147fd..29ab1bc 100644 --- a/lib/models/token.rb +++ b/lib/models/token.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Token < Model self.table_name = 'tokens' diff --git a/lib/models/trial.rb b/lib/models/trial.rb index e9c0314..6341899 100644 --- a/lib/models/trial.rb +++ b/lib/models/trial.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class Trial < Model belongs_to :owner, polymorphic: true diff --git a/lib/models/trial_allowance.rb b/lib/models/trial_allowance.rb index 43dba2f..4432a76 100644 --- a/lib/models/trial_allowance.rb +++ b/lib/models/trial_allowance.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class TrialAllowance < Model belongs_to :creator, polymorphic: true diff --git a/lib/models/user.rb b/lib/models/user.rb index a3c97c5..2266cfe 100644 --- a/lib/models/user.rb +++ b/lib/models/user.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class User < Model has_many :builds_for_that_this_user_is_owner, as: :owner, class_name: 'Build' diff --git a/lib/models/user_beta_feature.rb b/lib/models/user_beta_feature.rb index 2b281b9..d7d08bc 100644 --- a/lib/models/user_beta_feature.rb +++ b/lib/models/user_beta_feature.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'models/model' +require 'model' class UserBetaFeature < Model self.table_name = 'user_beta_features' diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index d754685..057919d 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -32,7 +32,7 @@ FactoryBot.create_list(:repository, 2) FactoryBot.create_list(:build, 2) FactoryBot.create_list(:job, 2) - FactoryBot.create_list(:branch, 2) + FactoryBot.create_list(:branch, 2, repository_id: 1) FactoryBot.create_list(:tag, 2) FactoryBot.create_list(:commit, 2) FactoryBot.create_list(:cron, 2) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 9a2479e..595bd7e 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -313,7 +313,14 @@ updated_at: datetime ) } - it 'removes user with all his dependencies' do + it 'removes user with all his dependencies except those on current_build_id and last_build_id' do + Model.subclasses.each do |subclass| + puts subclass.to_s + puts subclass.all.size + end + puts '123----' + puts user.builds_for_that_this_user_is_owner.first.branches_for_that_this_build_is_last.to_json + db_helper.do_without_triggers do remove_specified.remove_user_with_dependencies(user.id) end @@ -322,6 +329,11 @@ subclass.all.size end.reduce(:+) + Model.subclasses.each do |subclass| + puts subclass.to_s + puts subclass.all.size + end + expect(rows_number).to eql(0) end end diff --git a/spec/model_spec.rb b/spec/model_spec.rb new file mode 100644 index 0000000..a7bccec --- /dev/null +++ b/spec/model_spec.rb @@ -0,0 +1,9 @@ +$: << 'lib' +require './model' + +describe Model do + describe 'ids_of_all_dependencies' do + context 'when no exceptions are given' do + end + end +end \ No newline at end of file diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb index ef39667..f1e00b9 100644 --- a/spec/support/factories/branch.rb +++ b/spec/support/factories/branch.rb @@ -6,20 +6,23 @@ FactoryBot.define do factory :branch do name { "branch_#{Time.now.to_f}" } - repository_id { 1 } + factory :branch_orphaned_on_repository_id do repository_id { 2_000_000_000 } end factory :branch_orphaned_on_last_build_id do + repository_id { 1 } last_build_id { 2_000_000_000 } end factory :branch_with_last_build_id do + repository_id { 1 } last_build_id { Build.first.id } end factory :branch_with_all_dependencies do + repository_id { 2_000_000_000 } after(:create) do |branch| create( :build_with_safe_dependencies_and_sibling, diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 057bba9..5e72a7c 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -96,12 +96,6 @@ factory :build_with_all_dependencies do after(:create) do |build| - create( - :tag_with_all_dependencies_and_sibling, - last_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) create_list( :stage_with_jobs, 2, build_id: build.id, @@ -115,6 +109,12 @@ created_at: build.created_at, updated_at: build.updated_at ) + create( + :tag_with_all_dependencies_and_sibling, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) create( :branch_with_all_dependencies_and_sibling, last_build_id: build.id, @@ -162,6 +162,7 @@ ) create( :branch, + repository_id: 2_000_000_000, last_build_id: build.id, created_at: build.created_at, updated_at: build.updated_at diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index cbdf238..e463972 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -21,43 +21,43 @@ factory :user_with_all_dependencies do after(:create) do |user| - create_list( - :email, 2, - user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :token, 2, - user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :star, 2, - user_id: user.id, - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :membership, 2, - user_id: user.id, - ) - create_list( - :user_beta_feature, 2, - user_id: user.id, - ) - create_list( - :permission, 2, - user_id: user.id, - ) - create( - :repository_with_all_dependencies_and_sibling, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) + # create_list( + # :email, 2, + # user_id: user.id, + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :token, 2, + # user_id: user.id, + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :star, 2, + # user_id: user.id, + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :membership, 2, + # user_id: user.id, + # ) + # create_list( + # :user_beta_feature, 2, + # user_id: user.id, + # ) + # create_list( + # :permission, 2, + # user_id: user.id, + # ) + # create( + # :repository_with_all_dependencies_and_sibling, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) create( :build_with_all_dependencies_and_sibling, owner_id: user.id, @@ -65,76 +65,76 @@ created_at: user.created_at, updated_at: user.updated_at ) - create( - :build_with_all_dependencies_and_sibling, - sender_id: user.id, - sender_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create( - :request_with_all_dependencies_and_sibling, - sender_id: user.id, - sender_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create( - :request_with_all_dependencies_and_sibling, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create( - :job_with_all_dependencies_and_sibling, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :subscription_with_invoices, 2, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :trial_with_allowances, 2, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :trial_allowance, 2, - creator_id: user.id, - creator_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :owner_group, 2, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :broadcast, 2, - recipient_id: user.id, - recipient_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) - create_list( - :abuse, 2, - owner_id: user.id, - owner_type: 'User', - created_at: user.created_at, - updated_at: user.updated_at - ) + # create( + # :build_with_all_dependencies_and_sibling, + # sender_id: user.id, + # sender_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create( + # :request_with_all_dependencies_and_sibling, + # sender_id: user.id, + # sender_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create( + # :request_with_all_dependencies_and_sibling, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create( + # :job_with_all_dependencies_and_sibling, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :subscription_with_invoices, 2, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :trial_with_allowances, 2, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :trial_allowance, 2, + # creator_id: user.id, + # creator_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :owner_group, 2, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :broadcast, 2, + # recipient_id: user.id, + # recipient_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) + # create_list( + # :abuse, 2, + # owner_id: user.id, + # owner_type: 'User', + # created_at: user.created_at, + # updated_at: user.updated_at + # ) end end end From a7922944859ad44c85c926d51cba989656ed29dd Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 30 Sep 2021 02:52:19 +0200 Subject: [PATCH 14/88] remove_user_with_dependencies removes data with exceptions --- lib/backup/remove_specified.rb | 4 +- lib/model.rb | 80 ++++++---- spec/backup/remove_specified_spec.rb | 32 ++-- spec/support/factories/user.rb | 214 +++++++++++++-------------- 4 files changed, 175 insertions(+), 155 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index bede279..1d0b60a 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -70,10 +70,8 @@ def remove_user_with_dependencies(user_id) ] } ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) - puts '---' - puts ids_of_all_dependencies[:filtered_out] ids_of_all_dependencies[:main].each do |name, ids| - model = Model.subclasses.find{ |model| model.name == name.to_s.camelcase } + model = Model.subclasses.find{ |m| m.name == name.to_s.camelcase } model.delete(ids) end user.delete diff --git a/lib/model.rb b/lib/model.rb index 3da23d1..842e0df 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -3,53 +3,69 @@ require 'active_record' require './utils' -# Model class -class Model < ActiveRecord::Base - self.abstract_class = true - - def attributes_without_id - self.attributes.reject{|k, v| k == "id"} - end - +module IdsOfAllDependencies def ids_of_all_dependencies(to_filter={}) to_filter.default = [] - main = {} - filtered_out = {} + result = { main: {}, filtered_out: {} } self_symbol = self.class.name.underscore.to_sym self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - self.send(association.name).map(&:id).map do |id| - # puts '.' - # puts self_symbol - # puts association.name - if to_filter[self_symbol].any? { |a| a == association.name } - hash_to_use = filtered_out - else - hash_to_use = main - end + context = { to_filter: to_filter, self_symbol: self_symbol, association: association } - if hash_to_use[symbol].nil? - hash_to_use[symbol] = [id] + self.send(association.name).map(&:id).map do |id| + hash_to_use = get_hash_to_use(context) + if result[hash_to_use][symbol].nil? + result[hash_to_use][symbol] = [id] else - hash_to_use[symbol] << id + result[hash_to_use][symbol] << id end end + result = get_result_with_grandchildren_hashes(result, context) + end - grandchildren_hashes = self.send(association.name).map do |model| - next if to_filter[self_symbol].any? { |a| a == association.name } - model.ids_of_all_dependencies(to_filter) - end.compact + result + end - grandchildren_main = grandchildren_hashes.map { |hash| hash[:main] } - grandchildren_filtered_out = grandchildren_hashes.map { |hash| hash[:filtered_out] } + private - main = Utils.uniquely_join_hashes_of_arrays(main, *grandchildren_main) - filtered_out = Utils.uniquely_join_hashes_of_arrays(filtered_out, *grandchildren_filtered_out) - end + def get_result_with_grandchildren_hashes(result, context) + hashes = get_grandchildren_hashes(context) + main = hashes.map { |hash| hash[:main] } + filtered_out = hashes.map { |hash| hash[:filtered_out] } - { main: main, filtered_out: filtered_out } + result[:main] = Utils.uniquely_join_hashes_of_arrays(result[:main], *main) + result[:filtered_out] = Utils.uniquely_join_hashes_of_arrays(result[:filtered_out], *filtered_out) + result + end + + def get_grandchildren_hashes(context) + association = context[:association] + to_filter = context[:to_filter] + self.send(association.name).map do |model| + next if should_be_filtered?(**context) + model.ids_of_all_dependencies(to_filter) + end.compact + end + + def get_hash_to_use(context) + should_be_filtered?(**context) ? :filtered_out : :main + end + + def should_be_filtered?(to_filter:, self_symbol:, association:) + to_filter[self_symbol].any? { |a| a == association.name } + end +end + +# Model class +class Model < ActiveRecord::Base + include IdsOfAllDependencies + + self.abstract_class = true + + def attributes_without_id + self.attributes.reject{|k, v| k == "id"} end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 595bd7e..99bf951 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -314,13 +314,6 @@ ) } it 'removes user with all his dependencies except those on current_build_id and last_build_id' do - Model.subclasses.each do |subclass| - puts subclass.to_s - puts subclass.all.size - end - puts '123----' - puts user.builds_for_that_this_user_is_owner.first.branches_for_that_this_build_is_last.to_json - db_helper.do_without_triggers do remove_specified.remove_user_with_dependencies(user.id) end @@ -329,12 +322,25 @@ subclass.all.size end.reduce(:+) - Model.subclasses.each do |subclass| - puts subclass.to_s - puts subclass.all.size - end - - expect(rows_number).to eql(0) + expect(rows_number).to eql(768) + expect(Log.all.size).to eql(56) + expect(Job.all.size).to eql(96) + expect(Build.all.size).to eql(72) + expect(Request.all.size).to eql(40) + expect(Repository.all.size).to eql(108) + expect(Branch.all.size).to eql(62) + expect(Tag.all.size).to eql(62) + expect(Commit.all.size).to eql(24) + expect(Cron.all.size).to eql(8) + expect(PullRequest.all.size).to eql(8) + expect(SslKey.all.size).to eql(8) + expect(Stage.all.size).to eql(32) + expect(Star.all.size).to eql(8) + expect(Permission.all.size).to eql(8) + expect(Message.all.size).to eql(32) + expect(Abuse.all.size).to eql(32) + expect(Annotation.all.size).to eql(56) + expect(QueueableJob.all.size).to eql(56) end end diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index e463972..cbdf238 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -21,43 +21,43 @@ factory :user_with_all_dependencies do after(:create) do |user| - # create_list( - # :email, 2, - # user_id: user.id, - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :token, 2, - # user_id: user.id, - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :star, 2, - # user_id: user.id, - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :membership, 2, - # user_id: user.id, - # ) - # create_list( - # :user_beta_feature, 2, - # user_id: user.id, - # ) - # create_list( - # :permission, 2, - # user_id: user.id, - # ) - # create( - # :repository_with_all_dependencies_and_sibling, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) + create_list( + :email, 2, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :token, 2, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :star, 2, + user_id: user.id, + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :membership, 2, + user_id: user.id, + ) + create_list( + :user_beta_feature, 2, + user_id: user.id, + ) + create_list( + :permission, 2, + user_id: user.id, + ) + create( + :repository_with_all_dependencies_and_sibling, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) create( :build_with_all_dependencies_and_sibling, owner_id: user.id, @@ -65,76 +65,76 @@ created_at: user.created_at, updated_at: user.updated_at ) - # create( - # :build_with_all_dependencies_and_sibling, - # sender_id: user.id, - # sender_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create( - # :request_with_all_dependencies_and_sibling, - # sender_id: user.id, - # sender_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create( - # :request_with_all_dependencies_and_sibling, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create( - # :job_with_all_dependencies_and_sibling, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :subscription_with_invoices, 2, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :trial_with_allowances, 2, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :trial_allowance, 2, - # creator_id: user.id, - # creator_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :owner_group, 2, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :broadcast, 2, - # recipient_id: user.id, - # recipient_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) - # create_list( - # :abuse, 2, - # owner_id: user.id, - # owner_type: 'User', - # created_at: user.created_at, - # updated_at: user.updated_at - # ) + create( + :build_with_all_dependencies_and_sibling, + sender_id: user.id, + sender_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create( + :request_with_all_dependencies_and_sibling, + sender_id: user.id, + sender_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create( + :request_with_all_dependencies_and_sibling, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create( + :job_with_all_dependencies_and_sibling, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :subscription_with_invoices, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :trial_with_allowances, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :trial_allowance, 2, + creator_id: user.id, + creator_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :owner_group, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :broadcast, 2, + recipient_id: user.id, + recipient_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) + create_list( + :abuse, 2, + owner_id: user.id, + owner_type: 'User', + created_at: user.created_at, + updated_at: user.updated_at + ) end end end From 27349ecd3fc6530760402c75506d257b101dea4f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 30 Sep 2021 03:03:08 +0200 Subject: [PATCH 15/88] refactoring --- lib/model.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/model.rb b/lib/model.rb index 842e0df..51be80c 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -5,7 +5,6 @@ module IdsOfAllDependencies def ids_of_all_dependencies(to_filter={}) - to_filter.default = [] result = { main: {}, filtered_out: {} } self_symbol = self.class.name.underscore.to_sym @@ -15,12 +14,9 @@ def ids_of_all_dependencies(to_filter={}) context = { to_filter: to_filter, self_symbol: self_symbol, association: association } self.send(association.name).map(&:id).map do |id| - hash_to_use = get_hash_to_use(context) - if result[hash_to_use][symbol].nil? - result[hash_to_use][symbol] = [id] - else - result[hash_to_use][symbol] << id - end + hash_to_use = get_hash_to_use(result, context) + hash_to_use[symbol] = [] if hash_to_use[symbol].nil? + hash_to_use[symbol] << id end result = get_result_with_grandchildren_hashes(result, context) end @@ -37,24 +33,27 @@ def get_result_with_grandchildren_hashes(result, context) result[:main] = Utils.uniquely_join_hashes_of_arrays(result[:main], *main) result[:filtered_out] = Utils.uniquely_join_hashes_of_arrays(result[:filtered_out], *filtered_out) - result + result end def get_grandchildren_hashes(context) association = context[:association] to_filter = context[:to_filter] + self.send(association.name).map do |model| next if should_be_filtered?(**context) model.ids_of_all_dependencies(to_filter) end.compact end - def get_hash_to_use(context) - should_be_filtered?(**context) ? :filtered_out : :main + def get_hash_to_use(result, context) + symbol = should_be_filtered?(**context) ? :filtered_out : :main + result[symbol] end def should_be_filtered?(to_filter:, self_symbol:, association:) - to_filter[self_symbol].any? { |a| a == association.name } + arr = to_filter[self_symbol] + arr.present? && arr.any? { |a| a == association.name } end end From d08172a56d61fde0e05740e115a1a4f84e5e875e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 1 Oct 2021 11:38:22 +0200 Subject: [PATCH 16/88] wip --- lib/backup/remove_specified.rb | 63 ++++++++++++++++++++++++++-- lib/utils.rb | 17 ++++++++ spec/backup/remove_specified_spec.rb | 11 ++++- spec/utils_spec.rb | 18 ++++++++ 4 files changed, 103 insertions(+), 6 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 1d0b60a..31916f7 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -59,9 +59,8 @@ def process_repo_with_id(repo_id) end end - def remove_user_with_dependencies(user_id) - user = User.find(user_id) - dependencies_to_filter = { + def dependencies_to_filter + { build: [ :repos_for_that_this_build_is_current, :repos_for_that_this_build_is_last, @@ -69,14 +68,70 @@ def remove_user_with_dependencies(user_id) :branches_for_that_this_build_is_last ] } + end + + def remove_user_with_dependencies(user_id) + user = User.find(user_id) ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) + filter_dependent_on_strangers!(ids_of_all_dependencies) + ids_of_all_dependencies[:main].each do |name, ids| - model = Model.subclasses.find{ |m| m.name == name.to_s.camelcase } + model = Utils.get_model(name) model.delete(ids) end + user.delete end + def filter_dependent_on_strangers!(ids_hash) + builds_to_filter = get_builds_to_filter(ids_hash) + + hashes = builds_to_filter.map do |build| + build.ids_of_all_dependencies(dependencies_to_filter)[:main] + end + + joined_hashes = Utils.uniquely_join_hashes_of_arrays(*hashes) + Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) + # filter_dependent_jobs!(ids_hash, builds_to_filter) + # filter_dependent_stages!(ids_hash, builds_to_filter) + + # builds_to_filter.each do |id| + # ids_hash[:main][:build].delete(id) + # end + end + + def filter_dependent_jobs!(ids_hash, builds_to_filter) + jobs_to_filter = Job.where(source_id: builds_to_filter, source_type: 'Build').map(&:id) + + jobs_to_filter.each do |id| + ids_hash[:main][:job].delete(id) + end + end + + def filter_dependent_stages!(ids_hash, builds_to_filter) + stages_to_filter = Stage.where(build_id: builds_to_filter).map(&:id) + stages_to_filter.each do |id| + ids_hash[:main][:stage].delete(id) + end + end + + def get_builds_to_filter(ids_hash) + builds_to_filter = [] + + ids_hash[:filtered_out].each do |name, ids| + model = Utils.get_model(name) + model.where(id: ids).each do |instance| + [:last_build_id, :current_build_id].each do |method| + build_id = instance.try(method) + builds_to_filter << build_id + end + end + end + + builds_to_filter.compact!.uniq! + Build.where(id: builds_to_filter) + end + def remove_org_with_dependencies(org_id) end diff --git a/lib/utils.rb b/lib/utils.rb index 5f7201b..9d1bbe0 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -12,4 +12,21 @@ def self.uniquely_join_hashes_of_arrays(*hashes) end result end + + def self.difference_of_two_hashes_of_arrays(hash1, hash2) + hash2.each do |key, array| + next if hash1[key].nil? + + array.each do |el| + hash1[key].delete(el) + end + + hash1.delete(key) if hash1[key].empty? + end + hash1 + end + + def self.get_model(name) + Model.subclasses.find{ |m| m.name == name.to_s.camelcase } + end end \ No newline at end of file diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 99bf951..69f8ecb 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -322,10 +322,17 @@ subclass.all.size end.reduce(:+) - expect(rows_number).to eql(768) + # Model.subclasses.each do |subclass| + # puts subclass.to_s + # puts subclass.all.size + # end + + # TODO change these numbers, ensure that current code works properly + + expect(rows_number).to eql(852) expect(Log.all.size).to eql(56) expect(Job.all.size).to eql(96) - expect(Build.all.size).to eql(72) + expect(Build.all.size).to eql(90) expect(Request.all.size).to eql(40) expect(Repository.all.size).to eql(108) expect(Branch.all.size).to eql(62) diff --git a/spec/utils_spec.rb b/spec/utils_spec.rb index 63d22b8..fad108c 100644 --- a/spec/utils_spec.rb +++ b/spec/utils_spec.rb @@ -24,4 +24,22 @@ end end end + + describe 'self.difference_of_two_hashes_of_arrays' do + context 'when proper hashes with arrays are given' do + let(:hash1) { + {a: [1, 2, 3], b: [2, 3, 4], c: [1, 2]} + } + let(:hash2) { + {a: [1, 2, 3, 4], b: [2, 5], d: [3, 4]} + } + it 'returns proper hash with arrays joined uniquely' do + result = Utils.difference_of_two_hashes_of_arrays(hash1, hash2) + expect(result).to eql({ + b: [3, 4], + c: [1, 2] + }) + end + end + end end \ No newline at end of file From 93ba9d207e763cc5d641bae0bf3e1b1eb1c311e2 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 6 Oct 2021 10:32:16 +0200 Subject: [PATCH 17/88] filter_dependent_on_strangers! fixed --- .gitignore | 1 + lib/backup/remove_specified.rb | 15 ++-- lib/model.rb | 51 +++++++++++- lib/utils.rb | 15 +++- spec/backup/remove_specified_spec.rb | 71 ++++++++++------ spec/model_spec.rb | 118 ++++++++++++++++++++++++++- spec/support/factories/build.rb | 12 +-- 7 files changed, 231 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index 09f42e1..ba33ae8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dump/* !log/.keep !dump/.keep *.gem +.byebug_history \ No newline at end of file diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 31916f7..814c7be 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -72,7 +72,7 @@ def dependencies_to_filter def remove_user_with_dependencies(user_id) user = User.find(user_id) - ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) + ids_of_all_dependencies = user.ids_of_all_dependencies(except: dependencies_to_filter) filter_dependent_on_strangers!(ids_of_all_dependencies) ids_of_all_dependencies[:main].each do |name, ids| @@ -87,17 +87,11 @@ def filter_dependent_on_strangers!(ids_hash) builds_to_filter = get_builds_to_filter(ids_hash) hashes = builds_to_filter.map do |build| - build.ids_of_all_dependencies(dependencies_to_filter)[:main] + build.ids_of_all_dependencies(only: dependencies_to_filter)[:main] end joined_hashes = Utils.uniquely_join_hashes_of_arrays(*hashes) - Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) - # filter_dependent_jobs!(ids_hash, builds_to_filter) - # filter_dependent_stages!(ids_hash, builds_to_filter) - - # builds_to_filter.each do |id| - # ids_hash[:main][:build].delete(id) - # end + ids_hash[:main] = Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) end def filter_dependent_jobs!(ids_hash, builds_to_filter) @@ -128,7 +122,8 @@ def get_builds_to_filter(ids_hash) end end - builds_to_filter.compact!.uniq! + builds_to_filter.compact! + builds_to_filter.uniq! Build.where(id: builds_to_filter) end diff --git a/lib/model.rb b/lib/model.rb index 51be80c..4fa35dd 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -3,6 +3,23 @@ require 'active_record' require './utils' +module IdsOfAllDependenciesJson + def ids_of_all_dependencies_json + result = {} + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + self.send(association.name).map do |associated_object| + result[symbol] = [] if result[symbol].nil? + result[symbol] << associated_object.ids_of_all_dependencies_json + end + end + result[:id] = "#{self.class.name.underscore}-#{id}" + result = result[:id] if result.size == 1 + result + end +end + module IdsOfAllDependencies def ids_of_all_dependencies(to_filter={}) result = { main: {}, filtered_out: {} } @@ -41,8 +58,7 @@ def get_grandchildren_hashes(context) to_filter = context[:to_filter] self.send(association.name).map do |model| - next if should_be_filtered?(**context) - model.ids_of_all_dependencies(to_filter) + model.ids_of_all_dependencies(get_to_filter_for_children(**context)) end.compact end @@ -52,14 +68,41 @@ def get_hash_to_use(result, context) end def should_be_filtered?(to_filter:, self_symbol:, association:) - arr = to_filter[self_symbol] - arr.present? && arr.any? { |a| a == association.name } + return false if to_filter == :none + return true if to_filter == :all + + except_arr = to_filter[:except].try(:[], self_symbol) + only_arr = to_filter[:only].try(:[], self_symbol) + + if except_arr.present? + except_arr.any? { |a| a == association.name } + elsif to_filter[:only].present? + only_arr.class != Array || only_arr.none? { |a| a == association.name } + else + false + end + end + + def get_to_filter_for_children(to_filter:, self_symbol:, association:) + return to_filter if [:none, :all].include?(to_filter) + + except_arr = to_filter[:except].try(:[], self_symbol) + only_arr = to_filter[:only].try(:[], self_symbol) + + if except_arr.present? + return except_arr.any? { |a| a == association.name } ? :all : to_filter + elsif only_arr.present? + return only_arr.any? { |a| a == association.name } ? :none : to_filter + else + to_filter + end end end # Model class class Model < ActiveRecord::Base include IdsOfAllDependencies + include IdsOfAllDependenciesJson self.abstract_class = true diff --git a/lib/utils.rb b/lib/utils.rb index 9d1bbe0..fa882bb 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -13,17 +13,26 @@ def self.uniquely_join_hashes_of_arrays(*hashes) result end + def self.clone_hash_of_arrays(hash) + result = {} + hash.each do |key, array| + result[key] = hash[key].clone + end + result + end + def self.difference_of_two_hashes_of_arrays(hash1, hash2) + result = self.clone_hash_of_arrays(hash1) hash2.each do |key, array| next if hash1[key].nil? array.each do |el| - hash1[key].delete(el) + result[key].delete(el) end - hash1.delete(key) if hash1[key].empty? + result.delete(key) if result[key].empty? end - hash1 + result end def self.get_model(name) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 69f8ecb..fa8adaf 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -10,7 +10,7 @@ require 'support/before_tests' require 'support/utils' require 'pry' - +require 'byebug' describe Backup::RemoveSpecified do before(:all) do @@ -322,32 +322,49 @@ subclass.all.size end.reduce(:+) - # Model.subclasses.each do |subclass| - # puts subclass.to_s - # puts subclass.all.size - # end - - # TODO change these numbers, ensure that current code works properly - - expect(rows_number).to eql(852) - expect(Log.all.size).to eql(56) - expect(Job.all.size).to eql(96) - expect(Build.all.size).to eql(90) - expect(Request.all.size).to eql(40) - expect(Repository.all.size).to eql(108) - expect(Branch.all.size).to eql(62) - expect(Tag.all.size).to eql(62) - expect(Commit.all.size).to eql(24) - expect(Cron.all.size).to eql(8) - expect(PullRequest.all.size).to eql(8) - expect(SslKey.all.size).to eql(8) - expect(Stage.all.size).to eql(32) - expect(Star.all.size).to eql(8) - expect(Permission.all.size).to eql(8) - expect(Message.all.size).to eql(32) - expect(Abuse.all.size).to eql(32) - expect(Annotation.all.size).to eql(56) - expect(QueueableJob.all.size).to eql(56) + hashes = { + all: rows_number, + logs: Log.all.size, + jobs: Job.all.size, + builds: Build.all.size, + requests: Request.all.size, + repositories: Repository.all.size, + branches: Branch.all.size, + tags: Tag.all.size, + commits: Commit.all.size, + crons: Cron.all.size, + pull_requests: PullRequest.all.size, + ssl_keys: SslKey.all.size, + stages: Stage.all.size, + stars: Star.all.size, + permissions: Permission.all.size, + messages: Message.all.size, + abuses: Abuse.all.size, + annotations: Annotation.all.size, + queueable_jobs: QueueableJob.all.size + } + + expect(hashes).to eql( + all: 768, + logs: 56, + jobs: 96, + builds: 72, + requests: 40, + repositories: 108, + branches: 62, + tags: 62, + commits: 24, + crons: 8, + pull_requests: 8, + ssl_keys: 8, + stages: 32, + stars: 8, + permissions: 8, + messages: 32, + abuses: 32, + annotations: 56, + queueable_jobs: 56 + ) end end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index a7bccec..aa55eb3 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -1,9 +1,123 @@ $: << 'lib' require './model' +require 'travis-backup' +require 'support/factories' +require 'support/before_tests' +require 'byebug' describe Model do + before(:all) do + BeforeTests.new.run + end + describe 'ids_of_all_dependencies' do - context 'when no exceptions are given' do + let(:files_location) { "dump/tests" } + let!(:config) { Config.new(files_location: files_location, limit: 5) } + let!(:db_helper) { DbHelper.new(config) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } + + let!(:commit) { + FactoryBot.create( + :commit_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + } + context 'when no filters are given' do + it 'returns all dependencies ids in hash' do + expect(commit.ids_of_all_dependencies).to eql({ + filtered_out: {}, + main: { + abuse: [1, 2], + annotation: [1, 2, 3, 4], + branch: [73, 74], + build: [1, 3, 6, 8], + job: [2, 4, 5, 9, 10, 7], + log: [1, 2, 3, 4], + message: [1, 2], + queueable_job: [1, 2, 3, 4], + repository: [2, 1, 4, 3], + request: [1, 2], + stage: [20, 21], + tag: [1, 2] + } + }) + end + end + + context 'when the only filter is given' do + it 'returns all dependencies ids in hash' do + filter = { + only: { + request: [ :jobs, :builds ] + } + } + expect(commit.ids_of_all_dependencies(filter)).to eql({ + filtered_out: { + abuse: [1, 2], + annotation: [1, 2], + branch: [73], + build: [1, 3], + job: [2, 4, 5], + log: [1, 2], + message: [1, 2], + queueable_job: [1, 2], + repository: [2, 1], + request: [1, 2], + stage: [20], + tag: [1] + }, + main: { + annotation: [3, 4], + branch: [74], + build: [6, 8], + job: [9, 10, 7], + log: [3, 4], + queueable_job: [3, 4], + repository: [4, 3], + stage: [21], + tag: [2] + } + }) + end + end + + context 'when the except filter is given' do + it 'returns all dependencies ids in hash' do + filter = { + except: { + request: [ :jobs, :builds ] + } + } + expect(commit.ids_of_all_dependencies(filter)).to eql({ + main: { + abuse: [1, 2], + annotation: [1, 2], + branch: [73], + build: [1, 3], + job: [2, 4, 5], + log: [1, 2], + message: [1, 2], + queueable_job: [1, 2], + repository: [2, 1], + request: [1, 2], + stage: [20], + tag: [1] + }, + filtered_out: { + annotation: [3, 4], + branch: [74], + build: [6, 8], + job: [9, 10, 7], + log: [3, 4], + queueable_job: [3, 4], + repository: [4, 3], + stage: [21], + tag: [2] + } + }) + end end end -end \ No newline at end of file +end diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 5e72a7c..a24a2d8 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -143,12 +143,6 @@ factory :build_with_safe_dependencies do after(:create) do |build| - create( - :tag, - last_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) create( :stage, build_id: build.id @@ -160,6 +154,12 @@ created_at: build.created_at, updated_at: build.updated_at ) + create( + :tag, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) create( :branch, repository_id: 2_000_000_000, From 8300c6f6beaacbec1443f4f2c91016373f238c85 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 6 Oct 2021 13:26:31 +0200 Subject: [PATCH 18/88] unused code removed, tests fixed --- lib/backup/remove_specified.rb | 15 --------------- spec/model_spec.rb | 8 +++----- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 814c7be..786e5d5 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -94,21 +94,6 @@ def filter_dependent_on_strangers!(ids_hash) ids_hash[:main] = Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) end - def filter_dependent_jobs!(ids_hash, builds_to_filter) - jobs_to_filter = Job.where(source_id: builds_to_filter, source_type: 'Build').map(&:id) - - jobs_to_filter.each do |id| - ids_hash[:main][:job].delete(id) - end - end - - def filter_dependent_stages!(ids_hash, builds_to_filter) - stages_to_filter = Stage.where(build_id: builds_to_filter).map(&:id) - stages_to_filter.each do |id| - ids_hash[:main][:stage].delete(id) - end - end - def get_builds_to_filter(ids_hash) builds_to_filter = [] diff --git a/spec/model_spec.rb b/spec/model_spec.rb index aa55eb3..7386575 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -6,15 +6,13 @@ require 'byebug' describe Model do - before(:all) do + before(:each) do BeforeTests.new.run end - describe 'ids_of_all_dependencies' do - let(:files_location) { "dump/tests" } - let!(:config) { Config.new(files_location: files_location, limit: 5) } + describe 'ids_of_all_dependencies' do + let!(:config) { Config.new(limit: 5) } let!(:db_helper) { DbHelper.new(config) } - let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } let!(:commit) { From 5d95d85f2aa59c71ebe52c689d412e74af9efda6 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 7 Oct 2021 10:36:36 +0200 Subject: [PATCH 19/88] wip --- lib/backup/remove_specified.rb | 75 ++++++++++++++++++++++++---- spec/backup/remove_specified_spec.rb | 4 +- spec/model_spec.rb | 2 +- spec/support/factories/user.rb | 5 ++ 4 files changed, 73 insertions(+), 13 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 786e5d5..b2a9ed6 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -73,25 +73,51 @@ def dependencies_to_filter def remove_user_with_dependencies(user_id) user = User.find(user_id) ids_of_all_dependencies = user.ids_of_all_dependencies(except: dependencies_to_filter) - filter_dependent_on_strangers!(ids_of_all_dependencies) + # puts ids_of_all_dependencies[:main][:build] + # puts '--' + # filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) + # remove_ids_present_in_main_from_filtered_out!(ids_of_all_dependencies) + + # puts ids_of_all_dependencies[:main][:build] + + remove_ids_from_hash(ids_of_all_dependencies[:main]) + + user.delete + end + + def remove_ids_present_in_main_from_filtered_out!(ids_hash) + ids_hash[:main].each do |name, ids| + ids.each do |id| + ids_hash[:filtered_out][name]&.delete(id) + end + end + end + + def remove_ids_from_hash(ids_hash) + # byebug + Build.delete(ids_hash[:build]) + ids_hash.each do |name, ids| + next if name == :build - ids_of_all_dependencies[:main].each do |name, ids| model = Utils.get_model(name) model.delete(ids) end - user.delete end - def filter_dependent_on_strangers!(ids_hash) - builds_to_filter = get_builds_to_filter(ids_hash) + def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) + builds = ids_of_all_dependencies[:main][:build] + return unless builds - hashes = builds_to_filter.map do |build| - build.ids_of_all_dependencies(only: dependencies_to_filter)[:main] + ids_to_filter = get_builds_to_filter(ids_of_all_dependencies) + ids_to_filter.each do |id| + builds.delete(id) end - joined_hashes = Utils.uniquely_join_hashes_of_arrays(*hashes) - ids_hash[:main] = Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) + filtered = ids_of_all_dependencies[:filtered_out] + filtered[:build] = [] if filtered[:build].nil? + filtered[:build].concat(ids_to_filter) + filtered[:build].uniq! end def get_builds_to_filter(ids_hash) @@ -109,9 +135,38 @@ def get_builds_to_filter(ids_hash) builds_to_filter.compact! builds_to_filter.uniq! - Build.where(id: builds_to_filter) end + + # def filter_dependent_on_strangers!(ids_hash) + # builds_to_filter = get_builds_to_filter(ids_hash) + + # hashes = builds_to_filter.map do |build| + # build.ids_of_all_dependencies(only: dependencies_to_filter)[:main] + # end + + # joined_hashes = Utils.uniquely_join_hashes_of_arrays(*hashes) + # ids_hash[:main] = Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) + # end + + # def get_builds_to_filter(ids_hash) + # builds_to_filter = [] + + # ids_hash[:filtered_out].each do |name, ids| + # model = Utils.get_model(name) + # model.where(id: ids).each do |instance| + # [:last_build_id, :current_build_id].each do |method| + # build_id = instance.try(method) + # builds_to_filter << build_id + # end + # end + # end + + # builds_to_filter.compact! + # builds_to_filter.uniq! + # Build.where(id: builds_to_filter) + # end + def remove_org_with_dependencies(org_id) end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index fa8adaf..8b510d6 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -345,10 +345,10 @@ } expect(hashes).to eql( - all: 768, + all: 786, logs: 56, jobs: 96, - builds: 72, + builds: 90, requests: 40, repositories: 108, branches: 62, diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 7386575..2521a2c 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -10,7 +10,7 @@ BeforeTests.new.run end - describe 'ids_of_all_dependencies' do + describe 'ids_of_all_dependencies' do let!(:config) { Config.new(limit: 5) } let!(:db_helper) { DbHelper.new(config) } let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index cbdf238..f0570fa 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -65,6 +65,11 @@ created_at: user.created_at, updated_at: user.updated_at ) + # repo = user.repositories.first + # repo.update(current_build_id: user.builds_for_that_this_user_is_owner.first.id) + # repo.update(last_build_id: user.builds_for_that_this_user_is_owner.second.id) + # puts user.builds_for_that_this_user_is_owner.first.id + # puts user.builds_for_that_this_user_is_owner.second.id create( :build_with_all_dependencies_and_sibling, sender_id: user.id, From 5d1437f85f923d58f241723d92814ac1bc7c2324 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 7 Oct 2021 11:32:05 +0200 Subject: [PATCH 20/88] old version of ids_of_all_dependencies --- lib/backup/remove_specified.rb | 2 +- lib/model.rb | 33 +++------------------- spec/model_spec.rb | 50 ++-------------------------------- 3 files changed, 7 insertions(+), 78 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index b2a9ed6..f0f07b0 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -72,7 +72,7 @@ def dependencies_to_filter def remove_user_with_dependencies(user_id) user = User.find(user_id) - ids_of_all_dependencies = user.ids_of_all_dependencies(except: dependencies_to_filter) + ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) # puts ids_of_all_dependencies[:main][:build] # puts '--' # filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) diff --git a/lib/model.rb b/lib/model.rb index 4fa35dd..09d114d 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -58,7 +58,8 @@ def get_grandchildren_hashes(context) to_filter = context[:to_filter] self.send(association.name).map do |model| - model.ids_of_all_dependencies(get_to_filter_for_children(**context)) + next if should_be_filtered?(**context) + model.ids_of_all_dependencies(to_filter) end.compact end @@ -68,34 +69,8 @@ def get_hash_to_use(result, context) end def should_be_filtered?(to_filter:, self_symbol:, association:) - return false if to_filter == :none - return true if to_filter == :all - - except_arr = to_filter[:except].try(:[], self_symbol) - only_arr = to_filter[:only].try(:[], self_symbol) - - if except_arr.present? - except_arr.any? { |a| a == association.name } - elsif to_filter[:only].present? - only_arr.class != Array || only_arr.none? { |a| a == association.name } - else - false - end - end - - def get_to_filter_for_children(to_filter:, self_symbol:, association:) - return to_filter if [:none, :all].include?(to_filter) - - except_arr = to_filter[:except].try(:[], self_symbol) - only_arr = to_filter[:only].try(:[], self_symbol) - - if except_arr.present? - return except_arr.any? { |a| a == association.name } ? :all : to_filter - elsif only_arr.present? - return only_arr.any? { |a| a == association.name } ? :none : to_filter - else - to_filter - end + arr = to_filter[self_symbol] + arr.present? && arr.any? { |a| a == association.name } end end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 2521a2c..7c34e27 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -44,49 +44,10 @@ end end - context 'when the only filter is given' do - it 'returns all dependencies ids in hash' do - filter = { - only: { - request: [ :jobs, :builds ] - } - } - expect(commit.ids_of_all_dependencies(filter)).to eql({ - filtered_out: { - abuse: [1, 2], - annotation: [1, 2], - branch: [73], - build: [1, 3], - job: [2, 4, 5], - log: [1, 2], - message: [1, 2], - queueable_job: [1, 2], - repository: [2, 1], - request: [1, 2], - stage: [20], - tag: [1] - }, - main: { - annotation: [3, 4], - branch: [74], - build: [6, 8], - job: [9, 10, 7], - log: [3, 4], - queueable_job: [3, 4], - repository: [4, 3], - stage: [21], - tag: [2] - } - }) - end - end - context 'when the except filter is given' do it 'returns all dependencies ids in hash' do filter = { - except: { - request: [ :jobs, :builds ] - } + request: [ :jobs, :builds ] } expect(commit.ids_of_all_dependencies(filter)).to eql({ main: { @@ -104,15 +65,8 @@ tag: [1] }, filtered_out: { - annotation: [3, 4], - branch: [74], build: [6, 8], - job: [9, 10, 7], - log: [3, 4], - queueable_job: [3, 4], - repository: [4, 3], - stage: [21], - tag: [2] + job: [9, 10] } }) end From 6c1666b0289939accc45a3f2d0567e6a292b90f7 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 7 Oct 2021 14:15:29 +0200 Subject: [PATCH 21/88] ids_of_all_dependencies starts filtering from parent of filtered associations --- lib/backup/remove_specified.rb | 40 ---------------------------- lib/model.rb | 32 +++++++++++++++------- spec/backup/remove_specified_spec.rb | 12 ++++----- spec/model_spec.rb | 7 ++--- 4 files changed, 30 insertions(+), 61 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index f0f07b0..6d925bf 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -73,15 +73,7 @@ def dependencies_to_filter def remove_user_with_dependencies(user_id) user = User.find(user_id) ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) - # puts ids_of_all_dependencies[:main][:build] - # puts '--' - # filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) - # remove_ids_present_in_main_from_filtered_out!(ids_of_all_dependencies) - - # puts ids_of_all_dependencies[:main][:build] - remove_ids_from_hash(ids_of_all_dependencies[:main]) - user.delete end @@ -94,7 +86,6 @@ def remove_ids_present_in_main_from_filtered_out!(ids_hash) end def remove_ids_from_hash(ids_hash) - # byebug Build.delete(ids_hash[:build]) ids_hash.each do |name, ids| next if name == :build @@ -102,7 +93,6 @@ def remove_ids_from_hash(ids_hash) model = Utils.get_model(name) model.delete(ids) end - end def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) @@ -137,36 +127,6 @@ def get_builds_to_filter(ids_hash) builds_to_filter.uniq! end - - # def filter_dependent_on_strangers!(ids_hash) - # builds_to_filter = get_builds_to_filter(ids_hash) - - # hashes = builds_to_filter.map do |build| - # build.ids_of_all_dependencies(only: dependencies_to_filter)[:main] - # end - - # joined_hashes = Utils.uniquely_join_hashes_of_arrays(*hashes) - # ids_hash[:main] = Utils.difference_of_two_hashes_of_arrays(ids_hash[:main], joined_hashes) - # end - - # def get_builds_to_filter(ids_hash) - # builds_to_filter = [] - - # ids_hash[:filtered_out].each do |name, ids| - # model = Utils.get_model(name) - # model.where(id: ids).each do |instance| - # [:last_build_id, :current_build_id].each do |method| - # build_id = instance.try(method) - # builds_to_filter << build_id - # end - # end - # end - - # builds_to_filter.compact! - # builds_to_filter.uniq! - # Build.where(id: builds_to_filter) - # end - def remove_org_with_dependencies(org_id) end diff --git a/lib/model.rb b/lib/model.rb index 09d114d..066ee25 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -23,17 +23,16 @@ def ids_of_all_dependencies_json module IdsOfAllDependencies def ids_of_all_dependencies(to_filter={}) result = { main: {}, filtered_out: {} } - self_symbol = self.class.name.underscore.to_sym self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, self_symbol: self_symbol, association: association } + context = { to_filter: to_filter, association: association } - self.send(association.name).map(&:id).map do |id| - hash_to_use = get_hash_to_use(result, context) + self.send(association.name).map do |associated_object| + hash_to_use = get_hash_to_use(result, **context, object: associated_object) hash_to_use[symbol] = [] if hash_to_use[symbol].nil? - hash_to_use[symbol] << id + hash_to_use[symbol] << associated_object.id end result = get_result_with_grandchildren_hashes(result, context) end @@ -57,9 +56,9 @@ def get_grandchildren_hashes(context) association = context[:association] to_filter = context[:to_filter] - self.send(association.name).map do |model| - next if should_be_filtered?(**context) - model.ids_of_all_dependencies(to_filter) + self.send(association.name).map do |associated_object| + next if should_be_filtered?(**context, object: associated_object) + associated_object.ids_of_all_dependencies(to_filter) end.compact end @@ -68,8 +67,21 @@ def get_hash_to_use(result, context) result[symbol] end - def should_be_filtered?(to_filter:, self_symbol:, association:) - arr = to_filter[self_symbol] + def should_be_filtered?(to_filter:, association:, object:) + symbol = association.klass.name.underscore.to_sym + + association.klass.reflect_on_all_associations.each do |association2| + next if association2.macro == :belongs_to + + context = { to_filter: to_filter, symbol: symbol, association: association2 } + return true if object.send(association2.name).any? && is_this_association_filtered(context) + end + + false + end + + def is_this_association_filtered(to_filter:, symbol:, association:) + arr = to_filter[symbol] arr.present? && arr.any? { |a| a == association.name } end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 8b510d6..905813c 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -345,9 +345,9 @@ } expect(hashes).to eql( - all: 786, - logs: 56, - jobs: 96, + all: 870, + logs: 64, + jobs: 134, builds: 90, requests: 40, repositories: 108, @@ -357,13 +357,13 @@ crons: 8, pull_requests: 8, ssl_keys: 8, - stages: 32, + stages: 54, stars: 8, permissions: 8, messages: 32, abuses: 32, - annotations: 56, - queueable_jobs: 56 + annotations: 64, + queueable_jobs: 64 ) end end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 7c34e27..33a9707 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -51,22 +51,19 @@ } expect(commit.ids_of_all_dependencies(filter)).to eql({ main: { - abuse: [1, 2], annotation: [1, 2], branch: [73], build: [1, 3], job: [2, 4, 5], log: [1, 2], - message: [1, 2], queueable_job: [1, 2], repository: [2, 1], - request: [1, 2], + request: [2], stage: [20], tag: [1] }, filtered_out: { - build: [6, 8], - job: [9, 10] + request: [1] } }) end From b32b70a1ae280c56a9e48996d1f0940c2b777f5a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 8 Oct 2021 14:40:52 +0200 Subject: [PATCH 22/88] move_wrongly_assigned_to_main --- lib/backup/remove_specified.rb | 3 +- lib/model.rb | 42 ++++++++++++++++++++++++++-- spec/backup/remove_specified_spec.rb | 6 ++-- spec/support/factories/user.rb | 10 +++---- 4 files changed, 48 insertions(+), 13 deletions(-) diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index 6d925bf..cf0bcf4 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -86,13 +86,14 @@ def remove_ids_present_in_main_from_filtered_out!(ids_hash) end def remove_ids_from_hash(ids_hash) - Build.delete(ids_hash[:build]) ids_hash.each do |name, ids| next if name == :build model = Utils.get_model(name) model.delete(ids) end + Build.delete(ids_hash[:build]) + # order important because of foreign key constraint between builds and repos end def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) diff --git a/lib/model.rb b/lib/model.rb index 066ee25..ddfdd7a 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -21,7 +21,13 @@ def ids_of_all_dependencies_json end module IdsOfAllDependencies - def ids_of_all_dependencies(to_filter={}) + def ids_of_all_dependencies(to_filter=nil) + ids_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) + return ids_hash unless to_filter + move_wrongly_assigned_to_main(to_filter, ids_hash) + end + + def ids_of_all_dependencies_without_reflection(to_filter) result = { main: {}, filtered_out: {} } self.class.reflect_on_all_associations.map do |association| @@ -42,6 +48,36 @@ def ids_of_all_dependencies(to_filter={}) private + def move_wrongly_assigned_to_main(to_filter, ids_hash) + ids_hash[:filtered_out].each do |model_symbol, array| + array.each do |id| + object = Utils.get_model(model_symbol).find(id) + move_object_to_main_if_necessary(to_filter[model_symbol], ids_hash, object) + end + end + ids_hash + end + + def move_object_to_main_if_necessary(associations_to_filter, ids_hash, object) + if should_object_be_moved?(associations_to_filter, ids_hash, object) + symbol = object.class.name.underscore.to_sym + ids_hash[:filtered_out][symbol].delete(object.id) + ids_hash[:main][symbol] = [] if ids_hash[:main][symbol].nil? + ids_hash[:main][symbol] << object.id + end + end + + def should_object_be_moved?(associations_to_filter, ids_hash, object) + associations_to_filter.map do |association| + associated = object.send(association) + + associated.to_a.empty? || associated.map do |associated_object| + class_symbol = associated_object.class.name.underscore.to_sym + ids_hash[:main][class_symbol]&.include?(associated_object.id) + end.reduce(:&) + end.reduce(:&) + end + def get_result_with_grandchildren_hashes(result, context) hashes = get_grandchildren_hashes(context) main = hashes.map { |hash| hash[:main] } @@ -58,7 +94,7 @@ def get_grandchildren_hashes(context) self.send(association.name).map do |associated_object| next if should_be_filtered?(**context, object: associated_object) - associated_object.ids_of_all_dependencies(to_filter) + associated_object.ids_of_all_dependencies_without_reflection(to_filter) end.compact end @@ -74,7 +110,7 @@ def should_be_filtered?(to_filter:, association:, object:) next if association2.macro == :belongs_to context = { to_filter: to_filter, symbol: symbol, association: association2 } - return true if object.send(association2.name).any? && is_this_association_filtered(context) + return true if object.send(association2.name).any? && is_this_association_filtered(**context) end false diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 905813c..b989667 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -313,10 +313,8 @@ updated_at: datetime ) } - it 'removes user with all his dependencies except those on current_build_id and last_build_id' do - db_helper.do_without_triggers do - remove_specified.remove_user_with_dependencies(user.id) - end + it 'removes user with all his dependencies with proper exceptions' do + remove_specified.remove_user_with_dependencies(user.id) rows_number = Model.subclasses.map do |subclass| subclass.all.size diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index f0570fa..560431b 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -65,11 +65,6 @@ created_at: user.created_at, updated_at: user.updated_at ) - # repo = user.repositories.first - # repo.update(current_build_id: user.builds_for_that_this_user_is_owner.first.id) - # repo.update(last_build_id: user.builds_for_that_this_user_is_owner.second.id) - # puts user.builds_for_that_this_user_is_owner.first.id - # puts user.builds_for_that_this_user_is_owner.second.id create( :build_with_all_dependencies_and_sibling, sender_id: user.id, @@ -77,6 +72,11 @@ created_at: user.created_at, updated_at: user.updated_at ) + + repo = user.repositories.first + repo.update(current_build_id: user.builds_for_that_this_user_is_owner.second.id) + repo.update(last_build_id: user.builds_for_that_this_user_is_sender.second.id) + create( :request_with_all_dependencies_and_sibling, sender_id: user.id, From 93485998b73690b4fc86ecf90a6b5e3031bdcd03 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 8 Oct 2021 17:48:20 +0200 Subject: [PATCH 23/88] refactoring --- lib/backup/remove_specified.rb | 253 +----------------- .../remove_specified/remove_heavy_data.rb | 165 ++++++++++++ .../remove_with_all_dependencies.rb | 80 ++++++ spec/backup/remove_specified_spec.rb | 48 ++-- spec/backup_spec.rb | 12 +- 5 files changed, 285 insertions(+), 273 deletions(-) create mode 100644 lib/backup/remove_specified/remove_heavy_data.rb create mode 100644 lib/backup/remove_specified/remove_with_all_dependencies.rb diff --git a/lib/backup/remove_specified.rb b/lib/backup/remove_specified.rb index cf0bcf4..6f13b5d 100644 --- a/lib/backup/remove_specified.rb +++ b/lib/backup/remove_specified.rb @@ -1,7 +1,13 @@ # frozen_string_literal: true +require 'backup/remove_specified/remove_with_all_dependencies' +require 'backup/remove_specified/remove_heavy_data' + class Backup class RemoveSpecified + include RemoveHeavyData + include RemoveWithAllDependencies + attr_reader :config def initialize(config, dry_run_reporter=nil) @@ -31,7 +37,7 @@ def run(args={}) def process_user(user_id) if @config.threshold - process_repos_for_owner(user_id, 'User') + remove_heavy_data_for_repos_owned_by(user_id, 'User') else remove_user_with_dependencies(user_id) end @@ -39,263 +45,24 @@ def process_user(user_id) def process_organization(org_id) if @config.threshold - process_repos_for_owner(org_id, 'Organization') + remove_heavy_data_for_repos_owned_by(org_id, 'Organization') else remove_org_with_dependencies(org_id) end end - def process_repos_for_owner(owner_id, owner_type) - Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| - process_repo(repository) - end - end - def process_repo_with_id(repo_id) if @config.threshold - process_repo(Repository.find(repo_id)) + remove_heavy_data_for_repo(Repository.find(repo_id)) else remove_repo_with_dependencies(repo_id) end end - def dependencies_to_filter - { - build: [ - :repos_for_that_this_build_is_current, - :repos_for_that_this_build_is_last, - :tags_for_that_this_build_is_last, - :branches_for_that_this_build_is_last - ] - } - end - - def remove_user_with_dependencies(user_id) - user = User.find(user_id) - ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) - remove_ids_from_hash(ids_of_all_dependencies[:main]) - user.delete - end - - def remove_ids_present_in_main_from_filtered_out!(ids_hash) - ids_hash[:main].each do |name, ids| - ids.each do |id| - ids_hash[:filtered_out][name]&.delete(id) - end - end - end - - def remove_ids_from_hash(ids_hash) - ids_hash.each do |name, ids| - next if name == :build - - model = Utils.get_model(name) - model.delete(ids) - end - Build.delete(ids_hash[:build]) - # order important because of foreign key constraint between builds and repos - end - - def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) - builds = ids_of_all_dependencies[:main][:build] - return unless builds - - ids_to_filter = get_builds_to_filter(ids_of_all_dependencies) - ids_to_filter.each do |id| - builds.delete(id) - end - - filtered = ids_of_all_dependencies[:filtered_out] - filtered[:build] = [] if filtered[:build].nil? - filtered[:build].concat(ids_to_filter) - filtered[:build].uniq! - end - - def get_builds_to_filter(ids_hash) - builds_to_filter = [] - - ids_hash[:filtered_out].each do |name, ids| - model = Utils.get_model(name) - model.where(id: ids).each do |instance| - [:last_build_id, :current_build_id].each do |method| - build_id = instance.try(method) - builds_to_filter << build_id - end - end - end - - builds_to_filter.compact! - builds_to_filter.uniq! - end - - def remove_org_with_dependencies(org_id) - - end - - def remove_repo_with_dependencies(repo_id) - - end - def process_all_repos Repository.order(:id).each do |repository| - process_repo(repository) - end - end - - def process_repo(repository) - process_repo_builds(repository) - process_repo_requests(repository) - end - - def process_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength - threshold = @config.threshold.to_i.months.ago.to_datetime - current_build_id = repository.current_build_id || -1 - repository.builds.where('created_at < ? and id != ?', threshold, current_build_id) - .in_batches(of: @config.limit.to_i).map do |builds_batch| - if @config.if_backup - file_prefix = "repository_#{repository.id}" - save_and_destroy_builds_batch(builds_batch, file_prefix) - else - destroy_builds_batch(builds_batch) - end - end.compact.reduce(&:&) - end - - def process_repo_requests(repository) - threshold = @config.threshold.to_i.months.ago.to_datetime - repository.requests.where('created_at < ?', threshold) - .in_batches(of: @config.limit.to_i).map do |requests_batch| - @config.if_backup ? save_and_destroy_requests_batch(requests_batch, repository) : destroy_requests_batch(requests_batch) - end.compact - end - - private - - def save_and_destroy_builds_batch(builds_batch, file_prefix) - builds_export = builds_batch.map(&:attributes) - - dependencies_saved = builds_batch.map do |build| - save_build_jobs_and_logs(build, file_prefix) - end.reduce(&:&) - - if dependencies_saved - file_name = "#{file_prefix}_builds_#{builds_batch.first.id}-#{builds_batch.last.id}.json" - pretty_json = JSON.pretty_generate(builds_export) - save_file(file_name, pretty_json) ? destroy_builds_batch(builds_batch) : false - else - false - end - end - - def save_build_jobs_and_logs(build, file_prefix) - build.jobs.in_batches(of: @config.limit.to_i).map do |jobs_batch| - file_prefix = "#{file_prefix}_build_#{build.id}" - save_jobs_batch(jobs_batch, file_prefix) - end.compact.reduce(&:&) - end - - def save_jobs_batch(jobs_batch, file_prefix) - jobs_export = jobs_batch.map(&:attributes) - - logs_saved = jobs_batch.map do |job| - save_job_logs(job, file_prefix) - end.reduce(&:&) - - if logs_saved - file_name = "#{file_prefix}_jobs_#{jobs_batch.first.id}-#{jobs_batch.last.id}.json" - pretty_json = JSON.pretty_generate(jobs_export) - save_file(file_name, pretty_json) - else - false - end - end - - def save_job_logs(job, file_prefix) - job.logs.in_batches(of: @config.limit.to_i).map do |logs_batch| - file_prefix = "#{file_prefix}_job_#{job.id}" - save_logs_batch(logs_batch, file_prefix) - end.compact.reduce(&:&) - end - - def save_logs_batch(logs_batch, file_prefix) - logs_export = logs_batch.map(&:attributes) - file_name = "#{file_prefix}_logs_#{logs_batch.first.id}-#{logs_batch.last.id}.json" - pretty_json = JSON.pretty_generate(logs_export) - save_file(file_name, pretty_json) - end - - def destroy_builds_batch(builds_batch) - return destroy_builds_batch_dry(builds_batch) if @config.dry_run - - builds_batch.each(&:destroy) - end - - def destroy_builds_batch_dry(builds_batch) - @dry_run_reporter.add_to_report(:builds, *builds_batch.map(&:id)) - - jobs_ids = builds_batch.map do |build| - build.jobs.map(&:id) || [] - end.flatten - - @dry_run_reporter.add_to_report(:jobs, *jobs_ids) - - logs_ids = builds_batch.map do |build| - build.jobs.map do |job| - job.logs.map(&:id) || [] - end.flatten || [] - end.flatten - - @dry_run_reporter.add_to_report(:logs, *logs_ids) - end - - def save_and_destroy_requests_batch(requests_batch, repository) - requests_export = export_requests(requests_batch) - file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" - pretty_json = JSON.pretty_generate(requests_export) - if save_file(file_name, pretty_json) - destroy_requests_batch(requests_batch) + remove_heavy_data_for_repo(repository) end - requests_export end - - def destroy_requests_batch(requests_batch) - return destroy_requests_batch_dry(requests_batch) if @config.dry_run - - requests_batch.each(&:destroy) - end - - def destroy_requests_batch_dry(requests_batch) - @dry_run_reporter.add_to_report(:requests, *requests_batch.map(&:id)) - end - - def save_file(file_name, content) # rubocop:disable Metrics/MethodLength - return true if @config.dry_run - - saved = false - begin - unless File.directory?(@config.files_location) - FileUtils.mkdir_p(@config.files_location) - end - - File.open(file_path(file_name), 'w') do |file| - file.write(content) - file.close - saved = true - end - rescue => e - print "Failed to save #{file_name}, error: #{e.inspect}\n" - end - saved - end - - def file_path(file_name) - "#{@config.files_location}/#{file_name}" - end - - def export_requests(requests) - requests.map do |request| - request.attributes - end - end end end diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb new file mode 100644 index 0000000..98a16c1 --- /dev/null +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +module RemoveHeavyData + def remove_heavy_data_for_repos_owned_by(owner_id, owner_type) + Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| + remove_heavy_data_for_repo(repository) + end + end + + def remove_heavy_data_for_repo(repository) + remove_repo_builds(repository) + remove_repo_requests(repository) + end + + def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + threshold = @config.threshold.to_i.months.ago.to_datetime + current_build_id = repository.current_build_id || -1 + repository.builds.where('created_at < ? and id != ?', threshold, current_build_id) + .in_batches(of: @config.limit.to_i).map do |builds_batch| + if @config.if_backup + file_prefix = "repository_#{repository.id}" + save_and_destroy_builds_batch(builds_batch, file_prefix) + else + destroy_builds_batch(builds_batch) + end + end.compact.reduce(&:&) + end + + def remove_repo_requests(repository) + threshold = @config.threshold.to_i.months.ago.to_datetime + repository.requests.where('created_at < ?', threshold) + .in_batches(of: @config.limit.to_i).map do |requests_batch| + @config.if_backup ? save_and_destroy_requests_batch(requests_batch, repository) : destroy_requests_batch(requests_batch) + end.compact + end + + private + + def save_and_destroy_builds_batch(builds_batch, file_prefix) + builds_export = builds_batch.map(&:attributes) + + dependencies_saved = builds_batch.map do |build| + save_build_jobs_and_logs(build, file_prefix) + end.reduce(&:&) + + if dependencies_saved + file_name = "#{file_prefix}_builds_#{builds_batch.first.id}-#{builds_batch.last.id}.json" + pretty_json = JSON.pretty_generate(builds_export) + save_file(file_name, pretty_json) ? destroy_builds_batch(builds_batch) : false + else + false + end + end + + def save_build_jobs_and_logs(build, file_prefix) + build.jobs.in_batches(of: @config.limit.to_i).map do |jobs_batch| + file_prefix = "#{file_prefix}_build_#{build.id}" + save_jobs_batch(jobs_batch, file_prefix) + end.compact.reduce(&:&) + end + + def save_jobs_batch(jobs_batch, file_prefix) + jobs_export = jobs_batch.map(&:attributes) + + logs_saved = jobs_batch.map do |job| + save_job_logs(job, file_prefix) + end.reduce(&:&) + + if logs_saved + file_name = "#{file_prefix}_jobs_#{jobs_batch.first.id}-#{jobs_batch.last.id}.json" + pretty_json = JSON.pretty_generate(jobs_export) + save_file(file_name, pretty_json) + else + false + end + end + + def save_job_logs(job, file_prefix) + job.logs.in_batches(of: @config.limit.to_i).map do |logs_batch| + file_prefix = "#{file_prefix}_job_#{job.id}" + save_logs_batch(logs_batch, file_prefix) + end.compact.reduce(&:&) + end + + def save_logs_batch(logs_batch, file_prefix) + logs_export = logs_batch.map(&:attributes) + file_name = "#{file_prefix}_logs_#{logs_batch.first.id}-#{logs_batch.last.id}.json" + pretty_json = JSON.pretty_generate(logs_export) + save_file(file_name, pretty_json) + end + + def destroy_builds_batch(builds_batch) + return destroy_builds_batch_dry(builds_batch) if @config.dry_run + + builds_batch.each(&:destroy) + end + + def destroy_builds_batch_dry(builds_batch) + @dry_run_reporter.add_to_report(:builds, *builds_batch.map(&:id)) + + jobs_ids = builds_batch.map do |build| + build.jobs.map(&:id) || [] + end.flatten + + @dry_run_reporter.add_to_report(:jobs, *jobs_ids) + + logs_ids = builds_batch.map do |build| + build.jobs.map do |job| + job.logs.map(&:id) || [] + end.flatten || [] + end.flatten + + @dry_run_reporter.add_to_report(:logs, *logs_ids) + end + + def save_and_destroy_requests_batch(requests_batch, repository) + requests_export = export_requests(requests_batch) + file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" + pretty_json = JSON.pretty_generate(requests_export) + if save_file(file_name, pretty_json) + destroy_requests_batch(requests_batch) + end + requests_export + end + + def destroy_requests_batch(requests_batch) + return destroy_requests_batch_dry(requests_batch) if @config.dry_run + + requests_batch.each(&:destroy) + end + + def destroy_requests_batch_dry(requests_batch) + @dry_run_reporter.add_to_report(:requests, *requests_batch.map(&:id)) + end + + def save_file(file_name, content) # rubocop:disable Metrics/MethodLength + return true if @config.dry_run + + saved = false + begin + unless File.directory?(@config.files_location) + FileUtils.mkdir_p(@config.files_location) + end + + File.open(file_path(file_name), 'w') do |file| + file.write(content) + file.close + saved = true + end + rescue => e + print "Failed to save #{file_name}, error: #{e.inspect}\n" + end + saved + end + + def file_path(file_name) + "#{@config.files_location}/#{file_name}" + end + + def export_requests(requests) + requests.map do |request| + request.attributes + end + end +end diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb new file mode 100644 index 0000000..a9a85b5 --- /dev/null +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module RemoveWithAllDependencies + def dependencies_to_filter + { + build: [ + :repos_for_that_this_build_is_current, + :repos_for_that_this_build_is_last, + :tags_for_that_this_build_is_last, + :branches_for_that_this_build_is_last + ] + } + end + + def remove_user_with_dependencies(user_id) + user = User.find(user_id) + ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) + remove_ids_from_hash(ids_of_all_dependencies[:main]) + user.delete + end + + def remove_ids_present_in_main_from_filtered_out!(ids_hash) + ids_hash[:main].each do |name, ids| + ids.each do |id| + ids_hash[:filtered_out][name]&.delete(id) + end + end + end + + def remove_ids_from_hash(ids_hash) + ids_hash.each do |name, ids| + next if name == :build + + model = Utils.get_model(name) + model.delete(ids) + end + Build.delete(ids_hash[:build]) + # order important because of foreign key constraint between builds and repos + end + + def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) + builds = ids_of_all_dependencies[:main][:build] + return unless builds + + ids_to_filter = get_builds_to_filter(ids_of_all_dependencies) + ids_to_filter.each do |id| + builds.delete(id) + end + + filtered = ids_of_all_dependencies[:filtered_out] + filtered[:build] = [] if filtered[:build].nil? + filtered[:build].concat(ids_to_filter) + filtered[:build].uniq! + end + + def get_builds_to_filter(ids_hash) + builds_to_filter = [] + + ids_hash[:filtered_out].each do |name, ids| + model = Utils.get_model(name) + model.where(id: ids).each do |instance| + [:last_build_id, :current_build_id].each do |method| + build_id = instance.try(method) + builds_to_filter << build_id + end + end + end + + builds_to_filter.compact! + builds_to_filter.uniq! + end + + def remove_org_with_dependencies(org_id) + + end + + def remove_repo_with_dependencies(repo_id) + + end +end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index b989667..10bcd70 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -23,23 +23,23 @@ let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } - describe 'process_repo' do + describe 'remove_heavy_data_for_repo' do let!(:repository) { FactoryBot.create(:repository) } it 'processes repository builds' do - expect(remove_specified).to receive(:process_repo_builds).once.with(repository) - remove_specified.process_repo(repository) + expect(remove_specified).to receive(:remove_repo_builds).once.with(repository) + remove_specified.remove_heavy_data_for_repo(repository) end it 'processes repository requests' do - expect(remove_specified).to receive(:process_repo_requests).once.with(repository) - remove_specified.process_repo(repository) + expect(remove_specified).to receive(:remove_repo_requests).once.with(repository) + remove_specified.remove_heavy_data_for_repo(repository) end end - describe 'process_repo_builds' do + describe 'remove_repo_builds' do after(:each) do Repository.destroy_all Build.destroy_all @@ -85,13 +85,13 @@ shared_context 'removing builds and jobs' do it 'should delete all builds of the repository' do - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) expect(Build.all.map(&:repository_id)).to eq([repository2.id]) end it 'should delete all jobs of removed builds and leave the rest' do expect { - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) }.to change { Job.all.size }.by -4 build_id = Build.first.id @@ -100,7 +100,7 @@ it 'should delete all logs of removed jobs and leave the rest' do expect { - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) }.to change { Log.all.size }.by -8 build_id = Build.first.id @@ -111,7 +111,7 @@ shared_context 'not saving JSON to file' do it 'should not save JSON to file' do expect(File).not_to receive(:open) - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end @@ -123,7 +123,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end @@ -137,7 +137,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end @@ -153,7 +153,7 @@ allow_instances: true, arguments_to_check: :first ) do - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end @@ -172,7 +172,7 @@ match_mode: :match, arguments_to_check: :first ) do - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end @@ -186,7 +186,7 @@ it 'should create needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) end end end @@ -207,19 +207,19 @@ it 'should not delete builds' do expect { - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) }.not_to change { Build.all.size } end it 'should not delete jobs' do expect { - remove_specified.process_repo_builds(repository) + remove_specified.remove_repo_builds(repository) }.not_to change { Job.all.size } end end end - describe 'process_repo_requests' do + describe 'remove_repo_requests' do after(:each) do Repository.destroy_all Request.destroy_all @@ -246,7 +246,7 @@ shared_context 'removing requests' do it 'should delete all requests of the repository' do - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) expect(Request.all.map(&:repository_id)).to eq([repository2.id]) end end @@ -254,19 +254,19 @@ shared_context 'not saving JSON to file' do it 'should not save JSON to file' do expect(File).not_to receive(:open) - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) end end context 'when if_backup config is set to true' do it 'should save proper build JSON to file' do expect_any_instance_of(File).to receive(:write).once.with(JSON.pretty_generate(expected_requests_json)) - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) end it 'should save JSON to file at proper path' do expect(File).to receive(:open).once.with(Regexp.new(files_location), 'w') - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) end it_behaves_like 'removing requests' @@ -278,7 +278,7 @@ it 'should create needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) end end end @@ -299,7 +299,7 @@ it 'should not delete requests' do expect { - remove_specified.process_repo_requests(repository) + remove_specified.remove_repo_requests(repository) }.not_to change { Request.all.size } end end diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index f0df059..45dbfc1 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -49,7 +49,7 @@ context 'when no id arguments are given' do it 'processes every repository' do Repository.all.each do |repository| - expect_any_instance_of(Backup::RemoveSpecified).to receive(:process_repo_builds).once.with(repository) + expect_any_instance_of(Backup::RemoveSpecified).to receive(:remove_repo_builds).once.with(repository) end backup.run end @@ -61,7 +61,7 @@ expect_method_calls_on( Backup::RemoveSpecified, - :process_repo_builds, + :remove_repo_builds, user_repos, allow_instances: true, arguments_to_check: :first @@ -77,7 +77,7 @@ expect_method_calls_on( Backup::RemoveSpecified, - :process_repo_builds, + :remove_repo_builds, org_repos, allow_instances: true, arguments_to_check: :first @@ -90,7 +90,7 @@ context 'when repo_id is given' do it 'processes only the repository with the given id' do repo = Repository.first - expect_any_instance_of(Backup::RemoveSpecified).to receive(:process_repo_builds).once.with(repo) + expect_any_instance_of(Backup::RemoveSpecified).to receive(:remove_repo_builds).once.with(repo) backup.run(repo_id: repo.id) end end @@ -144,7 +144,7 @@ let!(:backup) { Backup.new(files_location: files_location, limit: 5, move_logs: true) } it 'does not process repositories' do - expect(backup).not_to receive(:process_repo) + expect(backup).not_to receive(:remove_heavy_data_for_repo) backup.run end @@ -158,7 +158,7 @@ let!(:backup) { Backup.new(files_location: files_location, limit: 5, remove_orphans: true) } it 'does not process repositories' do - expect(backup).not_to receive(:process_repo) + expect(backup).not_to receive(:remove_heavy_data_for_repo) backup.run end From c16f454e87cf7da5b62416c8fd5f9586312f140d Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 8 Oct 2021 18:03:36 +0200 Subject: [PATCH 24/88] refactoring --- .../remove_specified/remove_heavy_data.rb | 36 +++---------------- .../remove_with_all_dependencies.rb | 4 +++ lib/backup/save_file.rb | 27 ++++++++++++++ 3 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 lib/backup/save_file.rb diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 98a16c1..c400601 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true +require 'backup/save_file' + module RemoveHeavyData + include SaveFile + def remove_heavy_data_for_repos_owned_by(owner_id, owner_type) Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| remove_heavy_data_for_repo(repository) @@ -114,7 +118,7 @@ def destroy_builds_batch_dry(builds_batch) end def save_and_destroy_requests_batch(requests_batch, repository) - requests_export = export_requests(requests_batch) + requests_export = requests_batch.map(&:attributes) file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" pretty_json = JSON.pretty_generate(requests_export) if save_file(file_name, pretty_json) @@ -132,34 +136,4 @@ def destroy_requests_batch(requests_batch) def destroy_requests_batch_dry(requests_batch) @dry_run_reporter.add_to_report(:requests, *requests_batch.map(&:id)) end - - def save_file(file_name, content) # rubocop:disable Metrics/MethodLength - return true if @config.dry_run - - saved = false - begin - unless File.directory?(@config.files_location) - FileUtils.mkdir_p(@config.files_location) - end - - File.open(file_path(file_name), 'w') do |file| - file.write(content) - file.close - saved = true - end - rescue => e - print "Failed to save #{file_name}, error: #{e.inspect}\n" - end - saved - end - - def file_path(file_name) - "#{@config.files_location}/#{file_name}" - end - - def export_requests(requests) - requests.map do |request| - request.attributes - end - end end diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index a9a85b5..8c8a304 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true +require 'backup/save_file' + module RemoveWithAllDependencies + include SaveFile + def dependencies_to_filter { build: [ diff --git a/lib/backup/save_file.rb b/lib/backup/save_file.rb new file mode 100644 index 0000000..6f2b1a5 --- /dev/null +++ b/lib/backup/save_file.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module SaveFile + def save_file(file_name, content) # rubocop:disable Metrics/MethodLength + return true if @config.dry_run + + saved = false + begin + unless File.directory?(@config.files_location) + FileUtils.mkdir_p(@config.files_location) + end + + File.open(file_path(file_name), 'w') do |file| + file.write(content) + file.close + saved = true + end + rescue => e + print "Failed to save #{file_name}, error: #{e.inspect}\n" + end + saved + end + + def file_path(file_name) + "#{@config.files_location}/#{file_name}" + end +end From 23817179c8baf1695fe1b47bd8a035058e88315f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 8 Oct 2021 18:16:40 +0200 Subject: [PATCH 25/88] refactoring, unused code removed --- .../remove_with_all_dependencies.rb | 72 +++++-------------- 1 file changed, 17 insertions(+), 55 deletions(-) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 8c8a304..963630c 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -5,6 +5,23 @@ module RemoveWithAllDependencies include SaveFile + def remove_user_with_dependencies(user_id) + user = User.find(user_id) + ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) + remove_ids_from_hash(ids_of_all_dependencies[:main]) + user.delete + end + + def remove_org_with_dependencies(org_id) + + end + + def remove_repo_with_dependencies(repo_id) + + end + + private + def dependencies_to_filter { build: [ @@ -16,21 +33,6 @@ def dependencies_to_filter } end - def remove_user_with_dependencies(user_id) - user = User.find(user_id) - ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) - remove_ids_from_hash(ids_of_all_dependencies[:main]) - user.delete - end - - def remove_ids_present_in_main_from_filtered_out!(ids_hash) - ids_hash[:main].each do |name, ids| - ids.each do |id| - ids_hash[:filtered_out][name]&.delete(id) - end - end - end - def remove_ids_from_hash(ids_hash) ids_hash.each do |name, ids| next if name == :build @@ -41,44 +43,4 @@ def remove_ids_from_hash(ids_hash) Build.delete(ids_hash[:build]) # order important because of foreign key constraint between builds and repos end - - def filter_builds_with_filtered_dependencies!(ids_of_all_dependencies) - builds = ids_of_all_dependencies[:main][:build] - return unless builds - - ids_to_filter = get_builds_to_filter(ids_of_all_dependencies) - ids_to_filter.each do |id| - builds.delete(id) - end - - filtered = ids_of_all_dependencies[:filtered_out] - filtered[:build] = [] if filtered[:build].nil? - filtered[:build].concat(ids_to_filter) - filtered[:build].uniq! - end - - def get_builds_to_filter(ids_hash) - builds_to_filter = [] - - ids_hash[:filtered_out].each do |name, ids| - model = Utils.get_model(name) - model.where(id: ids).each do |instance| - [:last_build_id, :current_build_id].each do |method| - build_id = instance.try(method) - builds_to_filter << build_id - end - end - end - - builds_to_filter.compact! - builds_to_filter.uniq! - end - - def remove_org_with_dependencies(org_id) - - end - - def remove_repo_with_dependencies(repo_id) - - end end From 90e7011c4dd0643191e0c6596c7846a8a5265748 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 11 Oct 2021 10:29:53 +0200 Subject: [PATCH 26/88] saving to file in remove_user_with_dependencies wip --- .../remove_with_all_dependencies.rb | 38 ++++++++++++++++-- lib/backup/save_file.rb | 28 +++++++++---- lib/model.rb | 40 ++++++++++++++++--- 3 files changed, 90 insertions(+), 16 deletions(-) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 963630c..82ecab5 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -6,10 +6,13 @@ module RemoveWithAllDependencies include SaveFile def remove_user_with_dependencies(user_id) + date = Time.now.to_s.parameterize.underscore + @subfolder = "user_#{user_id}_#{date}" user = User.find(user_id) - ids_of_all_dependencies = user.ids_of_all_dependencies(dependencies_to_filter) - remove_ids_from_hash(ids_of_all_dependencies[:main]) - user.delete + ids_to_remove = user.ids_of_all_dependencies(dependencies_to_filter)[:main] + ids_to_remove[:user] = [user_id] + save_ids_hash_to_file(ids_to_remove) + remove_ids_from_hash(ids_to_remove) end def remove_org_with_dependencies(org_id) @@ -22,6 +25,35 @@ def remove_repo_with_dependencies(repo_id) private + def save_ids_hash_to_file(ids_hash) + ids_hash.each do |name, ids| + ids.sort.each_slice(@config.limit.to_i) do |ids_batch| + save_ids_batch_to_file(name, ids_batch) + end + end + end + + def save_ids_batch_to_file(name, ids_batch) + model = Utils.get_model(name) + + export = {} + export[:table_name] = model.table_name + export[:data] = ids_batch.map do |id| + get_exported_object(model, id) + end + + content = JSON.pretty_generate(export) + file_name = "#{@subfolder}/#{name}_#{ids_batch.first}-#{ids_batch.last}.json" + save_file(file_name, content) + end + + def get_exported_object(model, id) + object = model.find(id) + result = object.attributes + result[:_dependencies_] = object.ids_of_all_direct_dependencies + result + end + def dependencies_to_filter { build: [ diff --git a/lib/backup/save_file.rb b/lib/backup/save_file.rb index 6f2b1a5..39ea579 100644 --- a/lib/backup/save_file.rb +++ b/lib/backup/save_file.rb @@ -1,27 +1,39 @@ # frozen_string_literal: true module SaveFile - def save_file(file_name, content) # rubocop:disable Metrics/MethodLength + def save_file(file_path, content) # rubocop:disable Metrics/MethodLength return true if @config.dry_run saved = false begin - unless File.directory?(@config.files_location) - FileUtils.mkdir_p(@config.files_location) - end + ensure_path(file_path) - File.open(file_path(file_name), 'w') do |file| + File.open(full_file_path(file_path), 'w') do |file| file.write(content) file.close saved = true end rescue => e - print "Failed to save #{file_name}, error: #{e.inspect}\n" + print "Failed to save #{file_path}, error: #{e.inspect}\n" end saved end - def file_path(file_name) - "#{@config.files_location}/#{file_name}" + def ensure_path(file_path) + path = folder_path(file_path) + + unless File.directory?(path) + FileUtils.mkdir_p(path) + end + end + + def full_file_path(file_path) + "#{@config.files_location}/#{file_path}" + end + + def folder_path(file_path) + result = full_file_path(file_path).split('/') + result.pop + result.join('/') end end diff --git a/lib/model.rb b/lib/model.rb index ddfdd7a..9cf1f8e 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -3,24 +3,55 @@ require 'active_record' require './utils' -module IdsOfAllDependenciesJson - def ids_of_all_dependencies_json +module IdsOfAllDirectDependencies + def ids_of_all_direct_dependencies result = {} + self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym self.send(association.name).map do |associated_object| result[symbol] = [] if result[symbol].nil? - result[symbol] << associated_object.ids_of_all_dependencies_json + result[symbol] << associated_object.id end end - result[:id] = "#{self.class.name.underscore}-#{id}" + + result + end +end + +module IdsOfAllDependenciesNested + def ids_of_all_dependencies_nested(depth = Float::INFINITY) + result = depth > 0 ? get_associations(depth) : {} + result[:id] = id result = result[:id] if result.size == 1 result end + + private + + def get_associations(depth) + result = {} + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + + symbol = association.klass.name.underscore.to_sym + self.send(association.name).map do |associated_object| + result[symbol] = [] if result[symbol].nil? + result[symbol] << associated_object.ids_of_all_dependencies_nested(depth - 1) + end + end + + result + end end module IdsOfAllDependencies + include IdsOfAllDependenciesNested + include IdsOfAllDirectDependencies + def ids_of_all_dependencies(to_filter=nil) ids_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) return ids_hash unless to_filter @@ -125,7 +156,6 @@ def is_this_association_filtered(to_filter:, symbol:, association:) # Model class class Model < ActiveRecord::Base include IdsOfAllDependencies - include IdsOfAllDependenciesJson self.abstract_class = true From d14d1497f446696c9d2f49e65d05a7c26f075e9e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 11 Oct 2021 23:47:07 +0200 Subject: [PATCH 27/88] saving to file in remove_user_with_dependencies works with tests --- spec/backup/move_logs_spec.rb | 2 - spec/backup/remove_orphans_spec.rb | 1 - spec/backup/remove_specified_spec.rb | 40 +++- spec/backup_spec.rb | 1 - .../abuse_14-26.json | 65 ++++++ .../abuse_27-47.json | 65 ++++++ .../abuse_48-52.json | 65 ++++++ .../abuse_9-13.json | 65 ++++++ .../annotation_17-21.json | 65 ++++++ .../annotation_22-26.json | 65 ++++++ .../annotation_27-31.json | 65 ++++++ .../annotation_32-52.json | 65 ++++++ .../annotation_53-89.json | 65 ++++++ .../annotation_90-94.json | 65 ++++++ .../branch_86-91.json | 47 ++++ .../broadcast_1-2.json | 31 +++ .../build_145-210.json | 168 +++++++++++++++ .../build_260-268.json | 104 +++++++++ .../build_50-70.json | 165 ++++++++++++++ .../build_75-140.json | 165 ++++++++++++++ .../commit_217-227.json | 141 ++++++++++++ .../commit_228-228.json | 25 +++ .../cron_3-4.json | 29 +++ .../email_9-10.json | 23 ++ .../invoice_1-4.json | 53 +++++ .../job_154-264.json | 196 +++++++++++++++++ .../job_265-272.json | 184 ++++++++++++++++ .../job_54-61.json | 196 +++++++++++++++++ .../job_62-72.json | 184 ++++++++++++++++ .../job_76-86.json | 196 +++++++++++++++++ .../job_87-150.json | 184 ++++++++++++++++ .../log_17-21.json | 85 ++++++++ .../log_22-26.json | 85 ++++++++ .../log_27-31.json | 85 ++++++++ .../log_32-52.json | 85 ++++++++ .../log_53-89.json | 85 ++++++++ .../log_90-94.json | 85 ++++++++ .../membership_1-2.json | 21 ++ .../message_14-26.json | 70 ++++++ .../message_27-47.json | 70 ++++++ .../message_48-50.json | 44 ++++ .../message_9-13.json | 70 ++++++ .../owner_group_1-2.json | 25 +++ .../permission_1-6.json | 45 ++++ .../pull_request_3-6.json | 41 ++++ .../queueable_job_17-21.json | 35 +++ .../queueable_job_22-26.json | 35 +++ .../queueable_job_27-31.json | 35 +++ .../queueable_job_32-52.json | 35 +++ .../queueable_job_53-89.json | 35 +++ .../queueable_job_90-94.json | 35 +++ .../repository_1-66.json | 103 +++++++++ .../request_11-15.json | 203 ++++++++++++++++++ .../request_16-30.json | 187 ++++++++++++++++ .../request_31-55.json | 203 ++++++++++++++++++ .../request_56-58.json | 111 ++++++++++ .../ssl_key_33-34.json | 25 +++ .../star_1-6.json | 41 ++++ .../subscription_1-2.json | 81 +++++++ .../tag_33-38.json | 39 ++++ .../token_9-10.json | 23 ++ .../trial_1-2.json | 39 ++++ .../trial_allowance_1-5.json | 65 ++++++ .../trial_allowance_6-6.json | 17 ++ .../user_9-9.json | 96 +++++++++ .../user_beta_feature_1-2.json | 25 +++ ...ed_files.rb => expected_files_provider.rb} | 2 +- spec/support/factories/branch.rb | 5 +- 68 files changed, 5140 insertions(+), 16 deletions(-) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_145-210.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_260-268.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_50-70.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_75-140.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/email_9-10.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_154-264.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_265-272.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_54-61.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_62-72.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_76-86.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_87-150.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_17-21.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_22-26.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_27-31.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_32-52.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_53-89.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_90-94.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/message_14-26.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/message_27-47.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/message_48-50.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/message_9-13.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/request_11-15.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/request_16-30.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/request_31-55.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/request_56-58.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/star_1-6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/token_9-10.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/user_9-9.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json rename spec/support/{expected_files.rb => expected_files_provider.rb} (99%) diff --git a/spec/backup/move_logs_spec.rb b/spec/backup/move_logs_spec.rb index 3ebf053..3ab6ab2 100644 --- a/spec/backup/move_logs_spec.rb +++ b/spec/backup/move_logs_spec.rb @@ -6,11 +6,9 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files' require 'support/before_tests' require 'pry' - describe Backup::MoveLogs do before(:all) do BeforeTests.new.run diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index 057919d..cafdb83 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -6,7 +6,6 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files' require 'support/before_tests' require 'pry' require 'database_cleaner/active_record' diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 10bcd70..76c7639 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -6,7 +6,7 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files' +require 'support/expected_files_provider' require 'support/before_tests' require 'support/utils' require 'pry' @@ -65,7 +65,7 @@ ) } let(:expected_files_creator) { - ExpectedFiles.new(repository, datetime) + ExpectedFilesProvider.new(repository, datetime) } let!(:expected_builds_json) { expected_files_creator.builds_json @@ -241,7 +241,7 @@ ) } let!(:expected_requests_json) { - ExpectedFiles.new(repository, datetime).requests_json + ExpectedFilesProvider.new(repository, datetime).requests_json } shared_context 'removing requests' do @@ -306,12 +306,18 @@ end describe 'remove_user_with_dependencies' do + before(:each) do + BeforeTests.new.run + end + let!(:user) { - FactoryBot.create( - :user_with_all_dependencies, - created_at: datetime, - updated_at: datetime - ) + db_helper.do_without_triggers do + FactoryBot.create( + :user_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + end } it 'removes user with all his dependencies with proper exceptions' do remove_specified.remove_user_with_dependencies(user.id) @@ -364,6 +370,24 @@ queueable_jobs: 64 ) end + + def get_expected_files(datetime) + Dir['spec/support/expected_files/**/*.json'].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end + end + + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files(datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_user_with_dependencies(user.id) + end + end end describe 'remove_org_with_dependencies' do diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index 45dbfc1..cab194c 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -6,7 +6,6 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files' require 'support/before_tests' require 'support/utils' require 'pry' diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json new file mode 100644 index 0000000..9477f45 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 14, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 14, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 15, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 16, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 25, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 26, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json new file mode 100644 index 0000000..c870c0a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 27, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 27, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 28, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 29, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 30, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 47, + "owner_id": null, + "owner_type": null, + "request_id": 55, + "level": 47, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json new file mode 100644 index 0000000..a16f78c --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 48, + "owner_id": null, + "owner_type": null, + "request_id": 55, + "level": 48, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 49, + "owner_id": null, + "owner_type": null, + "request_id": 57, + "level": 49, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 50, + "owner_id": null, + "owner_type": null, + "request_id": 57, + "level": 50, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 51, + "owner_id": 9, + "owner_type": "User", + "request_id": null, + "level": 51, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 52, + "owner_id": 9, + "owner_type": "User", + "request_id": null, + "level": 52, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json new file mode 100644 index 0000000..2963f6f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 9, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 9, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 10, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 11, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 12, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 13, + "reason": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json new file mode 100644 index 0000000..5a11a19 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 17, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json new file mode 100644 index 0000000..c708540 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 22, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json new file mode 100644 index 0000000..f1310fb --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 27, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json new file mode 100644 index 0000000..d8e5f2e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json new file mode 100644 index 0000000..c615ce3 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json new file mode 100644 index 0000000..f21ffa5 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 90, + "job_id": 264, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json new file mode 100644 index 0000000..79bf2fa --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json @@ -0,0 +1,47 @@ +{ + "table_name": "branches", + "data": [ + { + "id": 86, + "repository_id": 1, + "last_build_id": null, + "name": "branch_14", + "exists_on_github": true, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + "build": [ + 58, + 60 + ], + "commit": [ + 217, + 218 + ], + "cron": [ + 3, + 4 + ], + "job": [ + 61, + 62 + ], + "request": [ + 15, + 16 + ] + } + }, + { + "id": 91, + "repository_id": 1, + "last_build_id": null, + "name": "branch_19", + "exists_on_github": true, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json new file mode 100644 index 0000000..79ad768 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json @@ -0,0 +1,31 @@ +{ + "table_name": "broadcasts", + "data": [ + { + "id": 1, + "recipient_id": 9, + "recipient_type": "User", + "kind": null, + "message": null, + "expired": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "category": null, + "_dependencies_": { + } + }, + { + "id": 2, + "recipient_id": 9, + "recipient_type": "User", + "kind": null, + "message": null, + "expired": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "category": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json new file mode 100644 index 0000000..2a7ba9c --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json @@ -0,0 +1,168 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 153, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 158, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 33, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 210, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": 9, + "owner_type": "User", + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "repository": [ + 1 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json new file mode 100644 index 0000000..878c2fc --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json @@ -0,0 +1,104 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 260, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 9, + "sender_type": "User", + "_dependencies_": { + "repository": [ + 1 + ] + } + }, + { + "id": 263, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 268, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json new file mode 100644 index 0000000..923038e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 60, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 65, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": 217, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 70, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 13, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json new file mode 100644 index 0000000..5a16dec --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 85, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 137, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 140, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "config": null, + "commit_id": null, + "request_id": 29, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json new file mode 100644 index 0000000..66f0619 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json @@ -0,0 +1,141 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 217, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + "build": [ + 63, + 65 + ], + "job": [ + 66, + 67 + ], + "request": [ + 13, + 14 + ] + } + }, + { + "id": 218, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 219, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + "build": [ + 78, + 80 + ], + "job": [ + 81, + 82 + ], + "request": [ + 17, + 18 + ] + } + }, + { + "id": 220, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 227, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + "build": [ + 146, + 148 + ], + "job": [ + 149, + 150 + ], + "request": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json new file mode 100644 index 0000000..9b3733f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json @@ -0,0 +1,25 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 228, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json new file mode 100644 index 0000000..ddbd71d --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json @@ -0,0 +1,29 @@ +{ + "table_name": "crons", + "data": [ + { + "id": 3, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + }, + { + "id": 4, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json new file mode 100644 index 0000000..5df4282 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json @@ -0,0 +1,23 @@ +{ + "table_name": "emails", + "data": [ + { + "id": 9, + "user_id": 9, + "email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "user_id": 9, + "email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json new file mode 100644 index 0000000..76d0e35 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json @@ -0,0 +1,53 @@ +{ + "table_name": "invoices", + "data": [ + { + "id": 1, + "object": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "subscription_id": 1, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 2, + "object": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "subscription_id": 1, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 3, + "object": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "subscription_id": 2, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 4, + "object": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "subscription_id": 2, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json new file mode 100644 index 0000000..2bd2640 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 154, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 53, + 54 + ], + "annotation": [ + 53, + 54 + ], + "queueable_job": [ + 53, + 54 + ] + } + }, + { + "id": 155, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 159, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 55, + 56 + ], + "annotation": [ + 55, + 56 + ], + "queueable_job": [ + 55, + 56 + ] + } + }, + { + "id": 160, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 264, + "repository_id": null, + "commit_id": null, + "source_id": 55, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 89, + 90 + ], + "annotation": [ + 89, + 90 + ], + "queueable_job": [ + 89, + 90 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json new file mode 100644 index 0000000..a785b40 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 265, + "repository_id": null, + "commit_id": null, + "source_id": 55, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 269, + "repository_id": null, + "commit_id": null, + "source_id": 57, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 91, + 92 + ], + "annotation": [ + 91, + 92 + ], + "queueable_job": [ + 91, + 92 + ] + } + }, + { + "id": 270, + "repository_id": null, + "commit_id": null, + "source_id": 57, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 271, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": 9, + "owner_type": "User", + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 93, + 94 + ], + "annotation": [ + 93, + 94 + ], + "queueable_job": [ + 93, + 94 + ] + } + }, + { + "id": 272, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": 9, + "owner_type": "User", + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json new file mode 100644 index 0000000..79eb7bc --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 54, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 17, + 18 + ], + "annotation": [ + 17, + 18 + ], + "queueable_job": [ + 17, + 18 + ] + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 56, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 19, + 20 + ], + "annotation": [ + 19, + 20 + ], + "queueable_job": [ + 19, + 20 + ] + } + }, + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 21, + 22 + ], + "annotation": [ + 21, + 22 + ], + "queueable_job": [ + 21, + 22 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json new file mode 100644 index 0000000..ef6ff33 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 66, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 23, + 24 + ], + "annotation": [ + 23, + 24 + ], + "queueable_job": [ + 23, + 24 + ] + } + }, + { + "id": 67, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 71, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 25, + 26 + ], + "annotation": [ + 25, + 26 + ], + "queueable_job": [ + 25, + 26 + ] + } + }, + { + "id": 72, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json new file mode 100644 index 0000000..1c00e67 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 76, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 27, + 28 + ], + "annotation": [ + 27, + 28 + ], + "queueable_job": [ + 27, + 28 + ] + } + }, + { + "id": 77, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 81, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 29, + 30 + ], + "annotation": [ + 29, + 30 + ], + "queueable_job": [ + 29, + 30 + ] + } + }, + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 31, + 32 + ], + "annotation": [ + 31, + 32 + ], + "queueable_job": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json new file mode 100644 index 0000000..ba6a06e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 49, + 50 + ], + "annotation": [ + 49, + 50 + ], + "queueable_job": [ + 49, + 50 + ] + } + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 149, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 51, + 52 + ], + "annotation": [ + 51, + 52 + ], + "queueable_job": [ + 51, + 52 + ] + } + }, + { + "id": 150, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json new file mode 100644 index 0000000..3c5f5f5 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 17, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json new file mode 100644 index 0000000..f751aba --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 22, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json new file mode 100644 index 0000000..af11591 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 27, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json new file mode 100644 index 0000000..d86c446 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json new file mode 100644 index 0000000..9d21497 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 53, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json new file mode 100644 index 0000000..73f9645 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 90, + "job_id": 264, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json new file mode 100644 index 0000000..bdaf17f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json @@ -0,0 +1,21 @@ +{ + "table_name": "memberships", + "data": [ + { + "id": 1, + "organization_id": null, + "user_id": 9, + "role": null, + "_dependencies_": { + } + }, + { + "id": 2, + "organization_id": null, + "user_id": 9, + "role": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json new file mode 100644 index 0000000..fd17fae --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 14, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json new file mode 100644 index 0000000..125ea17 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 27, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 47, + "subject_id": 55, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json new file mode 100644 index 0000000..57713c1 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json @@ -0,0 +1,44 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 48, + "subject_id": 55, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 49, + "subject_id": 57, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 50, + "subject_id": 57, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json new file mode 100644 index 0000000..20d7819 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 9, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json new file mode 100644 index 0000000..4beed44 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json @@ -0,0 +1,25 @@ +{ + "table_name": "owner_groups", + "data": [ + { + "id": 1, + "uuid": null, + "owner_id": 9, + "owner_type": "User", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 2, + "uuid": null, + "owner_id": 9, + "owner_type": "User", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json new file mode 100644 index 0000000..218839b --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json @@ -0,0 +1,45 @@ +{ + "table_name": "permissions", + "data": [ + { + "id": 1, + "user_id": 9, + "repository_id": null, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + }, + { + "id": 2, + "user_id": 9, + "repository_id": null, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + }, + { + "id": 5, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + }, + { + "id": 6, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json new file mode 100644 index 0000000..267baa7 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json @@ -0,0 +1,41 @@ +{ + "table_name": "pull_requests", + "data": [ + { + "id": 3, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + "request": [ + 29, + 30 + ], + "build": [ + 88, + 137 + ] + } + }, + { + "id": 6, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json new file mode 100644 index 0000000..281cd6a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 17, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json new file mode 100644 index 0000000..be28310 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 22, + "job_id": 61, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json new file mode 100644 index 0000000..f288927 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 27, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json new file mode 100644 index 0000000..9bd6198 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 32, + "job_id": 86, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json new file mode 100644 index 0000000..afeb7f3 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 53, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json new file mode 100644 index 0000000..ebfff7c --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 90, + "job_id": 264, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json new file mode 100644 index 0000000..ee79230 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json @@ -0,0 +1,103 @@ +{ + "table_name": "repositories", + "data": [ + { + "id": 1, + "name": null, + "url": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-10-11 21:34:11 UTC", + "last_build_id": 260, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": 9, + "owner_type": "User", + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": 210, + "_dependencies_": { + "build": [ + 1, + 50 + ], + "request": [ + 11, + 12 + ], + "job": [ + 56, + 57 + ], + "branch": [ + 86, + 91 + ], + "ssl_key": [ + 33, + 34 + ], + "commit": [ + 219, + 220 + ], + "permission": [ + 5, + 6 + ], + "star": [ + 5, + 6 + ], + "pull_request": [ + 3, + 6 + ], + "tag": [ + 33, + 38 + ] + } + }, + { + "id": 66, + "name": null, + "url": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": 9, + "owner_type": "User", + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json new file mode 100644 index 0000000..4b11109 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json @@ -0,0 +1,203 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 11, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 9, + 10 + ], + "message": [ + 9, + 10 + ], + "job": [ + 54, + 55 + ], + "build": [ + 51, + 53 + ] + } + }, + { + "id": 12, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 13, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 11, + 12 + ], + "message": [ + 11, + 12 + ], + "job": [ + 71, + 72 + ], + "build": [ + 68, + 70 + ] + } + }, + { + "id": 14, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 15, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 13, + 14 + ], + "message": [ + 13, + 14 + ], + "job": [ + 76, + 77 + ], + "build": [ + 73, + 75 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json new file mode 100644 index 0000000..9b4ac95 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json @@ -0,0 +1,187 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 16, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 17, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 15, + 16 + ], + "message": [ + 15, + 16 + ], + "job": [ + 86, + 87 + ], + "build": [ + 83, + 85 + ] + } + }, + { + "id": 18, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 29, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 25, + 26 + ], + "message": [ + 25, + 26 + ], + "job": [ + 141, + 142 + ], + "build": [ + 138, + 140 + ] + } + }, + { + "id": 30, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json new file mode 100644 index 0000000..6706a50 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json @@ -0,0 +1,203 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 31, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 27, + 28 + ], + "message": [ + 27, + 28 + ], + "job": [ + 154, + 155 + ], + "build": [ + 151, + 153 + ] + } + }, + { + "id": 32, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 33, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 29, + 30 + ], + "message": [ + 29, + 30 + ], + "job": [ + 159, + 160 + ], + "build": [ + 156, + 158 + ] + } + }, + { + "id": 34, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 9, + "sender_type": "User", + "_dependencies_": { + "abuse": [ + 47, + 48 + ], + "message": [ + 47, + 48 + ], + "job": [ + 264, + 265 + ], + "build": [ + 261, + 263 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json new file mode 100644 index 0000000..eb9276a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json @@ -0,0 +1,111 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 56, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 9, + "sender_type": "User", + "_dependencies_": { + } + }, + { + "id": 57, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": 9, + "owner_type": "User", + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 49, + 50 + ], + "message": [ + 49, + 50 + ], + "job": [ + 269, + 270 + ], + "build": [ + 266, + 268 + ] + } + }, + { + "id": 58, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": 9, + "owner_type": "User", + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json new file mode 100644 index 0000000..6474e2b --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "ssl_keys", + "data": [ + { + "id": 33, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 34, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json new file mode 100644 index 0000000..e12f702 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json @@ -0,0 +1,41 @@ +{ + "table_name": "stars", + "data": [ + { + "id": 1, + "repository_id": null, + "user_id": 9, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 2, + "repository_id": null, + "user_id": 9, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 5, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 6, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json new file mode 100644 index 0000000..9562c8f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json @@ -0,0 +1,81 @@ +{ + "table_name": "subscriptions", + "data": [ + { + "id": 1, + "cc_token": null, + "valid_to": null, + "owner_id": 9, + "owner_type": "User", + "first_name": null, + "last_name": null, + "company": null, + "zip_code": null, + "address": null, + "address2": null, + "city": null, + "state": null, + "country": null, + "vat_id": null, + "customer_id": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "cc_owner": null, + "cc_last_digits": null, + "cc_expiration_date": null, + "billing_email": null, + "selected_plan": null, + "coupon": null, + "contact_id": null, + "canceled_at": null, + "canceled_by_id": null, + "status": null, + "source": "unknown", + "concurrency": null, + "_dependencies_": { + "invoice": [ + 1, + 2 + ] + } + }, + { + "id": 2, + "cc_token": null, + "valid_to": null, + "owner_id": 9, + "owner_type": "User", + "first_name": null, + "last_name": null, + "company": null, + "zip_code": null, + "address": null, + "address2": null, + "city": null, + "state": null, + "country": null, + "vat_id": null, + "customer_id": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "cc_owner": null, + "cc_last_digits": null, + "cc_expiration_date": null, + "billing_email": null, + "selected_plan": null, + "coupon": null, + "contact_id": null, + "canceled_at": null, + "canceled_by_id": null, + "status": null, + "source": "unknown", + "concurrency": null, + "_dependencies_": { + "invoice": [ + 3, + 4 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json new file mode 100644 index 0000000..34e32af --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json @@ -0,0 +1,39 @@ +{ + "table_name": "tags", + "data": [ + { + "id": 33, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + "build": [ + 143, + 145 + ], + "commit": [ + 227, + 228 + ], + "request": [ + 33, + 34 + ] + } + }, + { + "id": 38, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json new file mode 100644 index 0000000..cf5f1c6 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json @@ -0,0 +1,23 @@ +{ + "table_name": "tokens", + "data": [ + { + "id": 9, + "user_id": 9, + "token": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "user_id": 9, + "token": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json new file mode 100644 index 0000000..b927f8e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json @@ -0,0 +1,39 @@ +{ + "table_name": "trials", + "data": [ + { + "id": 1, + "owner_id": 9, + "owner_type": "User", + "chartmogul_customer_uuids": [ + + ], + "status": "new", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + "trial_allowance": [ + 1, + 2 + ] + } + }, + { + "id": 2, + "owner_id": 9, + "owner_type": "User", + "chartmogul_customer_uuids": [ + + ], + "status": "new", + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + "trial_allowance": [ + 3, + 4 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json new file mode 100644 index 0000000..3e0791f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json @@ -0,0 +1,65 @@ +{ + "table_name": "trial_allowances", + "data": [ + { + "id": 1, + "trial_id": 1, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 2, + "trial_id": 1, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 3, + "trial_id": 2, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 4, + "trial_id": 2, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + }, + { + "id": 5, + "trial_id": null, + "creator_id": 9, + "creator_type": "User", + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json new file mode 100644 index 0000000..e2320c2 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json @@ -0,0 +1,17 @@ +{ + "table_name": "trial_allowances", + "data": [ + { + "id": 6, + "trial_id": null, + "creator_id": 9, + "creator_type": "User", + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json new file mode 100644 index 0000000..9274400 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json @@ -0,0 +1,96 @@ +{ + "table_name": "users", + "data": [ + { + "id": 9, + "name": null, + "login": null, + "email": null, + "created_at": "2021-03-11 22:34:07 UTC", + "updated_at": "2021-03-11 22:34:07 UTC", + "is_admin": false, + "github_id": null, + "github_oauth_token": null, + "gravatar_id": null, + "locale": null, + "is_syncing": null, + "synced_at": null, + "github_scopes": null, + "education": null, + "first_logged_in_at": null, + "avatar_url": null, + "suspended": false, + "suspended_at": null, + "_dependencies_": { + "build": [ + 161, + 210, + 211, + 260 + ], + "repository": [ + 66, + 1 + ], + "job": [ + 271, + 272 + ], + "request": [ + 57, + 58, + 55, + 56 + ], + "abuse": [ + 51, + 52 + ], + "subscription": [ + 1, + 2 + ], + "owner_group": [ + 1, + 2 + ], + "trial": [ + 1, + 2 + ], + "trial_allowance": [ + 5, + 6 + ], + "broadcast": [ + 1, + 2 + ], + "star": [ + 1, + 2 + ], + "permission": [ + 1, + 2 + ], + "token": [ + 9, + 10 + ], + "email": [ + 9, + 10 + ], + "membership": [ + 1, + 2 + ], + "user_beta_feature": [ + 1, + 2 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json new file mode 100644 index 0000000..8db628b --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json @@ -0,0 +1,25 @@ +{ + "table_name": "user_beta_features", + "data": [ + { + "id": 1, + "user_id": 9, + "beta_feature_id": null, + "enabled": null, + "last_deactivated_at": null, + "last_activated_at": null, + "_dependencies_": { + } + }, + { + "id": 2, + "user_id": 9, + "beta_feature_id": null, + "enabled": null, + "last_deactivated_at": null, + "last_activated_at": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files.rb b/spec/support/expected_files_provider.rb similarity index 99% rename from spec/support/expected_files.rb rename to spec/support/expected_files_provider.rb index 74c82cb..efbced2 100644 --- a/spec/support/expected_files.rb +++ b/spec/support/expected_files_provider.rb @@ -1,4 +1,4 @@ -class ExpectedFiles +class ExpectedFilesProvider def initialize(repository, datetime) @repository = repository @datetime = datetime diff --git a/spec/support/factories/branch.rb b/spec/support/factories/branch.rb index f1e00b9..dd43fb4 100644 --- a/spec/support/factories/branch.rb +++ b/spec/support/factories/branch.rb @@ -5,7 +5,7 @@ FactoryBot.define do factory :branch do - name { "branch_#{Time.now.to_f}" } + sequence(:name) { |n| "branch_#{n}" } factory :branch_orphaned_on_repository_id do repository_id { 2_000_000_000 } @@ -59,8 +59,7 @@ factory :branch_with_all_dependencies_and_sibling do after(:create) do |branch| create(:branch, { - **branch.attributes_without_id.symbolize_keys.reject {|k, v| k == :name}, - name: "branch_#{Time.now.to_f}_2" + **branch.attributes_without_id.symbolize_keys.reject {|k, v| k == :name} }) end end From 0cde4e799c3471cf617dd6f880bf9fa575793913 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 00:51:18 +0200 Subject: [PATCH 28/88] removing organizations wip --- .../remove_with_all_dependencies.rb | 14 +- lib/models/organization.rb | 14 ++ lib/models/user.rb | 1 - lib/utils.rb | 6 + spec/backup/remove_specified_spec.rb | 89 +++++++- .../abuse_14-26.json | 65 ++++++ .../abuse_27-47.json | 65 ++++++ .../abuse_48-52.json | 65 ++++++ .../abuse_9-13.json | 65 ++++++ .../annotation_17-21.json | 65 ++++++ .../annotation_22-26.json | 65 ++++++ .../annotation_27-31.json | 65 ++++++ .../annotation_32-52.json | 65 ++++++ .../annotation_53-89.json | 65 ++++++ .../annotation_90-94.json | 65 ++++++ .../branch_86-91.json | 47 ++++ .../broadcast_1-2.json | 31 +++ .../build_145-210.json | 168 +++++++++++++++ .../build_260-268.json | 104 +++++++++ .../build_50-70.json | 165 ++++++++++++++ .../build_75-140.json | 165 ++++++++++++++ .../commit_217-227.json | 141 ++++++++++++ .../commit_228-228.json | 25 +++ .../cron_3-4.json | 29 +++ .../invoice_1-4.json | 53 +++++ .../job_154-264.json | 196 +++++++++++++++++ .../job_265-272.json | 184 ++++++++++++++++ .../job_54-61.json | 196 +++++++++++++++++ .../job_62-72.json | 184 ++++++++++++++++ .../job_76-86.json | 196 +++++++++++++++++ .../job_87-150.json | 184 ++++++++++++++++ .../log_17-21.json | 85 ++++++++ .../log_22-26.json | 85 ++++++++ .../log_27-31.json | 85 ++++++++ .../log_32-52.json | 85 ++++++++ .../log_53-89.json | 85 ++++++++ .../log_90-94.json | 85 ++++++++ .../membership_1-2.json | 21 ++ .../message_14-26.json | 70 ++++++ .../message_27-47.json | 70 ++++++ .../message_48-50.json | 44 ++++ .../message_9-13.json | 70 ++++++ .../organization_1-1.json | 69 ++++++ .../owner_group_1-2.json | 25 +++ .../permission_3-4.json | 25 +++ .../pull_request_3-6.json | 41 ++++ .../queueable_job_17-21.json | 35 +++ .../queueable_job_22-26.json | 35 +++ .../queueable_job_27-31.json | 35 +++ .../queueable_job_32-52.json | 35 +++ .../queueable_job_53-89.json | 35 +++ .../queueable_job_90-94.json | 35 +++ .../repository_1-66.json | 103 +++++++++ .../request_11-15.json | 203 ++++++++++++++++++ .../request_16-30.json | 187 ++++++++++++++++ .../request_31-55.json | 203 ++++++++++++++++++ .../request_56-58.json | 111 ++++++++++ .../ssl_key_33-34.json | 25 +++ .../star_3-4.json | 23 ++ .../subscription_1-2.json | 81 +++++++ .../tag_33-38.json | 39 ++++ .../trial_1-2.json | 39 ++++ .../trial_allowance_1-5.json | 65 ++++++ .../trial_allowance_6-6.json | 17 ++ spec/support/factories/organization.rb | 98 +++++++++ spec/support/utils.rb | 5 + 66 files changed, 5186 insertions(+), 10 deletions(-) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_145-210.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_260-268.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_50-70.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_75-140.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_154-264.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_265-272.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_54-61.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_62-72.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_76-86.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_87-150.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_17-21.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_22-26.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_27-31.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_32-52.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_53-89.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_90-94.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/message_14-26.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/message_27-47.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/message_48-50.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/message_9-13.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/request_11-15.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/request_16-30.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/request_31-55.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/request_56-58.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/star_3-4.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 82ecab5..e612d14 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -6,7 +6,7 @@ module RemoveWithAllDependencies include SaveFile def remove_user_with_dependencies(user_id) - date = Time.now.to_s.parameterize.underscore + date = actual_time_for_subfolder @subfolder = "user_#{user_id}_#{date}" user = User.find(user_id) ids_to_remove = user.ids_of_all_dependencies(dependencies_to_filter)[:main] @@ -16,7 +16,13 @@ def remove_user_with_dependencies(user_id) end def remove_org_with_dependencies(org_id) - + date = actual_time_for_subfolder + @subfolder = "organization_#{org_id}_#{date}" + organization = Organization.find(org_id) + ids_to_remove = organization.ids_of_all_dependencies(dependencies_to_filter)[:main] + ids_to_remove[:organization] = [org_id] + save_ids_hash_to_file(ids_to_remove) + remove_ids_from_hash(ids_to_remove) end def remove_repo_with_dependencies(repo_id) @@ -25,6 +31,10 @@ def remove_repo_with_dependencies(repo_id) private + def actual_time_for_subfolder + Time.now.to_s.parameterize.underscore + end + def save_ids_hash_to_file(ids_hash) ids_hash.each do |name, ids| ids.sort.each_slice(@config.limit.to_i) do |ids_batch| diff --git a/lib/models/organization.rb b/lib/models/organization.rb index 6391f84..5e1b383 100644 --- a/lib/models/organization.rb +++ b/lib/models/organization.rb @@ -3,5 +3,19 @@ require 'model' class Organization < Model + has_many :builds_for_that_this_organization_is_owner, as: :owner, class_name: 'Build' + has_many :builds_for_that_this_organization_is_sender, as: :sender, class_name: 'Build' + has_many :repositories, as: :owner + has_many :jobs, as: :owner + has_many :requests_for_that_this_organization_is_owner, as: :owner, class_name: 'Request' + has_many :abuses, as: :owner + has_many :subscriptions, as: :owner + has_many :owner_groups, as: :owner + has_many :trials, as: :owner + has_many :trial_allowances, as: :creator + has_many :broadcasts, as: :recipient + has_many :requests_for_that_this_organization_is_sender, as: :sender, class_name: 'Request' + has_many :memberships + self.table_name = 'organizations' end diff --git a/lib/models/user.rb b/lib/models/user.rb index 2266cfe..74f3c93 100644 --- a/lib/models/user.rb +++ b/lib/models/user.rb @@ -23,6 +23,5 @@ class User < Model has_many :memberships has_many :user_beta_features - self.table_name = 'users' end diff --git a/lib/utils.rb b/lib/utils.rb index fa882bb..4066053 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -38,4 +38,10 @@ def self.difference_of_two_hashes_of_arrays(hash1, hash2) def self.get_model(name) Model.subclasses.find{ |m| m.name == name.to_s.camelcase } end + + def self.get_sum_of_rows_of_all_models + Model.subclasses.map do |subclass| + subclass.all.size + end.reduce(:+) + end end \ No newline at end of file diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 76c7639..13bc9f6 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -319,15 +319,12 @@ ) end } + it 'removes user with all his dependencies with proper exceptions' do remove_specified.remove_user_with_dependencies(user.id) - rows_number = Model.subclasses.map do |subclass| - subclass.all.size - end.reduce(:+) - hashes = { - all: rows_number, + all: Utils.get_sum_of_rows_of_all_models, logs: Log.all.size, jobs: Job.all.size, builds: Build.all.size, @@ -372,7 +369,7 @@ end def get_expected_files(datetime) - Dir['spec/support/expected_files/**/*.json'].map do |file_path| + Dir['spec/support/expected_files/remove_user_with_dependencies/*.json'].map do |file_path| content = File.read(file_path) content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") end @@ -391,7 +388,85 @@ def get_expected_files(datetime) end describe 'remove_org_with_dependencies' do - + before(:each) do + BeforeTests.new.run + end + + let!(:organization) { + db_helper.do_without_triggers do + FactoryBot.create( + :organization_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + end + } + + it 'removes organization with all its dependencies with proper exceptions' do + remove_specified.remove_org_with_dependencies(organization.id) + + hashes = { + all: Utils.get_sum_of_rows_of_all_models, + logs: Log.all.size, + jobs: Job.all.size, + builds: Build.all.size, + requests: Request.all.size, + repositories: Repository.all.size, + branches: Branch.all.size, + tags: Tag.all.size, + commits: Commit.all.size, + crons: Cron.all.size, + pull_requests: PullRequest.all.size, + ssl_keys: SslKey.all.size, + stages: Stage.all.size, + stars: Star.all.size, + permissions: Permission.all.size, + messages: Message.all.size, + abuses: Abuse.all.size, + annotations: Annotation.all.size, + queueable_jobs: QueueableJob.all.size + } + + expect(hashes).to eql( + all: 870, + logs: 64, + jobs: 134, + builds: 90, + requests: 40, + repositories: 108, + branches: 62, + tags: 62, + commits: 24, + crons: 8, + pull_requests: 8, + ssl_keys: 8, + stages: 54, + stars: 8, + permissions: 8, + messages: 32, + abuses: 32, + annotations: 64, + queueable_jobs: 64 + ) + end + + def get_expected_files(datetime) + Dir['spec/support/expected_files/remove_org_with_dependencies/*.json'].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end + end + + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files(datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_org_with_dependencies(organization.id) + end + end end describe 'remove_repo_with_dependencies' do diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json new file mode 100644 index 0000000..68464f7 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 14, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 14, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 15, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 16, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 25, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 26, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json new file mode 100644 index 0000000..cb76f4e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 27, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 27, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 28, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 29, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 30, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 47, + "owner_id": null, + "owner_type": null, + "request_id": 55, + "level": 47, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json new file mode 100644 index 0000000..c2d6d74 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 48, + "owner_id": null, + "owner_type": null, + "request_id": 55, + "level": 48, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 49, + "owner_id": null, + "owner_type": null, + "request_id": 57, + "level": 49, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 50, + "owner_id": null, + "owner_type": null, + "request_id": 57, + "level": 50, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 51, + "owner_id": 1, + "owner_type": "Organization", + "request_id": null, + "level": 51, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 52, + "owner_id": 1, + "owner_type": "Organization", + "request_id": null, + "level": 52, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json new file mode 100644 index 0000000..62199a3 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 9, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 9, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 10, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 11, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 12, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 13, + "reason": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json new file mode 100644 index 0000000..5dc2009 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 17, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json new file mode 100644 index 0000000..fae3b64 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 22, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json new file mode 100644 index 0000000..b38d809 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 27, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json new file mode 100644 index 0000000..891ac4f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json new file mode 100644 index 0000000..8b069ce --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json new file mode 100644 index 0000000..8ac2fcd --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 90, + "job_id": 264, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json new file mode 100644 index 0000000..e773a6b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -0,0 +1,47 @@ +{ + "table_name": "branches", + "data": [ + { + "id": 86, + "repository_id": 1, + "last_build_id": null, + "name": "branch_14", + "exists_on_github": true, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + "build": [ + 58, + 60 + ], + "commit": [ + 217, + 218 + ], + "cron": [ + 3, + 4 + ], + "job": [ + 61, + 62 + ], + "request": [ + 15, + 16 + ] + } + }, + { + "id": 91, + "repository_id": 1, + "last_build_id": null, + "name": "branch_19", + "exists_on_github": true, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json new file mode 100644 index 0000000..8adf6c9 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -0,0 +1,31 @@ +{ + "table_name": "broadcasts", + "data": [ + { + "id": 1, + "recipient_id": 1, + "recipient_type": "Organization", + "kind": null, + "message": null, + "expired": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "category": null, + "_dependencies_": { + } + }, + { + "id": 2, + "recipient_id": 1, + "recipient_type": "Organization", + "kind": null, + "message": null, + "expired": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "category": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json new file mode 100644 index 0000000..30a3638 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json @@ -0,0 +1,168 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 153, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 158, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 33, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 210, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": 1, + "owner_type": "Organization", + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "repository": [ + 1 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json new file mode 100644 index 0000000..bb80479 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json @@ -0,0 +1,104 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 260, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 1, + "sender_type": "Organization", + "_dependencies_": { + "repository": [ + 1 + ] + } + }, + { + "id": 263, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 268, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json new file mode 100644 index 0000000..990e62b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 60, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 65, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": 217, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 70, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 13, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json new file mode 100644 index 0000000..3a5a1c8 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 85, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 137, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 140, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "config": null, + "commit_id": null, + "request_id": 29, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json new file mode 100644 index 0000000..7406e54 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -0,0 +1,141 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 217, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + "build": [ + 63, + 65 + ], + "job": [ + 66, + 67 + ], + "request": [ + 13, + 14 + ] + } + }, + { + "id": 218, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 219, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + "build": [ + 78, + 80 + ], + "job": [ + 81, + 82 + ], + "request": [ + 17, + 18 + ] + } + }, + { + "id": 220, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 227, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + "build": [ + 146, + 148 + ], + "job": [ + 149, + 150 + ], + "request": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json new file mode 100644 index 0000000..cf8f672 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -0,0 +1,25 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 228, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json new file mode 100644 index 0000000..defee86 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -0,0 +1,29 @@ +{ + "table_name": "crons", + "data": [ + { + "id": 3, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + }, + { + "id": 4, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json new file mode 100644 index 0000000..2ab2ce7 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -0,0 +1,53 @@ +{ + "table_name": "invoices", + "data": [ + { + "id": 1, + "object": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "subscription_id": 1, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 2, + "object": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "subscription_id": 1, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 3, + "object": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "subscription_id": 2, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + }, + { + "id": 4, + "object": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "subscription_id": 2, + "invoice_id": null, + "stripe_id": null, + "cc_last_digits": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json new file mode 100644 index 0000000..45bb606 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 154, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 53, + 54 + ], + "annotation": [ + 53, + 54 + ], + "queueable_job": [ + 53, + 54 + ] + } + }, + { + "id": 155, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 159, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 55, + 56 + ], + "annotation": [ + 55, + 56 + ], + "queueable_job": [ + 55, + 56 + ] + } + }, + { + "id": 160, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 264, + "repository_id": null, + "commit_id": null, + "source_id": 55, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 89, + 90 + ], + "annotation": [ + 89, + 90 + ], + "queueable_job": [ + 89, + 90 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json new file mode 100644 index 0000000..2148e53 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 265, + "repository_id": null, + "commit_id": null, + "source_id": 55, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 269, + "repository_id": null, + "commit_id": null, + "source_id": 57, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 91, + 92 + ], + "annotation": [ + 91, + 92 + ], + "queueable_job": [ + 91, + 92 + ] + } + }, + { + "id": 270, + "repository_id": null, + "commit_id": null, + "source_id": 57, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 271, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": 1, + "owner_type": "Organization", + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 93, + 94 + ], + "annotation": [ + 93, + 94 + ], + "queueable_job": [ + 93, + 94 + ] + } + }, + { + "id": 272, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": 1, + "owner_type": "Organization", + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json new file mode 100644 index 0000000..90e7a2b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 54, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 17, + 18 + ], + "annotation": [ + 17, + 18 + ], + "queueable_job": [ + 17, + 18 + ] + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 56, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 19, + 20 + ], + "annotation": [ + 19, + 20 + ], + "queueable_job": [ + 19, + 20 + ] + } + }, + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 21, + 22 + ], + "annotation": [ + 21, + 22 + ], + "queueable_job": [ + 21, + 22 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json new file mode 100644 index 0000000..a3472c0 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 66, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 23, + 24 + ], + "annotation": [ + 23, + 24 + ], + "queueable_job": [ + 23, + 24 + ] + } + }, + { + "id": 67, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 71, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 25, + 26 + ], + "annotation": [ + 25, + 26 + ], + "queueable_job": [ + 25, + 26 + ] + } + }, + { + "id": 72, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json new file mode 100644 index 0000000..567a2fb --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 76, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 27, + 28 + ], + "annotation": [ + 27, + 28 + ], + "queueable_job": [ + 27, + 28 + ] + } + }, + { + "id": 77, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 81, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 29, + 30 + ], + "annotation": [ + 29, + 30 + ], + "queueable_job": [ + 29, + 30 + ] + } + }, + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 31, + 32 + ], + "annotation": [ + 31, + 32 + ], + "queueable_job": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json new file mode 100644 index 0000000..7ca84e3 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 49, + 50 + ], + "annotation": [ + 49, + 50 + ], + "queueable_job": [ + 49, + 50 + ] + } + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 149, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 51, + 52 + ], + "annotation": [ + 51, + 52 + ], + "queueable_job": [ + 51, + 52 + ] + } + }, + { + "id": 150, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json new file mode 100644 index 0000000..7d2bc8e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 17, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json new file mode 100644 index 0000000..71737c1 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 22, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json new file mode 100644 index 0000000..ca51b8f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 27, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json new file mode 100644 index 0000000..f58e688 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json new file mode 100644 index 0000000..e6d97d3 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 53, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json new file mode 100644 index 0000000..7110942 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 90, + "job_id": 264, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json new file mode 100644 index 0000000..3e46a24 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json @@ -0,0 +1,21 @@ +{ + "table_name": "memberships", + "data": [ + { + "id": 1, + "organization_id": 1, + "user_id": null, + "role": null, + "_dependencies_": { + } + }, + { + "id": 2, + "organization_id": 1, + "user_id": null, + "role": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json new file mode 100644 index 0000000..866f140 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 14, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json new file mode 100644 index 0000000..3fb93fe --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 27, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 47, + "subject_id": 55, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json new file mode 100644 index 0000000..86913c5 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -0,0 +1,44 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 48, + "subject_id": 55, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 49, + "subject_id": 57, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 50, + "subject_id": 57, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json new file mode 100644 index 0000000..49a0e5b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 9, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json new file mode 100644 index 0000000..cec8d92 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -0,0 +1,69 @@ +{ + "table_name": "organizations", + "data": [ + { + "id": 1, + "name": null, + "login": null, + "github_id": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "avatar_url": null, + "location": null, + "email": null, + "company": null, + "homepage": null, + "billing_admin_only": null, + "_dependencies_": { + "build": [ + 161, + 210, + 211, + 260 + ], + "repository": [ + 1, + 66 + ], + "job": [ + 271, + 272 + ], + "request": [ + 57, + 58, + 55, + 56 + ], + "abuse": [ + 51, + 52 + ], + "subscription": [ + 1, + 2 + ], + "owner_group": [ + 1, + 2 + ], + "trial": [ + 1, + 2 + ], + "trial_allowance": [ + 5, + 6 + ], + "broadcast": [ + 1, + 2 + ], + "membership": [ + 1, + 2 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json new file mode 100644 index 0000000..2dd9cc2 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -0,0 +1,25 @@ +{ + "table_name": "owner_groups", + "data": [ + { + "id": 1, + "uuid": null, + "owner_id": 1, + "owner_type": "Organization", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 2, + "uuid": null, + "owner_id": 1, + "owner_type": "Organization", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json new file mode 100644 index 0000000..9e5945b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json @@ -0,0 +1,25 @@ +{ + "table_name": "permissions", + "data": [ + { + "id": 3, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + }, + { + "id": 4, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json new file mode 100644 index 0000000..a692eeb --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -0,0 +1,41 @@ +{ + "table_name": "pull_requests", + "data": [ + { + "id": 3, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + "request": [ + 29, + 30 + ], + "build": [ + 88, + 137 + ] + } + }, + { + "id": 6, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json new file mode 100644 index 0000000..281cd6a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 17, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json new file mode 100644 index 0000000..be28310 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 22, + "job_id": 61, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json new file mode 100644 index 0000000..f288927 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 27, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json new file mode 100644 index 0000000..9bd6198 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 32, + "job_id": 86, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json new file mode 100644 index 0000000..afeb7f3 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 53, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "_dependencies_": { + } + }, + { + "id": 89, + "job_id": 264, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json new file mode 100644 index 0000000..ebfff7c --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 90, + "job_id": 264, + "_dependencies_": { + } + }, + { + "id": 91, + "job_id": 269, + "_dependencies_": { + } + }, + { + "id": 92, + "job_id": 269, + "_dependencies_": { + } + }, + { + "id": 93, + "job_id": 271, + "_dependencies_": { + } + }, + { + "id": 94, + "job_id": 271, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json new file mode 100644 index 0000000..62c8882 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -0,0 +1,103 @@ +{ + "table_name": "repositories", + "data": [ + { + "id": 1, + "name": null, + "url": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-10-11 22:26:33 UTC", + "last_build_id": 260, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": 1, + "owner_type": "Organization", + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": 210, + "_dependencies_": { + "build": [ + 1, + 50 + ], + "request": [ + 11, + 12 + ], + "job": [ + 56, + 57 + ], + "branch": [ + 86, + 91 + ], + "ssl_key": [ + 33, + 34 + ], + "commit": [ + 219, + 220 + ], + "permission": [ + 3, + 4 + ], + "star": [ + 3, + 4 + ], + "pull_request": [ + 3, + 6 + ], + "tag": [ + 33, + 38 + ] + } + }, + { + "id": 66, + "name": null, + "url": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": 1, + "owner_type": "Organization", + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json new file mode 100644 index 0000000..e3928d7 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -0,0 +1,203 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 11, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 9, + 10 + ], + "message": [ + 9, + 10 + ], + "job": [ + 54, + 55 + ], + "build": [ + 51, + 53 + ] + } + }, + { + "id": 12, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 13, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 11, + 12 + ], + "message": [ + 11, + 12 + ], + "job": [ + 71, + 72 + ], + "build": [ + 68, + 70 + ] + } + }, + { + "id": 14, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 15, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 13, + 14 + ], + "message": [ + 13, + 14 + ], + "job": [ + 76, + 77 + ], + "build": [ + 73, + 75 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json new file mode 100644 index 0000000..8ebb39f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -0,0 +1,187 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 16, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 17, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 15, + 16 + ], + "message": [ + 15, + 16 + ], + "job": [ + 86, + 87 + ], + "build": [ + 83, + 85 + ] + } + }, + { + "id": 18, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 29, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 25, + 26 + ], + "message": [ + 25, + 26 + ], + "job": [ + 141, + 142 + ], + "build": [ + 138, + 140 + ] + } + }, + { + "id": 30, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json new file mode 100644 index 0000000..32cc550 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -0,0 +1,203 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 31, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 27, + 28 + ], + "message": [ + 27, + 28 + ], + "job": [ + 154, + 155 + ], + "build": [ + 151, + 153 + ] + } + }, + { + "id": 32, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 33, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 29, + 30 + ], + "message": [ + 29, + 30 + ], + "job": [ + 159, + 160 + ], + "build": [ + 156, + 158 + ] + } + }, + { + "id": 34, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 1, + "sender_type": "Organization", + "_dependencies_": { + "abuse": [ + 47, + 48 + ], + "message": [ + 47, + 48 + ], + "job": [ + 264, + 265 + ], + "build": [ + 261, + 263 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json new file mode 100644 index 0000000..f4c501a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -0,0 +1,111 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 56, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 1, + "sender_type": "Organization", + "_dependencies_": { + } + }, + { + "id": 57, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": 1, + "owner_type": "Organization", + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 49, + 50 + ], + "message": [ + 49, + 50 + ], + "job": [ + 269, + 270 + ], + "build": [ + 266, + 268 + ] + } + }, + { + "id": 58, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": 1, + "owner_type": "Organization", + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json new file mode 100644 index 0000000..4881c96 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "ssl_keys", + "data": [ + { + "id": 33, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 34, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json new file mode 100644 index 0000000..57ea7cc --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -0,0 +1,23 @@ +{ + "table_name": "stars", + "data": [ + { + "id": 3, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 4, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json new file mode 100644 index 0000000..21179d5 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -0,0 +1,81 @@ +{ + "table_name": "subscriptions", + "data": [ + { + "id": 1, + "cc_token": null, + "valid_to": null, + "owner_id": 1, + "owner_type": "Organization", + "first_name": null, + "last_name": null, + "company": null, + "zip_code": null, + "address": null, + "address2": null, + "city": null, + "state": null, + "country": null, + "vat_id": null, + "customer_id": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "cc_owner": null, + "cc_last_digits": null, + "cc_expiration_date": null, + "billing_email": null, + "selected_plan": null, + "coupon": null, + "contact_id": null, + "canceled_at": null, + "canceled_by_id": null, + "status": null, + "source": "unknown", + "concurrency": null, + "_dependencies_": { + "invoice": [ + 1, + 2 + ] + } + }, + { + "id": 2, + "cc_token": null, + "valid_to": null, + "owner_id": 1, + "owner_type": "Organization", + "first_name": null, + "last_name": null, + "company": null, + "zip_code": null, + "address": null, + "address2": null, + "city": null, + "state": null, + "country": null, + "vat_id": null, + "customer_id": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "cc_owner": null, + "cc_last_digits": null, + "cc_expiration_date": null, + "billing_email": null, + "selected_plan": null, + "coupon": null, + "contact_id": null, + "canceled_at": null, + "canceled_by_id": null, + "status": null, + "source": "unknown", + "concurrency": null, + "_dependencies_": { + "invoice": [ + 3, + 4 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json new file mode 100644 index 0000000..ba4719e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -0,0 +1,39 @@ +{ + "table_name": "tags", + "data": [ + { + "id": 33, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + "build": [ + 143, + 145 + ], + "commit": [ + 227, + 228 + ], + "request": [ + 33, + 34 + ] + } + }, + { + "id": 38, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json new file mode 100644 index 0000000..b593b78 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -0,0 +1,39 @@ +{ + "table_name": "trials", + "data": [ + { + "id": 1, + "owner_id": 1, + "owner_type": "Organization", + "chartmogul_customer_uuids": [ + + ], + "status": "new", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + "trial_allowance": [ + 1, + 2 + ] + } + }, + { + "id": 2, + "owner_id": 1, + "owner_type": "Organization", + "chartmogul_customer_uuids": [ + + ], + "status": "new", + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + "trial_allowance": [ + 3, + 4 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json new file mode 100644 index 0000000..898d338 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -0,0 +1,65 @@ +{ + "table_name": "trial_allowances", + "data": [ + { + "id": 1, + "trial_id": 1, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 2, + "trial_id": 1, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 3, + "trial_id": 2, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 4, + "trial_id": 2, + "creator_id": null, + "creator_type": null, + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + }, + { + "id": 5, + "trial_id": null, + "creator_id": 1, + "creator_type": "Organization", + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json new file mode 100644 index 0000000..7b99f39 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -0,0 +1,17 @@ +{ + "table_name": "trial_allowances", + "data": [ + { + "id": 6, + "trial_id": null, + "creator_id": 1, + "creator_type": "Organization", + "builds_allowed": null, + "builds_remaining": null, + "created_at": "2021-03-11 23:26:29 UTC", + "updated_at": "2021-03-11 23:26:29 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/factories/organization.rb b/spec/support/factories/organization.rb index 1624f5b..049dfe0 100644 --- a/spec/support/factories/organization.rb +++ b/spec/support/factories/organization.rb @@ -18,5 +18,103 @@ ) end end + + factory :organization_with_all_dependencies do + after(:create) do |organization| + create_list( + :membership, 2, + organization_id: organization.id, + ) + create( + :repository_with_all_dependencies_and_sibling, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create( + :build_with_all_dependencies_and_sibling, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create( + :build_with_all_dependencies_and_sibling, + sender_id: organization.id, + sender_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + + repo = organization.repositories.first + repo.update(current_build_id: organization.builds_for_that_this_organization_is_owner.second.id) + repo.update(last_build_id: organization.builds_for_that_this_organization_is_sender.second.id) + + create( + :request_with_all_dependencies_and_sibling, + sender_id: organization.id, + sender_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create( + :request_with_all_dependencies_and_sibling, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create( + :job_with_all_dependencies_and_sibling, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :subscription_with_invoices, 2, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :trial_with_allowances, 2, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :trial_allowance, 2, + creator_id: organization.id, + creator_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :owner_group, 2, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :broadcast, 2, + recipient_id: organization.id, + recipient_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + create_list( + :abuse, 2, + owner_id: organization.id, + owner_type: 'Organization', + created_at: organization.created_at, + updated_at: organization.updated_at + ) + end + end end end diff --git a/spec/support/utils.rb b/spec/support/utils.rb index 2c15ad6..57b589f 100644 --- a/spec/support/utils.rb +++ b/spec/support/utils.rb @@ -21,6 +21,11 @@ def expect_method_calls_on(cl, method, call_with, options) case match_mode when :including call_with.each do |args| + puts 'args:' + puts args + puts 'calls_args:' + puts calls_args + # byebug expect(calls_args).to include(args) end when :match From 7e346da1a0fc2b9d212ae7c98d02ca879bd94b3e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 10:40:57 +0200 Subject: [PATCH 29/88] test fixed --- .../abuse_14-26.json | 30 +++++++++---------- .../abuse_27-47.json | 30 +++++++++---------- .../abuse_48-52.json | 30 +++++++++---------- .../abuse_9-13.json | 30 +++++++++---------- .../annotation_17-21.json | 20 ++++++------- .../annotation_22-26.json | 20 ++++++------- .../annotation_27-31.json | 20 ++++++------- .../annotation_32-52.json | 20 ++++++------- .../annotation_53-89.json | 20 ++++++------- .../annotation_90-94.json | 20 ++++++------- .../branch_86-91.json | 12 ++++---- .../broadcast_1-2.json | 8 ++--- .../build_145-210.json | 20 ++++++------- .../build_260-268.json | 12 ++++---- .../build_50-70.json | 20 ++++++------- .../build_75-140.json | 20 ++++++------- .../commit_217-227.json | 20 ++++++------- .../commit_228-228.json | 4 +-- .../cron_3-4.json | 8 ++--- .../email_9-10.json | 8 ++--- .../invoice_1-4.json | 16 +++++----- .../job_154-264.json | 20 ++++++------- .../job_265-272.json | 20 ++++++------- .../job_54-61.json | 20 ++++++------- .../job_62-72.json | 20 ++++++------- .../job_76-86.json | 20 ++++++------- .../job_87-150.json | 20 ++++++------- .../log_17-21.json | 20 ++++++------- .../log_22-26.json | 20 ++++++------- .../log_27-31.json | 20 ++++++------- .../log_32-52.json | 20 ++++++------- .../log_53-89.json | 20 ++++++------- .../log_90-94.json | 20 ++++++------- .../message_14-26.json | 20 ++++++------- .../message_27-47.json | 20 ++++++------- .../message_48-50.json | 12 ++++---- .../message_9-13.json | 20 ++++++------- .../owner_group_1-2.json | 8 ++--- .../pull_request_3-6.json | 8 ++--- .../repository_1-66.json | 8 ++--- .../request_11-15.json | 20 ++++++------- .../request_16-30.json | 20 ++++++------- .../request_31-55.json | 20 ++++++------- .../request_56-58.json | 12 ++++---- .../ssl_key_33-34.json | 8 ++--- .../star_1-6.json | 16 +++++----- .../subscription_1-2.json | 8 ++--- .../tag_33-38.json | 8 ++--- .../token_9-10.json | 8 ++--- .../trial_1-2.json | 8 ++--- .../trial_allowance_1-5.json | 20 ++++++------- .../trial_allowance_6-6.json | 4 +-- .../user_9-9.json | 8 ++--- spec/support/factories/user.rb | 2 ++ 54 files changed, 444 insertions(+), 442 deletions(-) diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json index 9477f45..45f4dfd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 14, + "level": 66, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 15, + "level": 67, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 16, + "level": 68, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 25, + "level": 77, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 26, + "level": 78, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json index c870c0a..be24286 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 27, + "level": 79, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 28, + "level": 80, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 29, + "level": 81, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 30, + "level": 82, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 47, + "level": 99, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json index a16f78c..9352597 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 48, + "level": 100, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 49, + "level": 101, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 50, + "level": 102, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": 9, "owner_type": "User", "request_id": null, - "level": 51, + "level": 103, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": 9, "owner_type": "User", "request_id": null, - "level": 52, + "level": 104, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json index 2963f6f..c3ae13e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 9, + "level": 61, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 10, + "level": 62, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 11, + "level": 63, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 12, + "level": 64, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 13, + "level": 65, "reason": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json index 5a11a19..00f012a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json index c708540..4a41b39 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json index f1310fb..43aa8dc 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json index d8e5f2e..4189a47 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json index c615ce3..f570d27 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json index f21ffa5..9d685ca 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json index 79bf2fa..c8f8641 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json @@ -5,10 +5,10 @@ "id": 86, "repository_id": 1, "last_build_id": null, - "name": "branch_14", + "name": "branch_78", "exists_on_github": true, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { "build": [ 58, @@ -36,10 +36,10 @@ "id": 91, "repository_id": 1, "last_build_id": null, - "name": "branch_19", + "name": "branch_83", "exists_on_github": true, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json index 79ad768..3e1176f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "category": null, "_dependencies_": { } @@ -21,8 +21,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "category": null, "_dependencies_": { } diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json index 2a7ba9c..39fdde9 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": 227, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 31, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 33, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json index 878c2fc..eec746a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, @@ -42,8 +42,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 55, @@ -74,8 +74,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 57, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json index 923038e..cf631ab 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 11, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": 217, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json index 5a16dec..0630286 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 15, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": 219, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 17, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json index 66f0619..b9d90f4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -46,8 +46,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -66,8 +66,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -98,8 +98,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -118,8 +118,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json index 9b3733f..78f7352 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json index ddbd71d..d64695c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, @@ -17,8 +17,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, diff --git a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json index 5df4282..d28d757 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json @@ -5,8 +5,8 @@ "id": 9, "user_id": 9, "email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 10, "user_id": 9, "email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json index 76d0e35..e1c7f2a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -16,8 +16,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -28,8 +28,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -40,8 +40,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json index 2bd2640..b49282e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json index a785b40..3b531e0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": 9, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": 9, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json index 79eb7bc..acd31df 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json index ef6ff33..08d5231 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json index 1c00e67..3073867 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json index ba6a06e..592575c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json index 3c5f5f5..1f94d75 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json index f751aba..2a72989 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json index af11591..b49df61 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json index d86c446..4916b9b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json index 9d21497..9295a09 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json index 73f9645..cd72981 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json index fd17fae..fa9e58c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json index 125ea17..209b665 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json index 57713c1..6ca8861 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json index 20d7819..fe014b9 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json index 4beed44..51a45c8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json @@ -6,8 +6,8 @@ "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json index 267baa7..2152852 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { "request": [ 29, @@ -32,8 +32,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json index ee79230..d8e21e3 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-10-11 21:34:11 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -74,8 +74,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json index 4b11109..2dbbe18 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json index 9b4ac95..33b582d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -118,8 +118,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json index 6706a50..eb09c02 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json index eb9276a..e56d9c2 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json index 6474e2b..4f5905c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json @@ -6,8 +6,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json index e12f702..f4cccfa 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json @@ -5,8 +5,8 @@ "id": 1, "repository_id": null, "user_id": 9, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 2, "repository_id": null, "user_id": 9, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -23,8 +23,8 @@ "id": 5, "repository_id": 1, "user_id": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "id": 6, "repository_id": 1, "user_id": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json index 9562c8f..99cf0ce 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -56,8 +56,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json index 34e32af..848278d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { "build": [ 143, @@ -30,8 +30,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json index cf5f1c6..de3c0d1 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json @@ -5,8 +5,8 @@ "id": 9, "user_id": 9, "token": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 10, "user_id": 9, "token": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json index b927f8e..467e613 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { "trial_allowance": [ 1, @@ -26,8 +26,8 @@ ], "status": "new", - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { "trial_allowance": [ 3, diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json index 3e0791f..d3d2cb0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json index e2320c2..02f4232 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json index 9274400..5076ad7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json +++ b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json @@ -6,8 +6,8 @@ "name": null, "login": null, "email": null, - "created_at": "2021-03-11 22:34:07 UTC", - "updated_at": "2021-03-11 22:34:07 UTC", + "created_at": "2021-03-12 09:32:06 UTC", + "updated_at": "2021-03-12 09:32:06 UTC", "is_admin": false, "github_id": null, "github_oauth_token": null, @@ -29,8 +29,8 @@ 260 ], "repository": [ - 66, - 1 + 1, + 66 ], "job": [ 271, diff --git a/spec/support/factories/user.rb b/spec/support/factories/user.rb index 560431b..648f41e 100644 --- a/spec/support/factories/user.rb +++ b/spec/support/factories/user.rb @@ -74,8 +74,10 @@ ) repo = user.repositories.first + Repository.record_timestamps = false repo.update(current_build_id: user.builds_for_that_this_user_is_owner.second.id) repo.update(last_build_id: user.builds_for_that_this_user_is_sender.second.id) + Repository.record_timestamps = true create( :request_with_all_dependencies_and_sibling, From 9dc29c7772d438aaefd8529e9118fd9464c83d57 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 11:04:27 +0200 Subject: [PATCH 30/88] wip --- .../abuse_14-26.json | 30 +++++++++---------- .../abuse_27-47.json | 30 +++++++++---------- .../abuse_48-52.json | 30 +++++++++---------- .../abuse_9-13.json | 30 +++++++++---------- .../annotation_17-21.json | 20 ++++++------- .../annotation_22-26.json | 20 ++++++------- .../annotation_27-31.json | 20 ++++++------- .../annotation_32-52.json | 20 ++++++------- .../annotation_53-89.json | 20 ++++++------- .../annotation_90-94.json | 20 ++++++------- .../branch_86-91.json | 12 ++++---- .../broadcast_1-2.json | 8 ++--- .../build_145-210.json | 20 ++++++------- .../build_260-268.json | 12 ++++---- .../build_50-70.json | 20 ++++++------- .../build_75-140.json | 20 ++++++------- .../commit_217-227.json | 20 ++++++------- .../commit_228-228.json | 4 +-- .../cron_3-4.json | 8 ++--- .../invoice_1-4.json | 16 +++++----- .../job_154-264.json | 20 ++++++------- .../job_265-272.json | 20 ++++++------- .../job_54-61.json | 20 ++++++------- .../job_62-72.json | 20 ++++++------- .../job_76-86.json | 20 ++++++------- .../job_87-150.json | 20 ++++++------- .../log_17-21.json | 20 ++++++------- .../log_22-26.json | 20 ++++++------- .../log_27-31.json | 20 ++++++------- .../log_32-52.json | 20 ++++++------- .../log_53-89.json | 20 ++++++------- .../log_90-94.json | 20 ++++++------- .../message_14-26.json | 20 ++++++------- .../message_27-47.json | 20 ++++++------- .../message_48-50.json | 12 ++++---- .../message_9-13.json | 20 ++++++------- .../organization_1-1.json | 4 +-- .../owner_group_1-2.json | 8 ++--- .../pull_request_3-6.json | 8 ++--- .../repository_1-66.json | 8 ++--- .../request_11-15.json | 20 ++++++------- .../request_16-30.json | 20 ++++++------- .../request_31-55.json | 20 ++++++------- .../request_56-58.json | 12 ++++---- .../ssl_key_33-34.json | 8 ++--- .../star_3-4.json | 8 ++--- .../subscription_1-2.json | 8 ++--- .../tag_33-38.json | 8 ++--- .../trial_1-2.json | 8 ++--- .../trial_allowance_1-5.json | 20 ++++++------- .../trial_allowance_6-6.json | 4 +-- spec/support/factories/organization.rb | 2 ++ spec/support/utils.rb | 5 ---- 53 files changed, 430 insertions(+), 433 deletions(-) diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json index 68464f7..0dfb913 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 14, + "level": 66, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 15, + "level": 67, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 16, + "level": 68, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 25, + "level": 77, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 26, + "level": 78, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json index cb76f4e..b3e72d7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 27, + "level": 79, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 28, + "level": 80, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 29, + "level": 81, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 30, + "level": 82, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 47, + "level": 99, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json index c2d6d74..77dac1d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 48, + "level": 100, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 49, + "level": 101, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 50, + "level": 102, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": 1, "owner_type": "Organization", "request_id": null, - "level": 51, + "level": 103, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": 1, "owner_type": "Organization", "request_id": null, - "level": 52, + "level": 104, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json index 62199a3..b890ecf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 9, + "level": 61, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 10, + "level": 62, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 11, + "level": 63, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 12, + "level": 64, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 13, + "level": 65, "reason": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json index 5dc2009..8553a22 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json index fae3b64..08412ca 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json index b38d809..c1ea077 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json index 891ac4f..067d05c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json index 8b069ce..19c4065 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json index 8ac2fcd..c657765 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json index e773a6b..4b90b3d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -5,10 +5,10 @@ "id": 86, "repository_id": 1, "last_build_id": null, - "name": "branch_14", + "name": "branch_78", "exists_on_github": true, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { "build": [ 58, @@ -36,10 +36,10 @@ "id": 91, "repository_id": 1, "last_build_id": null, - "name": "branch_19", + "name": "branch_83", "exists_on_github": true, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json index 8adf6c9..1f94f0c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "category": null, "_dependencies_": { } @@ -21,8 +21,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "category": null, "_dependencies_": { } diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json index 30a3638..fd3eb32 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": 227, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 31, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 33, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json index bb80479..f7a23dc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, @@ -42,8 +42,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 55, @@ -74,8 +74,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 57, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json index 990e62b..4566389 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 11, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": 217, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json index 3a5a1c8..b8b2835 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 15, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": 219, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 17, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json index 7406e54..5139278 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -46,8 +46,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -66,8 +66,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -98,8 +98,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -118,8 +118,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json index cf8f672..ec3605a 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json index defee86..ba24b2e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, @@ -17,8 +17,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json index 2ab2ce7..41f417f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -16,8 +16,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -28,8 +28,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -40,8 +40,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json index 45bb606..3d8faad 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json index 2148e53..ac618f8 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": 1, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": 1, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json index 90e7a2b..ad52582 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json index a3472c0..83871fe 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json index 567a2fb..866dbd6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json index 7ca84e3..990b837 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json index 7d2bc8e..922a716 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json index 71737c1..acbe843 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json index ca51b8f..376b036 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json index f58e688..1b4fa52 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json index e6d97d3..351476e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json index 7110942..71d9b8e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json index 866f140..99bcbc2 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json index 3fb93fe..7b9472d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json index 86913c5..ce9a9b4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json index 49a0e5b..14e8deb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json index cec8d92..588578b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -6,8 +6,8 @@ "name": null, "login": null, "github_id": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "avatar_url": null, "location": null, "email": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json index 2dd9cc2..f91d08a 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -6,8 +6,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json index a692eeb..12c9eb7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { "request": [ 29, @@ -32,8 +32,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json index 62c8882..243a4f5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-10-11 22:26:33 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-10-12 08:43:41 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -74,8 +74,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json index e3928d7..94dbdc0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json index 8ebb39f..2d18dfe 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -118,8 +118,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json index 32cc550..9bfb9d9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json index f4c501a..2479a7e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json index 4881c96..056af5c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -6,8 +6,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json index 57ea7cc..981632d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -5,8 +5,8 @@ "id": 3, "repository_id": 1, "user_id": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 4, "repository_id": 1, "user_id": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json index 21179d5..e3b5c56 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -56,8 +56,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json index ba4719e..08e1441 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { "build": [ 143, @@ -30,8 +30,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json index b593b78..7bc46c5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { "trial_allowance": [ 1, @@ -26,8 +26,8 @@ ], "status": "new", - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { "trial_allowance": [ 3, diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json index 898d338..9a0eb1f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json index 7b99f39..aa6e742 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-11 23:26:29 UTC", - "updated_at": "2021-03-11 23:26:29 UTC", + "created_at": "2021-03-12 09:43:37 UTC", + "updated_at": "2021-03-12 09:43:37 UTC", "_dependencies_": { } } diff --git a/spec/support/factories/organization.rb b/spec/support/factories/organization.rb index 049dfe0..4ba1f89 100644 --- a/spec/support/factories/organization.rb +++ b/spec/support/factories/organization.rb @@ -48,8 +48,10 @@ ) repo = organization.repositories.first + Repository.record_timestamps = false repo.update(current_build_id: organization.builds_for_that_this_organization_is_owner.second.id) repo.update(last_build_id: organization.builds_for_that_this_organization_is_sender.second.id) + Repository.record_timestamps = true create( :request_with_all_dependencies_and_sibling, diff --git a/spec/support/utils.rb b/spec/support/utils.rb index 57b589f..2c15ad6 100644 --- a/spec/support/utils.rb +++ b/spec/support/utils.rb @@ -21,11 +21,6 @@ def expect_method_calls_on(cl, method, call_with, options) case match_mode when :including call_with.each do |args| - puts 'args:' - puts args - puts 'calls_args:' - puts calls_args - # byebug expect(calls_args).to include(args) end when :match From e81e18aa4170dee40d7018a948ced3538a268eae Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 11:28:34 +0200 Subject: [PATCH 31/88] wip --- .../abuse_14-26.json | 30 +++++++++---------- .../abuse_27-47.json | 30 +++++++++---------- .../abuse_48-52.json | 30 +++++++++---------- .../abuse_9-13.json | 30 +++++++++---------- .../annotation_17-21.json | 20 ++++++------- .../annotation_22-26.json | 20 ++++++------- .../annotation_27-31.json | 20 ++++++------- .../annotation_32-52.json | 20 ++++++------- .../annotation_53-89.json | 20 ++++++------- .../annotation_90-94.json | 20 ++++++------- .../branch_86-91.json | 12 ++++---- .../broadcast_1-2.json | 8 ++--- .../build_145-210.json | 20 ++++++------- .../build_260-268.json | 12 ++++---- .../build_50-70.json | 20 ++++++------- .../build_75-140.json | 20 ++++++------- .../commit_217-227.json | 20 ++++++------- .../commit_228-228.json | 4 +-- .../cron_3-4.json | 8 ++--- .../invoice_1-4.json | 16 +++++----- .../job_154-264.json | 20 ++++++------- .../job_265-272.json | 20 ++++++------- .../job_54-61.json | 20 ++++++------- .../job_62-72.json | 20 ++++++------- .../job_76-86.json | 20 ++++++------- .../job_87-150.json | 20 ++++++------- .../log_17-21.json | 20 ++++++------- .../log_22-26.json | 20 ++++++------- .../log_27-31.json | 20 ++++++------- .../log_32-52.json | 20 ++++++------- .../log_53-89.json | 20 ++++++------- .../log_90-94.json | 20 ++++++------- .../message_14-26.json | 20 ++++++------- .../message_27-47.json | 20 ++++++------- .../message_48-50.json | 12 ++++---- .../message_9-13.json | 20 ++++++------- .../organization_1-1.json | 4 +-- .../owner_group_1-2.json | 8 ++--- .../pull_request_3-6.json | 8 ++--- .../repository_1-66.json | 8 ++--- .../request_11-15.json | 20 ++++++------- .../request_16-30.json | 20 ++++++------- .../request_31-55.json | 20 ++++++------- .../request_56-58.json | 12 ++++---- .../ssl_key_33-34.json | 8 ++--- .../star_3-4.json | 8 ++--- .../subscription_1-2.json | 8 ++--- .../tag_33-38.json | 8 ++--- .../trial_1-2.json | 8 ++--- .../trial_allowance_1-5.json | 20 ++++++------- .../trial_allowance_6-6.json | 4 +-- 51 files changed, 428 insertions(+), 428 deletions(-) diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json index 0dfb913..50f17d4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 66, + "level": 14, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 67, + "level": 15, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 68, + "level": 16, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 77, + "level": 25, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 78, + "level": 26, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json index b3e72d7..32b4654 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 79, + "level": 27, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 80, + "level": 28, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 81, + "level": 29, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 82, + "level": 30, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 99, + "level": 47, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json index 77dac1d..74785ec 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 100, + "level": 48, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 101, + "level": 49, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 102, + "level": 50, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": 1, "owner_type": "Organization", "request_id": null, - "level": 103, + "level": 51, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": 1, "owner_type": "Organization", "request_id": null, - "level": 104, + "level": 52, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json index b890ecf..0557325 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 61, + "level": 9, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 62, + "level": 10, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 63, + "level": 11, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 64, + "level": 12, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 65, + "level": 13, "reason": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json index 8553a22..1513043 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json index 08412ca..e1e99a0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json index c1ea077..999425f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json index 067d05c..c9f8e0f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json index 19c4065..ebb3b58 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json index c657765..d52f059 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json index 4b90b3d..be3b1b0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -5,10 +5,10 @@ "id": 86, "repository_id": 1, "last_build_id": null, - "name": "branch_78", + "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { "build": [ 58, @@ -36,10 +36,10 @@ "id": 91, "repository_id": 1, "last_build_id": null, - "name": "branch_83", + "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json index 1f94f0c..299e273 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "category": null, "_dependencies_": { } @@ -21,8 +21,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "category": null, "_dependencies_": { } diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json index fd3eb32..831bf14 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": 227, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 31, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 33, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json index f7a23dc..8c585bb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, @@ -42,8 +42,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 55, @@ -74,8 +74,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 57, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json index 4566389..387d7bd 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 11, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": 217, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json index b8b2835..436ec6a 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 15, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": 219, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 17, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json index 5139278..437c2f7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -46,8 +46,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -66,8 +66,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -98,8 +98,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -118,8 +118,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json index ec3605a..1b5fcbe 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json index ba24b2e..ed953fd 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, @@ -17,8 +17,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json index 41f417f..db44b9f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -16,8 +16,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -28,8 +28,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -40,8 +40,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json index 3d8faad..ff62138 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json index ac618f8..d0b1055 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": 1, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": 1, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json index ad52582..50bda3b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json index 83871fe..3729b55 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json index 866dbd6..3ca97b1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json index 990b837..98ce9bc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json index 922a716..f6650b5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json index acbe843..2f15f17 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json index 376b036..b96fa3f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json index 1b4fa52..f4fbc30 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json index 351476e..6e305de 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json index 71d9b8e..2c71752 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json index 99bcbc2..3e224e7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json index 7b9472d..8797a78 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json index ce9a9b4..760a20e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json index 14e8deb..1c89271 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json index 588578b..58864e1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -6,8 +6,8 @@ "name": null, "login": null, "github_id": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "avatar_url": null, "location": null, "email": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json index f91d08a..0ee2fbf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -6,8 +6,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json index 12c9eb7..4b18d86 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { "request": [ 29, @@ -32,8 +32,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json index 243a4f5..0f6af6c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-10-12 08:43:41 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -74,8 +74,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json index 94dbdc0..f515db6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json index 2d18dfe..5d09794 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -118,8 +118,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json index 9bfb9d9..a04b64c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json index 2479a7e..5172446 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json index 056af5c..31e18b4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -6,8 +6,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json index 981632d..b8e69df 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -5,8 +5,8 @@ "id": 3, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 4, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json index e3b5c56..7d6ed8e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -56,8 +56,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json index 08e1441..f559d6b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { "build": [ 143, @@ -30,8 +30,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json index 7bc46c5..d1d9403 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { "trial_allowance": [ 1, @@ -26,8 +26,8 @@ ], "status": "new", - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { "trial_allowance": [ 3, diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json index 9a0eb1f..71d6c92 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json index aa6e742..79fb3dc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:43:37 UTC", - "updated_at": "2021-03-12 09:43:37 UTC", + "created_at": "2021-03-12 10:03:12 UTC", + "updated_at": "2021-03-12 10:03:12 UTC", "_dependencies_": { } } From c528448e6d909163356d47ef0816e8b1582bdc6d Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 11:54:22 +0200 Subject: [PATCH 32/88] remove_org_with_dependencies works with tests --- spec/backup/remove_specified_spec.rb | 4 +++ .../abuse_14-26.json | 20 ++++++------- .../abuse_27-47.json | 20 ++++++------- .../abuse_48-52.json | 20 ++++++------- .../abuse_9-13.json | 20 ++++++------- .../annotation_17-21.json | 20 ++++++------- .../annotation_22-26.json | 20 ++++++------- .../annotation_27-31.json | 20 ++++++------- .../annotation_32-52.json | 20 ++++++------- .../annotation_53-89.json | 20 ++++++------- .../annotation_90-94.json | 20 ++++++------- .../branch_86-91.json | 8 ++--- .../broadcast_1-2.json | 8 ++--- .../build_145-210.json | 20 ++++++------- .../build_260-268.json | 12 ++++---- .../build_50-70.json | 20 ++++++------- .../build_75-140.json | 20 ++++++------- .../commit_217-227.json | 20 ++++++------- .../commit_228-228.json | 4 +-- .../cron_3-4.json | 8 ++--- .../invoice_1-4.json | 16 +++++----- .../job_154-264.json | 20 ++++++------- .../job_265-272.json | 20 ++++++------- .../job_54-61.json | 20 ++++++------- .../job_62-72.json | 20 ++++++------- .../job_76-86.json | 20 ++++++------- .../job_87-150.json | 20 ++++++------- .../log_17-21.json | 20 ++++++------- .../log_22-26.json | 20 ++++++------- .../log_27-31.json | 20 ++++++------- .../log_32-52.json | 20 ++++++------- .../log_53-89.json | 20 ++++++------- .../log_90-94.json | 20 ++++++------- .../message_14-26.json | 20 ++++++------- .../message_27-47.json | 20 ++++++------- .../message_48-50.json | 12 ++++---- .../message_9-13.json | 20 ++++++------- .../organization_1-1.json | 4 +-- .../owner_group_1-2.json | 8 ++--- .../pull_request_3-6.json | 8 ++--- .../repository_1-66.json | 8 ++--- .../request_11-15.json | 20 ++++++------- .../request_16-30.json | 20 ++++++------- .../request_31-55.json | 20 ++++++------- .../request_56-58.json | 12 ++++---- .../ssl_key_33-34.json | 8 ++--- .../star_3-4.json | 8 ++--- .../subscription_1-2.json | 8 ++--- .../tag_33-38.json | 8 ++--- .../trial_1-2.json | 8 ++--- .../trial_allowance_1-5.json | 20 ++++++------- .../trial_allowance_6-6.json | 4 +-- .../abuse_14-26.json | 30 +++++++++---------- .../abuse_27-47.json | 30 +++++++++---------- .../abuse_48-52.json | 30 +++++++++---------- .../abuse_9-13.json | 30 +++++++++---------- .../annotation_17-21.json | 20 ++++++------- .../annotation_22-26.json | 20 ++++++------- .../annotation_27-31.json | 20 ++++++------- .../annotation_32-52.json | 20 ++++++------- .../annotation_53-89.json | 20 ++++++------- .../annotation_90-94.json | 20 ++++++------- .../branch_86-91.json | 12 ++++---- .../broadcast_1-2.json | 8 ++--- .../build_145-210.json | 20 ++++++------- .../build_260-268.json | 12 ++++---- .../build_50-70.json | 20 ++++++------- .../build_75-140.json | 20 ++++++------- .../commit_217-227.json | 20 ++++++------- .../commit_228-228.json | 4 +-- .../cron_3-4.json | 8 ++--- .../email_9-10.json | 8 ++--- .../invoice_1-4.json | 16 +++++----- .../job_154-264.json | 20 ++++++------- .../job_265-272.json | 20 ++++++------- .../job_54-61.json | 20 ++++++------- .../job_62-72.json | 20 ++++++------- .../job_76-86.json | 20 ++++++------- .../job_87-150.json | 20 ++++++------- .../log_17-21.json | 20 ++++++------- .../log_22-26.json | 20 ++++++------- .../log_27-31.json | 20 ++++++------- .../log_32-52.json | 20 ++++++------- .../log_53-89.json | 20 ++++++------- .../log_90-94.json | 20 ++++++------- .../message_14-26.json | 20 ++++++------- .../message_27-47.json | 20 ++++++------- .../message_48-50.json | 12 ++++---- .../message_9-13.json | 20 ++++++------- .../owner_group_1-2.json | 8 ++--- .../pull_request_3-6.json | 8 ++--- .../repository_1-66.json | 8 ++--- .../request_11-15.json | 20 ++++++------- .../request_16-30.json | 20 ++++++------- .../request_31-55.json | 20 ++++++------- .../request_56-58.json | 12 ++++---- .../ssl_key_33-34.json | 8 ++--- .../star_1-6.json | 16 +++++----- .../subscription_1-2.json | 8 ++--- .../tag_33-38.json | 8 ++--- .../token_9-10.json | 8 ++--- .../trial_1-2.json | 8 ++--- .../trial_allowance_1-5.json | 20 ++++++------- .../trial_allowance_6-6.json | 4 +-- .../user_9-9.json | 4 +-- 105 files changed, 850 insertions(+), 846 deletions(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 13bc9f6..d41b4f1 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -311,6 +311,8 @@ end let!(:user) { + FactoryBot.rewind_sequences + db_helper.do_without_triggers do FactoryBot.create( :user_with_all_dependencies, @@ -393,6 +395,8 @@ def get_expected_files(datetime) end let!(:organization) { + FactoryBot.rewind_sequences + db_helper.do_without_triggers do FactoryBot.create( :organization_with_all_dependencies, diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json index 50f17d4..762506f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -8,8 +8,8 @@ "request_id": 15, "level": 14, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "request_id": 17, "level": 15, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "request_id": 17, "level": 16, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "request_id": 29, "level": 25, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "request_id": 29, "level": 26, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json index 32b4654..e01ad2a 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -8,8 +8,8 @@ "request_id": 31, "level": 27, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "request_id": 31, "level": 28, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "request_id": 33, "level": 29, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "request_id": 33, "level": 30, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "request_id": 55, "level": 47, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json index 74785ec..8ee7915 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -8,8 +8,8 @@ "request_id": 55, "level": 48, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "request_id": 57, "level": 49, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "request_id": 57, "level": 50, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "request_id": null, "level": 51, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "request_id": null, "level": 52, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json index 0557325..77bb26d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -8,8 +8,8 @@ "request_id": 11, "level": 9, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "request_id": 11, "level": 10, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "request_id": 13, "level": 11, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "request_id": 13, "level": 12, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "request_id": 15, "level": 13, "reason": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json index 1513043..07ac111 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json index e1e99a0..97477c0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json index 999425f..fd60cc4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json index c9f8e0f..df5d4ca 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json index ebb3b58..779356b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json index d52f059..355dc84 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json index be3b1b0..638cb53 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { "build": [ 58, @@ -38,8 +38,8 @@ "last_build_id": null, "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json index 299e273..d26b30e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "category": null, "_dependencies_": { } @@ -21,8 +21,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "category": null, "_dependencies_": { } diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json index 831bf14..f29a7d3 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": 227, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 31, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 33, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json index 8c585bb..4e82703 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, @@ -42,8 +42,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 55, @@ -74,8 +74,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 57, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json index 387d7bd..8658a87 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 11, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": 217, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json index 436ec6a..32897fe 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 15, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": 219, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 17, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json index 437c2f7..c61dbd3 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -46,8 +46,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -66,8 +66,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -98,8 +98,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -118,8 +118,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json index 1b5fcbe..d1e00a6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json index ed953fd..057010e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, @@ -17,8 +17,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json index db44b9f..dfb7d29 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -16,8 +16,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -28,8 +28,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -40,8 +40,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json index ff62138..b601972 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json index d0b1055..344c2cc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": 1, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": 1, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json index 50bda3b..d776e33 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json index 3729b55..2a0b201 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json index 3ca97b1..ebde598 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json index 98ce9bc..8194f28 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json index f6650b5..4a3aaf0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json index 2f15f17..a72f5ee 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json index b96fa3f..8da8533 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json index f4fbc30..2924210 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json index 6e305de..2d07359 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json index 2c71752..776efc1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json index 3e224e7..3942d15 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json index 8797a78..7230b1f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json index 760a20e..0adf532 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json index 1c89271..e80d08d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json index 58864e1..ca78a8f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -6,8 +6,8 @@ "name": null, "login": null, "github_id": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "avatar_url": null, "location": null, "email": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json index 0ee2fbf..8df0e1f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -6,8 +6,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json index 4b18d86..fd321ba 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { "request": [ 29, @@ -32,8 +32,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json index 0f6af6c..8ab8586 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -74,8 +74,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json index f515db6..56f0de6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json index 5d09794..2043e96 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -118,8 +118,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json index a04b64c..9975824 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json index 5172446..152bdb7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json index 31e18b4..354b803 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -6,8 +6,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json index b8e69df..a36cfb2 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -5,8 +5,8 @@ "id": 3, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 4, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json index 7d6ed8e..c04a988 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -56,8 +56,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json index f559d6b..9e89424 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { "build": [ 143, @@ -30,8 +30,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json index d1d9403..a31ec03 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { "trial_allowance": [ 1, @@ -26,8 +26,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { "trial_allowance": [ 3, diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json index 71d6c92..97373df 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json index 79fb3dc..a540698 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:03:12 UTC", - "updated_at": "2021-03-12 10:03:12 UTC", + "created_at": "2021-03-12 10:36:58 UTC", + "updated_at": "2021-03-12 10:36:58 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json index 45f4dfd..cde8ee4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 66, + "level": 14, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 67, + "level": 15, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 17, - "level": 68, + "level": 16, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 77, + "level": 25, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 29, - "level": 78, + "level": 26, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json index be24286..3187eea 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 79, + "level": 27, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 31, - "level": 80, + "level": 28, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 81, + "level": 29, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 33, - "level": 82, + "level": 30, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 99, + "level": 47, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json index 9352597..8497948 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 55, - "level": 100, + "level": 48, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 101, + "level": 49, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 57, - "level": 102, + "level": 50, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": 9, "owner_type": "User", "request_id": null, - "level": 103, + "level": 51, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": 9, "owner_type": "User", "request_id": null, - "level": 104, + "level": 52, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json index c3ae13e..1b7a729 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json @@ -6,10 +6,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 61, + "level": 9, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -18,10 +18,10 @@ "owner_id": null, "owner_type": null, "request_id": 11, - "level": 62, + "level": 10, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -30,10 +30,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 63, + "level": 11, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -42,10 +42,10 @@ "owner_id": null, "owner_type": null, "request_id": 13, - "level": 64, + "level": 12, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -54,10 +54,10 @@ "owner_id": null, "owner_type": null, "request_id": 15, - "level": 65, + "level": 13, "reason": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json index 00f012a..aeb97a7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json index 4a41b39..8591cf7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json index 43aa8dc..fe39373 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json index 4189a47..3d7a8aa 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json index f570d27..1c5550a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json index 9d685ca..739fd54 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -30,8 +30,8 @@ "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -42,8 +42,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -54,8 +54,8 @@ "job_id": 271, "url": null, "description": "some text", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json index c8f8641..88559dd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json @@ -5,10 +5,10 @@ "id": 86, "repository_id": 1, "last_build_id": null, - "name": "branch_78", + "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { "build": [ 58, @@ -36,10 +36,10 @@ "id": 91, "repository_id": 1, "last_build_id": null, - "name": "branch_83", + "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json index 3e1176f..e1cbcd6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "category": null, "_dependencies_": { } @@ -21,8 +21,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "category": null, "_dependencies_": { } diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json index 39fdde9..821886e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": 227, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 31, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 33, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json index eec746a..dcdae76 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -42,8 +42,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 55, @@ -74,8 +74,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 57, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json index cf631ab..cb95b14 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 11, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": 217, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json index 0630286..c4699a6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 15, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": 219, "request_id": null, @@ -71,8 +71,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 17, @@ -103,8 +103,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -135,8 +135,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json index b9d90f4..84b48ef 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -46,8 +46,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": 86, "tag_id": null, "_dependencies_": { @@ -66,8 +66,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -98,8 +98,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, "tag_id": null, "_dependencies_": { @@ -118,8 +118,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json index 78f7352..fab0dc8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, "tag_id": 33, "_dependencies_": { diff --git a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json index d64695c..8326582 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, @@ -17,8 +17,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false, diff --git a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json index d28d757..bc73eb8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json @@ -5,8 +5,8 @@ "id": 9, "user_id": 9, "email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 10, "user_id": 9, "email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json index e1c7f2a..baa5e93 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -16,8 +16,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -28,8 +28,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -40,8 +40,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json index b49282e..a0fa6d7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json index 3b531e0..8a967bd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": 9, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": 9, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json index acd31df..f8c7968 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json index 08d5231..6e2bff7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json index 3073867..bc0016f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -58,8 +58,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -132,8 +132,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json index 592575c..240cdfd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,8 +89,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -120,8 +120,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -163,8 +163,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json index 1f94d75..2d65ae4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json index 2a72989..59ec0c5 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json @@ -6,8 +6,8 @@ "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json index b49df61..93af892 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json @@ -6,8 +6,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json index 4916b9b..eed558e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json @@ -6,8 +6,8 @@ "job_id": 86, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json index 9295a09..cbd2f4c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json @@ -6,8 +6,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json index cd72981..87c2a15 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json @@ -6,8 +6,8 @@ "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -38,8 +38,8 @@ "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -54,8 +54,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -70,8 +70,8 @@ "job_id": 271, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json index fa9e58c..fb99264 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json index 209b665..80e139b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json index 6ca8861..ef693e6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json index fe014b9..98b7057 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -22,8 +22,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -35,8 +35,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -48,8 +48,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -61,8 +61,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json index 51a45c8..7b61697 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json @@ -6,8 +6,8 @@ "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json index 2152852..394ed68 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { "request": [ 29, @@ -32,8 +32,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json index d8e21e3..d1f41b5 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -74,8 +74,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json index 2dbbe18..f86ee7e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json index 33b582d..d3d8706 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -118,8 +118,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json index eb09c02..5e8770b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -58,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -134,8 +134,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -164,8 +164,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json index e56d9c2..42a1cb0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -42,8 +42,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -88,8 +88,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json index 4f5905c..857dcec 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json @@ -6,8 +6,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -16,8 +16,8 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json index f4cccfa..a412d2f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json @@ -5,8 +5,8 @@ "id": 1, "repository_id": null, "user_id": 9, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 2, "repository_id": null, "user_id": 9, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -23,8 +23,8 @@ "id": 5, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "id": 6, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json index 99cf0ce..a33f74b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -56,8 +56,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json index 848278d..17b6435 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { "build": [ 143, @@ -30,8 +30,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json index de3c0d1..ccf57cd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json @@ -5,8 +5,8 @@ "id": 9, "user_id": 9, "token": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -14,8 +14,8 @@ "id": 10, "user_id": 9, "token": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json index 467e613..9666d2e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { "trial_allowance": [ 1, @@ -26,8 +26,8 @@ ], "status": "new", - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { "trial_allowance": [ 3, diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json index d3d2cb0..59cb67d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -20,8 +20,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -32,8 +32,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -44,8 +44,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } }, @@ -56,8 +56,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json index 02f4232..0239be6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "_dependencies_": { } } diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json index 5076ad7..a161836 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json +++ b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json @@ -6,8 +6,8 @@ "name": null, "login": null, "email": null, - "created_at": "2021-03-12 09:32:06 UTC", - "updated_at": "2021-03-12 09:32:06 UTC", + "created_at": "2021-03-12 10:46:10 UTC", + "updated_at": "2021-03-12 10:46:10 UTC", "is_admin": false, "github_id": null, "github_oauth_token": null, From af5d7587c747d21a4539c31bae70c3ba4563f5c7 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 12 Oct 2021 19:49:14 +0200 Subject: [PATCH 33/88] removing repositories works --- .../remove_with_all_dependencies.rb | 29 ++- spec/backup/remove_specified_spec.rb | 132 ++++++++---- .../abuse_14-26.json | 65 ++++++ .../abuse_27-30.json | 53 +++++ .../abuse_9-13.json | 65 ++++++ .../annotation_17-21.json | 65 ++++++ .../annotation_22-26.json | 65 ++++++ .../annotation_27-31.json | 65 ++++++ .../annotation_32-52.json | 65 ++++++ .../annotation_53-56.json | 53 +++++ .../branch_86-91.json | 47 ++++ .../build_145-158.json | 133 ++++++++++++ .../build_50-70.json | 165 ++++++++++++++ .../build_75-140.json | 165 ++++++++++++++ .../commit_217-227.json | 141 ++++++++++++ .../commit_228-228.json | 25 +++ .../cron_3-4.json | 29 +++ .../job_154-160.json | 153 +++++++++++++ .../job_54-61.json | 196 +++++++++++++++++ .../job_62-72.json | 184 ++++++++++++++++ .../job_76-86.json | 196 +++++++++++++++++ .../job_87-150.json | 184 ++++++++++++++++ .../log_17-21.json | 85 ++++++++ .../log_22-26.json | 85 ++++++++ .../log_27-31.json | 85 ++++++++ .../log_32-52.json | 85 ++++++++ .../log_53-56.json | 69 ++++++ .../message_14-26.json | 70 ++++++ .../message_27-30.json | 57 +++++ .../message_9-13.json | 70 ++++++ .../permission_3-4.json | 25 +++ .../pull_request_3-6.json | 41 ++++ .../queueable_job_17-21.json | 35 +++ .../queueable_job_22-26.json | 35 +++ .../queueable_job_27-31.json | 35 +++ .../queueable_job_32-52.json | 35 +++ .../queueable_job_53-56.json | 29 +++ .../repository_1-1.json | 74 +++++++ .../request_11-15.json | 203 ++++++++++++++++++ .../request_16-30.json | 187 ++++++++++++++++ .../request_31-34.json | 157 ++++++++++++++ .../ssl_key_33-34.json | 25 +++ .../star_3-4.json | 23 ++ .../tag_33-38.json | 39 ++++ 44 files changed, 3761 insertions(+), 63 deletions(-) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index e612d14..0f5a10a 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -6,32 +6,29 @@ module RemoveWithAllDependencies include SaveFile def remove_user_with_dependencies(user_id) - date = actual_time_for_subfolder - @subfolder = "user_#{user_id}_#{date}" - user = User.find(user_id) - ids_to_remove = user.ids_of_all_dependencies(dependencies_to_filter)[:main] - ids_to_remove[:user] = [user_id] - save_ids_hash_to_file(ids_to_remove) - remove_ids_from_hash(ids_to_remove) + remove_entry_with_dependencies(:user, user_id) end def remove_org_with_dependencies(org_id) - date = actual_time_for_subfolder - @subfolder = "organization_#{org_id}_#{date}" - organization = Organization.find(org_id) - ids_to_remove = organization.ids_of_all_dependencies(dependencies_to_filter)[:main] - ids_to_remove[:organization] = [org_id] - save_ids_hash_to_file(ids_to_remove) - remove_ids_from_hash(ids_to_remove) + remove_entry_with_dependencies(:organization, org_id) end def remove_repo_with_dependencies(repo_id) - + remove_entry_with_dependencies(:repository, repo_id) end private - def actual_time_for_subfolder + def remove_entry_with_dependencies(model_name, id) + @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" + entry = Utils.get_model(model_name).find(id) + ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter)[:main] + ids_to_remove[model_name] = [id] + save_ids_hash_to_file(ids_to_remove) + remove_ids_from_hash(ids_to_remove) + end + + def time_for_subfolder Time.now.to_s.parameterize.underscore end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index d41b4f1..d2af09d 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -305,6 +305,30 @@ end end + def db_summary_hash + { + all: Utils.get_sum_of_rows_of_all_models, + logs: Log.all.size, + jobs: Job.all.size, + builds: Build.all.size, + requests: Request.all.size, + repositories: Repository.all.size, + branches: Branch.all.size, + tags: Tag.all.size, + commits: Commit.all.size, + crons: Cron.all.size, + pull_requests: PullRequest.all.size, + ssl_keys: SslKey.all.size, + stages: Stage.all.size, + stars: Star.all.size, + permissions: Permission.all.size, + messages: Message.all.size, + abuses: Abuse.all.size, + annotations: Annotation.all.size, + queueable_jobs: QueueableJob.all.size + } + end + describe 'remove_user_with_dependencies' do before(:each) do BeforeTests.new.run @@ -325,29 +349,7 @@ it 'removes user with all his dependencies with proper exceptions' do remove_specified.remove_user_with_dependencies(user.id) - hashes = { - all: Utils.get_sum_of_rows_of_all_models, - logs: Log.all.size, - jobs: Job.all.size, - builds: Build.all.size, - requests: Request.all.size, - repositories: Repository.all.size, - branches: Branch.all.size, - tags: Tag.all.size, - commits: Commit.all.size, - crons: Cron.all.size, - pull_requests: PullRequest.all.size, - ssl_keys: SslKey.all.size, - stages: Stage.all.size, - stars: Star.all.size, - permissions: Permission.all.size, - messages: Message.all.size, - abuses: Abuse.all.size, - annotations: Annotation.all.size, - queueable_jobs: QueueableJob.all.size - } - - expect(hashes).to eql( + expect(db_summary_hash).to eql( all: 870, logs: 64, jobs: 134, @@ -409,29 +411,7 @@ def get_expected_files(datetime) it 'removes organization with all its dependencies with proper exceptions' do remove_specified.remove_org_with_dependencies(organization.id) - hashes = { - all: Utils.get_sum_of_rows_of_all_models, - logs: Log.all.size, - jobs: Job.all.size, - builds: Build.all.size, - requests: Request.all.size, - repositories: Repository.all.size, - branches: Branch.all.size, - tags: Tag.all.size, - commits: Commit.all.size, - crons: Cron.all.size, - pull_requests: PullRequest.all.size, - ssl_keys: SslKey.all.size, - stages: Stage.all.size, - stars: Star.all.size, - permissions: Permission.all.size, - messages: Message.all.size, - abuses: Abuse.all.size, - annotations: Annotation.all.size, - queueable_jobs: QueueableJob.all.size - } - - expect(hashes).to eql( + expect(db_summary_hash).to eql( all: 870, logs: 64, jobs: 134, @@ -474,6 +454,64 @@ def get_expected_files(datetime) end describe 'remove_repo_with_dependencies' do - + before(:each) do + BeforeTests.new.run + end + + let!(:repository) { + FactoryBot.rewind_sequences + + db_helper.do_without_triggers do + FactoryBot.create( + :repository_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + end + } + + it 'removes repository with all its dependencies with proper exceptions' do + remove_specified.remove_repo_with_dependencies(repository.id) + + expect(db_summary_hash).to eql( + all: 470, + logs: 32, + jobs: 72, + builds: 50, + requests: 20, + repositories: 64, + branches: 36, + tags: 36, + commits: 12, + crons: 4, + pull_requests: 4, + ssl_keys: 4, + stages: 32, + stars: 4, + permissions: 4, + messages: 16, + abuses: 16, + annotations: 32, + queueable_jobs: 32 + ) + end + + def get_expected_files(datetime) + Dir['spec/support/expected_files/remove_repo_with_dependencies/*.json'].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end + end + + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files(datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_repo_with_dependencies(repository.id) + end + end end end diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json new file mode 100644 index 0000000..1e3d4b6 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 14, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 14, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 15, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "owner_id": null, + "owner_type": null, + "request_id": 17, + "level": 16, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 25, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "owner_id": null, + "owner_type": null, + "request_id": 29, + "level": 26, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json new file mode 100644 index 0000000..976b712 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json @@ -0,0 +1,53 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 27, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 27, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "owner_id": null, + "owner_type": null, + "request_id": 31, + "level": 28, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 29, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "owner_id": null, + "owner_type": null, + "request_id": 33, + "level": 30, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json new file mode 100644 index 0000000..ccbc679 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json @@ -0,0 +1,65 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 9, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 9, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 10, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 11, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "owner_id": null, + "owner_type": null, + "request_id": 13, + "level": 12, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "owner_id": null, + "owner_type": null, + "request_id": 15, + "level": 13, + "reason": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json new file mode 100644 index 0000000..b4394f7 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 17, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json new file mode 100644 index 0000000..0798bd9 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 22, + "job_id": 61, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json new file mode 100644 index 0000000..d951317 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 27, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json new file mode 100644 index 0000000..3fe71bf --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json @@ -0,0 +1,65 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json new file mode 100644 index 0000000..c7a937f --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json @@ -0,0 +1,53 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json new file mode 100644 index 0000000..176ec97 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json @@ -0,0 +1,47 @@ +{ + "table_name": "branches", + "data": [ + { + "id": 86, + "repository_id": 1, + "last_build_id": null, + "name": "branch_14", + "exists_on_github": true, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + "build": [ + 58, + 60 + ], + "commit": [ + 217, + 218 + ], + "cron": [ + 3, + 4 + ], + "job": [ + 61, + 62 + ], + "request": [ + 15, + 16 + ] + } + }, + { + "id": 91, + "repository_id": 1, + "last_build_id": null, + "name": "branch_19", + "exists_on_github": true, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json b/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json new file mode 100644 index 0000000..cb79fe0 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json @@ -0,0 +1,133 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 153, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 158, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 33, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json new file mode 100644 index 0000000..dbd358b --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 60, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 65, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": 217, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 70, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 13, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json new file mode 100644 index 0000000..3a2667c --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json @@ -0,0 +1,165 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 85, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 137, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 140, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "config": null, + "commit_id": null, + "request_id": 29, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json new file mode 100644 index 0000000..f94acb1 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json @@ -0,0 +1,141 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 217, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + "build": [ + 63, + 65 + ], + "job": [ + 66, + 67 + ], + "request": [ + 13, + 14 + ] + } + }, + { + "id": 218, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": 86, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 219, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + "build": [ + 78, + 80 + ], + "job": [ + 81, + 82 + ], + "request": [ + 17, + 18 + ] + } + }, + { + "id": 220, + "repository_id": 1, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": null, + "tag_id": null, + "_dependencies_": { + } + }, + { + "id": 227, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + "build": [ + 146, + 148 + ], + "job": [ + 149, + 150 + ], + "request": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json new file mode 100644 index 0000000..5272bc7 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json @@ -0,0 +1,25 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 228, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "branch_id": null, + "tag_id": 33, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json new file mode 100644 index 0000000..ae34c7a --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json @@ -0,0 +1,29 @@ +{ + "table_name": "crons", + "data": [ + { + "id": 3, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + }, + { + "id": 4, + "branch_id": 86, + "interval": "test", + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json b/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json new file mode 100644 index 0000000..99726ba --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json @@ -0,0 +1,153 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 154, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 53, + 54 + ], + "annotation": [ + 53, + 54 + ], + "queueable_job": [ + 53, + 54 + ] + } + }, + { + "id": 155, + "repository_id": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 159, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 55, + 56 + ], + "annotation": [ + 55, + 56 + ], + "queueable_job": [ + 55, + 56 + ] + } + }, + { + "id": 160, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json new file mode 100644 index 0000000..29e564b --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 54, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 17, + 18 + ], + "annotation": [ + 17, + 18 + ], + "queueable_job": [ + 17, + 18 + ] + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 56, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 19, + 20 + ], + "annotation": [ + 19, + 20 + ], + "queueable_job": [ + 19, + 20 + ] + } + }, + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 21, + 22 + ], + "annotation": [ + 21, + 22 + ], + "queueable_job": [ + 21, + 22 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json new file mode 100644 index 0000000..1151bda --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 66, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 23, + 24 + ], + "annotation": [ + 23, + 24 + ], + "queueable_job": [ + 23, + 24 + ] + } + }, + { + "id": 67, + "repository_id": null, + "commit_id": 217, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 71, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 25, + 26 + ], + "annotation": [ + 25, + 26 + ], + "queueable_job": [ + 25, + 26 + ] + } + }, + { + "id": 72, + "repository_id": null, + "commit_id": null, + "source_id": 13, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json new file mode 100644 index 0000000..fc8ce04 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json @@ -0,0 +1,196 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 76, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 27, + 28 + ], + "annotation": [ + 27, + 28 + ], + "queueable_job": [ + 27, + 28 + ] + } + }, + { + "id": 77, + "repository_id": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 81, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 29, + 30 + ], + "annotation": [ + 29, + 30 + ], + "queueable_job": [ + 29, + 30 + ] + } + }, + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 31, + 32 + ], + "annotation": [ + 31, + 32 + ], + "queueable_job": [ + 31, + 32 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json new file mode 100644 index 0000000..01e92fb --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json @@ -0,0 +1,184 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 49, + 50 + ], + "annotation": [ + 49, + 50 + ], + "queueable_job": [ + 49, + 50 + ] + } + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + }, + { + "id": 149, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 51, + 52 + ], + "annotation": [ + 51, + 52 + ], + "queueable_job": [ + 51, + 52 + ] + } + }, + { + "id": 150, + "repository_id": null, + "commit_id": 227, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json new file mode 100644 index 0000000..18e2587 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 17, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json new file mode 100644 index 0000000..d4fa48b --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 22, + "job_id": 61, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json new file mode 100644 index 0000000..bd0c24b --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 27, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json new file mode 100644 index 0000000..0fa3365 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json new file mode 100644 index 0000000..64d8617 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json @@ -0,0 +1,69 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 53, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json new file mode 100644 index 0000000..7f1db05 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 14, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 15, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 16, + "subject_id": 17, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 25, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 26, + "subject_id": 29, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json new file mode 100644 index 0000000..0ccd7ba --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json @@ -0,0 +1,57 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 27, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 28, + "subject_id": 31, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 29, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 30, + "subject_id": 33, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json new file mode 100644 index 0000000..083a2eb --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json @@ -0,0 +1,70 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 9, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 11, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 12, + "subject_id": 13, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 13, + "subject_id": 15, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json new file mode 100644 index 0000000..9e5945b --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json @@ -0,0 +1,25 @@ +{ + "table_name": "permissions", + "data": [ + { + "id": 3, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + }, + { + "id": 4, + "user_id": null, + "repository_id": 1, + "admin": false, + "push": false, + "pull": false, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json new file mode 100644 index 0000000..67841b2 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json @@ -0,0 +1,41 @@ +{ + "table_name": "pull_requests", + "data": [ + { + "id": 3, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + "request": [ + 29, + 30 + ], + "build": [ + 88, + 137 + ] + } + }, + { + "id": 6, + "repository_id": 1, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json new file mode 100644 index 0000000..281cd6a --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 17, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 19, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 20, + "job_id": 56, + "_dependencies_": { + } + }, + { + "id": 21, + "job_id": 61, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json new file mode 100644 index 0000000..be28310 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 22, + "job_id": 61, + "_dependencies_": { + } + }, + { + "id": 23, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 24, + "job_id": 66, + "_dependencies_": { + } + }, + { + "id": 25, + "job_id": 71, + "_dependencies_": { + } + }, + { + "id": 26, + "job_id": 71, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json new file mode 100644 index 0000000..f288927 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 27, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 28, + "job_id": 76, + "_dependencies_": { + } + }, + { + "id": 29, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 30, + "job_id": 81, + "_dependencies_": { + } + }, + { + "id": 31, + "job_id": 86, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json new file mode 100644 index 0000000..9bd6198 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json @@ -0,0 +1,35 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 32, + "job_id": 86, + "_dependencies_": { + } + }, + { + "id": 49, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 50, + "job_id": 141, + "_dependencies_": { + } + }, + { + "id": 51, + "job_id": 149, + "_dependencies_": { + } + }, + { + "id": 52, + "job_id": 149, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json new file mode 100644 index 0000000..e52cb93 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json @@ -0,0 +1,29 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 53, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 54, + "job_id": 154, + "_dependencies_": { + } + }, + { + "id": 55, + "job_id": 159, + "_dependencies_": { + } + }, + { + "id": 56, + "job_id": 159, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json new file mode 100644 index 0000000..417fcd3 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json @@ -0,0 +1,74 @@ +{ + "table_name": "repositories", + "data": [ + { + "id": 1, + "name": null, + "url": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null, + "_dependencies_": { + "build": [ + 1, + 50 + ], + "request": [ + 11, + 12 + ], + "job": [ + 56, + 57 + ], + "branch": [ + 86, + 91 + ], + "ssl_key": [ + 33, + 34 + ], + "commit": [ + 219, + 220 + ], + "permission": [ + 3, + 4 + ], + "star": [ + 3, + 4 + ], + "pull_request": [ + 3, + 6 + ], + "tag": [ + 33, + 38 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json new file mode 100644 index 0000000..0cd9879 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json @@ -0,0 +1,203 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 11, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 9, + 10 + ], + "message": [ + 9, + 10 + ], + "job": [ + 54, + 55 + ], + "build": [ + 51, + 53 + ] + } + }, + { + "id": 12, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 13, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 11, + 12 + ], + "message": [ + 11, + 12 + ], + "job": [ + 71, + 72 + ], + "build": [ + 68, + 70 + ] + } + }, + { + "id": 14, + "repository_id": null, + "commit_id": 217, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 15, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 13, + 14 + ], + "message": [ + 13, + 14 + ], + "job": [ + 76, + 77 + ], + "build": [ + 73, + 75 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json new file mode 100644 index 0000000..bc27a62 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json @@ -0,0 +1,187 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 16, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 17, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 15, + 16 + ], + "message": [ + 15, + 16 + ], + "job": [ + 86, + 87 + ], + "build": [ + 83, + 85 + ] + } + }, + { + "id": 18, + "repository_id": null, + "commit_id": 219, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 29, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 25, + 26 + ], + "message": [ + 25, + 26 + ], + "job": [ + 141, + 142 + ], + "build": [ + 138, + 140 + ] + } + }, + { + "id": 30, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 3, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json new file mode 100644 index 0000000..40ffe06 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json @@ -0,0 +1,157 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 31, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 27, + 28 + ], + "message": [ + 27, + 28 + ], + "job": [ + 154, + 155 + ], + "build": [ + 151, + 153 + ] + } + }, + { + "id": 32, + "repository_id": null, + "commit_id": 227, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 33, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "abuse": [ + 29, + 30 + ], + "message": [ + 29, + 30 + ], + "job": [ + 159, + 160 + ], + "build": [ + 156, + 158 + ] + } + }, + { + "id": 34, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json new file mode 100644 index 0000000..63f0596 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "ssl_keys", + "data": [ + { + "id": 33, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 34, + "repository_id": 1, + "public_key": null, + "private_key": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json new file mode 100644 index 0000000..878d51f --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json @@ -0,0 +1,23 @@ +{ + "table_name": "stars", + "data": [ + { + "id": 3, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + }, + { + "id": 4, + "repository_id": 1, + "user_id": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json new file mode 100644 index 0000000..89c33f0 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json @@ -0,0 +1,39 @@ +{ + "table_name": "tags", + "data": [ + { + "id": 33, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + "build": [ + 143, + 145 + ], + "commit": [ + 227, + 228 + ], + "request": [ + 33, + 34 + ] + } + }, + { + "id": 38, + "repository_id": 1, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file From 7efd47b618f63fbcf227f6cd4d73bc206a695b35 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 13 Oct 2021 11:03:48 +0200 Subject: [PATCH 34/88] removing with dependencies in dry mode --- .../remove_with_all_dependencies.rb | 11 ++++++++-- lib/dry_run_reporter.rb | 22 +++++++++++++++---- lib/models/job.rb | 2 ++ lib/models/repository.rb | 2 ++ lib/models/user.rb | 12 ++++++++++ lib/utils.rb | 2 ++ spec/backup/remove_specified_spec.rb | 16 ++++++++++++++ travis-backup.gemspec | 2 +- 8 files changed, 62 insertions(+), 7 deletions(-) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 0f5a10a..94c7331 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require 'backup/save_file' +require 'models/user' +require 'models/repository' module RemoveWithAllDependencies include SaveFile @@ -24,8 +26,13 @@ def remove_entry_with_dependencies(model_name, id) entry = Utils.get_model(model_name).find(id) ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter)[:main] ids_to_remove[model_name] = [id] - save_ids_hash_to_file(ids_to_remove) - remove_ids_from_hash(ids_to_remove) + + if @config.dry_run + @dry_run_reporter.add_to_report(ids_to_remove) + else + save_ids_hash_to_file(ids_to_remove) + remove_ids_from_hash(ids_to_remove) + end end def time_for_subfolder diff --git a/lib/dry_run_reporter.rb b/lib/dry_run_reporter.rb index 9ae2a86..b37bb7b 100644 --- a/lib/dry_run_reporter.rb +++ b/lib/dry_run_reporter.rb @@ -7,10 +7,12 @@ def initialize @report = {} end - def add_to_report(key, *values) - report[key] = [] if report[key].nil? - report[key].concat(values) - report[key].uniq! + def add_to_report(*args) + if args.first.class == Hash + add_to_report_as_hash(args.first) + else + add_to_report_as_key_and_values(*args) + end end def print_report @@ -27,6 +29,18 @@ def print_report private + def add_to_report_as_key_and_values(key, *values) + report[key] = [] if report[key].nil? + report[key].concat(values) + report[key].uniq! + end + + def add_to_report_as_hash(hash) + hash.each do |key, array| + add_to_report_as_key_and_values(key, *array) + end + end + def print_report_line(symbol) puts " - #{symbol}: #{@report[symbol].to_json}" if @report[symbol].any? end diff --git a/lib/models/job.rb b/lib/models/job.rb index 2a63ad4..b16d06f 100644 --- a/lib/models/job.rb +++ b/lib/models/job.rb @@ -3,6 +3,8 @@ require 'model' require 'models/repository' require 'models/log' +require 'models/annotation' +require 'models/queueable_job' # Job model class Job < Model diff --git a/lib/models/repository.rb b/lib/models/repository.rb index e1db550..8102fc0 100644 --- a/lib/models/repository.rb +++ b/lib/models/repository.rb @@ -3,6 +3,8 @@ require 'model' require 'models/build' require 'models/request' +require 'models/permission' +require 'models/star' # Repository model class Repository < Model diff --git a/lib/models/user.rb b/lib/models/user.rb index 74f3c93..85f4888 100644 --- a/lib/models/user.rb +++ b/lib/models/user.rb @@ -1,6 +1,18 @@ # frozen_string_literal: true require 'model' +require 'models/abuse' +require 'models/subscription' +require 'models/owner_group' +require 'models/trial' +require 'models/trial_allowance' +require 'models/broadcast' +require 'models/star' +require 'models/permission' +require 'models/token' +require 'models/email' +require 'models/membership' +require 'models/user_beta_feature' class User < Model has_many :builds_for_that_this_user_is_owner, as: :owner, class_name: 'Build' diff --git a/lib/utils.rb b/lib/utils.rb index 4066053..0010e89 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -1,3 +1,5 @@ +require 'models/repository' + class Utils def self.uniquely_join_hashes_of_arrays(*hashes) result = {} diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index d2af09d..ab46044 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -389,6 +389,22 @@ def get_expected_files(datetime) remove_specified.remove_user_with_dependencies(user.id) end end + + context 'when dry_run config is set to true' do + let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) + remove_specified.remove_user_with_dependencies(user.id) + end + + it 'does not remove entries from db' do + expect { + remove_specified.remove_user_with_dependencies(user.id) + }.not_to change { Utils.get_sum_of_rows_of_all_models } + end + end end describe 'remove_org_with_dependencies' do diff --git a/travis-backup.gemspec b/travis-backup.gemspec index 77927fd..a6bbc12 100644 --- a/travis-backup.gemspec +++ b/travis-backup.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'travis-backup' - s.version = '0.2.1' + s.version = '0.3.0' s.summary = 'Travis CI backup tool' s.authors = ['Karol Selak'] s.required_ruby_version = Gem::Requirement.new(">= 2.3.0") From e42b80a2ccf06bceacd81e46661c55cc1cc7b682 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 13 Oct 2021 12:07:15 +0200 Subject: [PATCH 35/88] removing with dependencies saves files only when if_backup is true --- .../remove_with_all_dependencies.rb | 2 +- spec/backup/remove_specified_spec.rb | 250 ++++++++++++------ 2 files changed, 164 insertions(+), 88 deletions(-) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 94c7331..2fb501b 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -30,7 +30,7 @@ def remove_entry_with_dependencies(model_name, id) if @config.dry_run @dry_run_reporter.add_to_report(ids_to_remove) else - save_ids_hash_to_file(ids_to_remove) + save_ids_hash_to_file(ids_to_remove) if @config.if_backup remove_ids_from_hash(ids_to_remove) end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index ab46044..cfd1c86 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -205,16 +205,10 @@ it_behaves_like 'not saving JSON to file' - it 'should not delete builds' do - expect { - remove_specified.remove_repo_builds(repository) - }.not_to change { Build.all.size } - end - - it 'should not delete jobs' do + it 'does not remove entries from db' do expect { remove_specified.remove_repo_builds(repository) - }.not_to change { Job.all.size } + }.not_to change { Utils.get_sum_of_rows_of_all_models } end end end @@ -297,10 +291,10 @@ it_behaves_like 'not saving JSON to file' - it 'should not delete requests' do + it 'does not remove entries from db' do expect { remove_specified.remove_repo_requests(repository) - }.not_to change { Request.all.size } + }.not_to change { Utils.get_sum_of_rows_of_all_models } end end end @@ -346,32 +340,43 @@ def db_summary_hash end } - it 'removes user with all his dependencies with proper exceptions' do - remove_specified.remove_user_with_dependencies(user.id) - - expect(db_summary_hash).to eql( - all: 870, - logs: 64, - jobs: 134, - builds: 90, - requests: 40, - repositories: 108, - branches: 62, - tags: 62, - commits: 24, - crons: 8, - pull_requests: 8, - ssl_keys: 8, - stages: 54, - stars: 8, - permissions: 8, - messages: 32, - abuses: 32, - annotations: 64, - queueable_jobs: 64 - ) + shared_context 'not saving files' do + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) + remove_specified.remove_user_with_dependencies(user.id) + end end + shared_context 'removing user with dependencies' do + it 'removes user with all his dependencies with proper exceptions' do + remove_specified.remove_user_with_dependencies(user.id) + + expect(db_summary_hash).to eql( + all: 870, + logs: 64, + jobs: 134, + builds: 90, + requests: 40, + repositories: 108, + branches: 62, + tags: 62, + commits: 24, + crons: 8, + pull_requests: 8, + ssl_keys: 8, + stages: 54, + stars: 8, + permissions: 8, + messages: 32, + abuses: 32, + annotations: 64, + queueable_jobs: 64 + ) + end + end + + it_behaves_like 'removing user with dependencies' + def get_expected_files(datetime) Dir['spec/support/expected_files/remove_user_with_dependencies/*.json'].map do |file_path| content = File.read(file_path) @@ -390,14 +395,20 @@ def get_expected_files(datetime) end end + context 'when if_backup config is set to false' do + let!(:config) { Config.new(files_location: files_location, limit: 5, if_backup: false) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it_behaves_like 'not saving files' + it_behaves_like 'removing user with dependencies' + end + + context 'when dry_run config is set to true' do - let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } + let!(:config) { Config.new(files_location: files_location, limit: 5, dry_run: true) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it 'does not save files' do - expect_any_instance_of(File).not_to receive(:write) - remove_specified.remove_user_with_dependencies(user.id) - end + it_behaves_like 'not saving files' it 'does not remove entries from db' do expect { @@ -424,30 +435,63 @@ def get_expected_files(datetime) end } - it 'removes organization with all its dependencies with proper exceptions' do - remove_specified.remove_org_with_dependencies(organization.id) - - expect(db_summary_hash).to eql( - all: 870, - logs: 64, - jobs: 134, - builds: 90, - requests: 40, - repositories: 108, - branches: 62, - tags: 62, - commits: 24, - crons: 8, - pull_requests: 8, - ssl_keys: 8, - stages: 54, - stars: 8, - permissions: 8, - messages: 32, - abuses: 32, - annotations: 64, - queueable_jobs: 64 - ) + shared_context 'not saving files' do + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) + remove_specified.remove_org_with_dependencies(organization.id) + end + end + + shared_context 'removing organization with dependencies' do + it 'removes organization with all its dependencies with proper exceptions' do + remove_specified.remove_org_with_dependencies(organization.id) + + expect(db_summary_hash).to eql( + all: 870, + logs: 64, + jobs: 134, + builds: 90, + requests: 40, + repositories: 108, + branches: 62, + tags: 62, + commits: 24, + crons: 8, + pull_requests: 8, + ssl_keys: 8, + stages: 54, + stars: 8, + permissions: 8, + messages: 32, + abuses: 32, + annotations: 64, + queueable_jobs: 64 + ) + end + end + + it_behaves_like 'removing organization with dependencies' + + context 'when if_backup config is set to false' do + let!(:config) { Config.new(files_location: files_location, limit: 5, if_backup: false) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it_behaves_like 'not saving files' + it_behaves_like 'removing organization with dependencies' + end + + + context 'when dry_run config is set to true' do + let!(:config) { Config.new(files_location: files_location, limit: 5, dry_run: true) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it_behaves_like 'not saving files' + + it 'does not remove entries from db' do + expect { + remove_specified.remove_org_with_dependencies(organization.id) + }.not_to change { Utils.get_sum_of_rows_of_all_models } + end end def get_expected_files(datetime) @@ -486,30 +530,62 @@ def get_expected_files(datetime) end } - it 'removes repository with all its dependencies with proper exceptions' do - remove_specified.remove_repo_with_dependencies(repository.id) - - expect(db_summary_hash).to eql( - all: 470, - logs: 32, - jobs: 72, - builds: 50, - requests: 20, - repositories: 64, - branches: 36, - tags: 36, - commits: 12, - crons: 4, - pull_requests: 4, - ssl_keys: 4, - stages: 32, - stars: 4, - permissions: 4, - messages: 16, - abuses: 16, - annotations: 32, - queueable_jobs: 32 - ) + shared_context 'not saving files' do + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) + remove_specified.remove_repo_with_dependencies(repository.id) + end + end + + shared_context 'removing repository with dependencies' do + it 'removes repository with all its dependencies with proper exceptions' do + remove_specified.remove_repo_with_dependencies(repository.id) + + expect(db_summary_hash).to eql( + all: 470, + logs: 32, + jobs: 72, + builds: 50, + requests: 20, + repositories: 64, + branches: 36, + tags: 36, + commits: 12, + crons: 4, + pull_requests: 4, + ssl_keys: 4, + stages: 32, + stars: 4, + permissions: 4, + messages: 16, + abuses: 16, + annotations: 32, + queueable_jobs: 32 + ) + end + end + + it_behaves_like 'removing repository with dependencies' + + context 'when if_backup config is set to false' do + let!(:config) { Config.new(files_location: files_location, limit: 5, if_backup: false) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it_behaves_like 'not saving files' + it_behaves_like 'removing repository with dependencies' + end + + context 'when dry_run config is set to true' do + let!(:config) { Config.new(files_location: files_location, limit: 5, dry_run: true) } + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + + it_behaves_like 'not saving files' + + it 'does not remove entries from db' do + expect { + remove_specified.remove_repo_with_dependencies(repository.id) + }.not_to change { Utils.get_sum_of_rows_of_all_models } + end end def get_expected_files(datetime) From 6c05abb40ead951d2b68f906c94ee5af474b99d8 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 13 Oct 2021 12:07:52 +0200 Subject: [PATCH 36/88] README updated --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36f5868..0a83c37 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README -*travis-backup* is an application that helps with housekeeping and backup for Travis CI database v2.2 and with migration to v3.0 database. By default it removes requests and builds with their corresponding jobs and logs, as long as they are older than given threshold says (and backups them in files, if this option is active). Although it can be also run with special modes: `move_logs`, for moving logs from one database to another, and `remove_orphans`, for deleting all orphaned data. +*travis-backup* is an application that helps with housekeeping and backup for Travis CI database v2.2 and with migration to v3.0 database. By default it removes requests and builds with their corresponding jobs and logs, as long as they are older than given threshold says (and backups them in files, if this option is active). Although it can be also run in special modes to perform other specific tasks. ### Installation and run @@ -62,7 +62,9 @@ Using `--move_logs` flag you can move all logs to database at `destination_db_ur Using `--remove_orphans` flag you can remove all orphaned data from tables. When you run gem in this mode no files are created. -Using `--dry_run` flag you can check which data would be removed by gem, but without removing them actually. Instead of that reports will be printed on standard output. This flag can be also combined with `--move_logs` or `--remove_orphans`. +Using `--user_id`, `--org_id` or `--repo_id` flag without setting `--threshold` results in removing the specified user/organization/repository with all its dependencies. It can be combined with `--backup` flag in order to save removed data in files. + +Using `--dry_run` flag you can check which data would be removed by gem, but without removing them actually. Instead of that reports will be printed on standard output. This flag can be also combined with special modes. ### Configuration options From 795ea25bced86f1a03370d2f2f362c6679538287 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 13 Oct 2021 12:54:23 +0200 Subject: [PATCH 37/88] should do -> does in tests --- spec/backup/remove_specified_spec.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index cfd1c86..c0f8a5e 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -84,12 +84,12 @@ } shared_context 'removing builds and jobs' do - it 'should delete all builds of the repository' do + it 'deletes all builds of the repository' do remove_specified.remove_repo_builds(repository) expect(Build.all.map(&:repository_id)).to eq([repository2.id]) end - it 'should delete all jobs of removed builds and leave the rest' do + it 'deletes all jobs of removed builds and leaves the rest' do expect { remove_specified.remove_repo_builds(repository) }.to change { Job.all.size }.by -4 @@ -98,7 +98,7 @@ expect(Job.all.map(&:source_id)).to eq([build_id, build_id]) end - it 'should delete all logs of removed jobs and leave the rest' do + it 'deletes all logs of removed jobs and leaves the rest' do expect { remove_specified.remove_repo_builds(repository) }.to change { Log.all.size }.by -8 @@ -109,14 +109,14 @@ end shared_context 'not saving JSON to file' do - it 'should not save JSON to file' do + it 'does not save JSON to file' do expect(File).not_to receive(:open) remove_specified.remove_repo_builds(repository) end end context 'when if_backup config is set to true' do - it 'should save proper build JSON file' do + it 'saves proper build JSON file' do expect_method_calls_on( File, :write, [JSON.pretty_generate(expected_builds_json)], @@ -127,7 +127,7 @@ end end - it 'should save proper job JSON files' do + it 'saves proper job JSON files' do expect_method_calls_on( File, :write, [ @@ -141,7 +141,7 @@ end end - it 'should save proper log JSON files' do + it 'saves proper log JSON files' do expect_method_calls_on( File, :write, [ @@ -157,7 +157,7 @@ end end - it 'should save JSON files at proper paths' do + it 'saves JSON files at proper paths' do expect_method_calls_on( File, :open, [ @@ -184,7 +184,7 @@ let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it 'should create needed folders' do + it 'creates needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original remove_specified.remove_repo_builds(repository) end @@ -239,26 +239,26 @@ } shared_context 'removing requests' do - it 'should delete all requests of the repository' do + it 'deletes all requests of the repository' do remove_specified.remove_repo_requests(repository) expect(Request.all.map(&:repository_id)).to eq([repository2.id]) end end shared_context 'not saving JSON to file' do - it 'should not save JSON to file' do + it 'does not save JSON to file' do expect(File).not_to receive(:open) remove_specified.remove_repo_requests(repository) end end context 'when if_backup config is set to true' do - it 'should save proper build JSON to file' do + it 'saves proper build JSON to file' do expect_any_instance_of(File).to receive(:write).once.with(JSON.pretty_generate(expected_requests_json)) remove_specified.remove_repo_requests(repository) end - it 'should save JSON to file at proper path' do + it 'saves JSON to file at proper path' do expect(File).to receive(:open).once.with(Regexp.new(files_location), 'w') remove_specified.remove_repo_requests(repository) end @@ -270,7 +270,7 @@ let!(:config) { Config.new(files_location: random_files_location, limit: 2) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it 'should create needed folders' do + it 'creates needed folders' do expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original remove_specified.remove_repo_requests(repository) end From 26d094fb8ceef3798df29a30b735d8d36840bcd9 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 13 Oct 2021 18:37:36 +0200 Subject: [PATCH 38/88] tests refactored --- spec/backup/remove_specified_spec.rb | 95 +++++++++++++--------------- 1 file changed, 43 insertions(+), 52 deletions(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index c0f8a5e..0965313 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -323,6 +323,13 @@ def db_summary_hash } end + def get_expected_files(directory, datetime) + Dir["spec/support/expected_files/#{directory}/*.json"].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end + end + describe 'remove_user_with_dependencies' do before(:each) do BeforeTests.new.run @@ -377,21 +384,16 @@ def db_summary_hash it_behaves_like 'removing user with dependencies' - def get_expected_files(datetime) - Dir['spec/support/expected_files/remove_user_with_dependencies/*.json'].map do |file_path| - content = File.read(file_path) - content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") - end - end - - it 'saves removed data to files in proper format' do - expect_method_calls_on( - File, :write, - get_expected_files(datetime), - allow_instances: true, - arguments_to_check: :first - ) do - remove_specified.remove_user_with_dependencies(user.id) + context 'when if_backup config is set to true' do + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files('remove_user_with_dependencies', datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_user_with_dependencies(user.id) + end end end @@ -472,6 +474,19 @@ def get_expected_files(datetime) it_behaves_like 'removing organization with dependencies' + context 'when if_backup config is set to true' do + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files('remove_org_with_dependencies', datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_org_with_dependencies(organization.id) + end + end + end + context 'when if_backup config is set to false' do let!(:config) { Config.new(files_location: files_location, limit: 5, if_backup: false) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } @@ -480,7 +495,6 @@ def get_expected_files(datetime) it_behaves_like 'removing organization with dependencies' end - context 'when dry_run config is set to true' do let!(:config) { Config.new(files_location: files_location, limit: 5, dry_run: true) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } @@ -493,24 +507,6 @@ def get_expected_files(datetime) }.not_to change { Utils.get_sum_of_rows_of_all_models } end end - - def get_expected_files(datetime) - Dir['spec/support/expected_files/remove_org_with_dependencies/*.json'].map do |file_path| - content = File.read(file_path) - content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") - end - end - - it 'saves removed data to files in proper format' do - expect_method_calls_on( - File, :write, - get_expected_files(datetime), - allow_instances: true, - arguments_to_check: :first - ) do - remove_specified.remove_org_with_dependencies(organization.id) - end - end end describe 'remove_repo_with_dependencies' do @@ -567,6 +563,19 @@ def get_expected_files(datetime) it_behaves_like 'removing repository with dependencies' + context 'when if_backup config is set to true' do + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files('remove_repo_with_dependencies', datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_repo_with_dependencies(repository.id) + end + end + end + context 'when if_backup config is set to false' do let!(:config) { Config.new(files_location: files_location, limit: 5, if_backup: false) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } @@ -587,23 +596,5 @@ def get_expected_files(datetime) }.not_to change { Utils.get_sum_of_rows_of_all_models } end end - - def get_expected_files(datetime) - Dir['spec/support/expected_files/remove_repo_with_dependencies/*.json'].map do |file_path| - content = File.read(file_path) - content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") - end - end - - it 'saves removed data to files in proper format' do - expect_method_calls_on( - File, :write, - get_expected_files(datetime), - allow_instances: true, - arguments_to_check: :first - ) do - remove_specified.remove_repo_with_dependencies(repository.id) - end - end end end From 7542801546baacdf28389e8ee4e5d973e4f30db5 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 14 Oct 2021 09:37:43 +0200 Subject: [PATCH 39/88] IdHash --- .../remove_with_all_dependencies.rb | 18 +- lib/id_hash.rb | 79 +++++++++ lib/ids_of_all_dependencies.rb | 148 ++++++++++++++++ lib/model.rb | 162 ++---------------- lib/utils.rb | 49 ------ spec/backup/remove_specified_spec.rb | 12 +- spec/utils_spec.rb | 45 ----- 7 files changed, 248 insertions(+), 265 deletions(-) create mode 100644 lib/id_hash.rb create mode 100644 lib/ids_of_all_dependencies.rb delete mode 100644 lib/utils.rb delete mode 100644 spec/utils_spec.rb diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 2fb501b..c185f58 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -23,7 +23,7 @@ def remove_repo_with_dependencies(repo_id) def remove_entry_with_dependencies(model_name, id) @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" - entry = Utils.get_model(model_name).find(id) + entry = Model.get_model(model_name).find(id) ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter)[:main] ids_to_remove[model_name] = [id] @@ -31,7 +31,8 @@ def remove_entry_with_dependencies(model_name, id) @dry_run_reporter.add_to_report(ids_to_remove) else save_ids_hash_to_file(ids_to_remove) if @config.if_backup - remove_ids_from_hash(ids_to_remove) + ids_to_remove.remove_entries_from_db(as_last: [:build]) + # order important because of foreign key constraint between builds and repos end end @@ -48,7 +49,7 @@ def save_ids_hash_to_file(ids_hash) end def save_ids_batch_to_file(name, ids_batch) - model = Utils.get_model(name) + model = Model.get_model(name) export = {} export[:table_name] = model.table_name @@ -78,15 +79,4 @@ def dependencies_to_filter ] } end - - def remove_ids_from_hash(ids_hash) - ids_hash.each do |name, ids| - next if name == :build - - model = Utils.get_model(name) - model.delete(ids) - end - Build.delete(ids_hash[:build]) - # order important because of foreign key constraint between builds and repos - end end diff --git a/lib/id_hash.rb b/lib/id_hash.rb new file mode 100644 index 0000000..cabdac2 --- /dev/null +++ b/lib/id_hash.rb @@ -0,0 +1,79 @@ +require 'model' + +class HashOfArrays < Hash + def initialize(hash = {}) + hash.each do |key, array| + self[key] = hash[key].clone + end + end + + def clone + self.class.new(self) + end + + def subtract(hash) + result = self.clone + hash.each do |key, array| + next if result[key].nil? + + array.each do |el| + result[key].delete(el) + end + + result.delete(key) if result[key].empty? + end + result + end + + def add(key, *values) + self[key] = [] if self[key].nil? + self[key].concat(values) + end + + def self.join(*hashes) + result = self.new + result.join(*hashes) + end + + def join(*hashes) + hashes.each do |hash| + hash.each do |key, array| + self.add(key, *array) + end + end + self + end +end + +class IdHash < HashOfArrays + def add(key, *values) + super(key, *values) + self[key].uniq! + end + + def remove_entries_from_db(as_first: [], as_last: []) + exceptionals = as_first + as_last + remove_from_exceptional(as_first) + + self.each do |name, ids| + next if exceptionals.include?(name) + remove_entries_from_array(name, ids) + end + + remove_from_exceptional(as_last) + end + + private + + def remove_from_exceptional(array) + array.each do |name| + ids = self[name] + remove_entries_from_array(name, ids) + end + end + + def remove_entries_from_array(model_name, ids) + model = Model.get_model(model_name) + model.delete(ids) if model.present? + end +end diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb new file mode 100644 index 0000000..305a621 --- /dev/null +++ b/lib/ids_of_all_dependencies.rb @@ -0,0 +1,148 @@ +require 'id_hash' + +module IdsOfAllDirectDependencies + def ids_of_all_direct_dependencies + result = IdHash.new + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + + symbol = association.klass.name.underscore.to_sym + self.send(association.name).map do |associated_object| + result.add(symbol, associated_object.id) + end + end + + result + end +end + +module IdsOfAllDependenciesNested + def ids_of_all_dependencies_nested(depth = Float::INFINITY) + result = depth > 0 ? get_associations(depth) : {} + result[:id] = id + result = result[:id] if result.size == 1 + result + end + + private + + def get_associations(depth) + result = {} + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + + symbol = association.klass.name.underscore.to_sym + self.send(association.name).map do |associated_object| + result[symbol] = [] if result[symbol].nil? + result[symbol] << associated_object.ids_of_all_dependencies_nested(depth - 1) + end + end + + result + end +end + +module IdsOfAllDependencies + include IdsOfAllDependenciesNested + include IdsOfAllDirectDependencies + + def ids_of_all_dependencies(to_filter=nil) + ids_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) + return ids_hash unless to_filter + move_wrongly_assigned_to_main(to_filter, ids_hash) + end + + def ids_of_all_dependencies_without_reflection(to_filter) + result = { main: IdHash.new, filtered_out: IdHash.new } + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + context = { to_filter: to_filter, association: association } + + self.send(association.name).map do |associated_object| + hash_to_use = get_hash_to_use(result, **context, object: associated_object) + hash_to_use.add(symbol, associated_object.id) + end + result = get_result_with_grandchildren_hashes(result, context) + end + + result + end + + private + + def move_wrongly_assigned_to_main(to_filter, ids_hash) + ids_hash[:filtered_out].each do |model_symbol, array| + array.each do |id| + object = Model.get_model(model_symbol).find(id) + move_object_to_main_if_necessary(to_filter[model_symbol], ids_hash, object) + end + end + ids_hash + end + + def move_object_to_main_if_necessary(associations_to_filter, ids_hash, object) + if should_object_be_moved?(associations_to_filter, ids_hash, object) + symbol = object.class.name.underscore.to_sym + ids_hash[:filtered_out][symbol].delete(object.id) + ids_hash[:main].add(symbol, object.id) + end + end + + def should_object_be_moved?(associations_to_filter, ids_hash, object) + associations_to_filter.map do |association| + associated = object.send(association) + + associated.to_a.empty? || associated.map do |associated_object| + class_symbol = associated_object.class.name.underscore.to_sym + ids_hash[:main][class_symbol]&.include?(associated_object.id) + end.reduce(:&) + end.reduce(:&) + end + + def get_result_with_grandchildren_hashes(result, context) + hashes = get_grandchildren_hashes(context) + main = hashes.map { |hash| hash[:main] } + filtered_out = hashes.map { |hash| hash[:filtered_out] } + + result[:main] =result[:main].join(*main) + result[:filtered_out] = result[:filtered_out].join(*filtered_out) + result + end + + def get_grandchildren_hashes(context) + association = context[:association] + to_filter = context[:to_filter] + + self.send(association.name).map do |associated_object| + next if should_be_filtered?(**context, object: associated_object) + associated_object.ids_of_all_dependencies_without_reflection(to_filter) + end.compact + end + + def get_hash_to_use(result, context) + symbol = should_be_filtered?(**context) ? :filtered_out : :main + result[symbol] + end + + def should_be_filtered?(to_filter:, association:, object:) + symbol = association.klass.name.underscore.to_sym + + association.klass.reflect_on_all_associations.each do |association2| + next if association2.macro == :belongs_to + + context = { to_filter: to_filter, symbol: symbol, association: association2 } + return true if object.send(association2.name).any? && is_this_association_filtered(**context) + end + + false + end + + def is_this_association_filtered(to_filter:, symbol:, association:) + arr = to_filter[symbol] + arr.present? && arr.any? { |a| a == association.name } + end +end \ No newline at end of file diff --git a/lib/model.rb b/lib/model.rb index 9cf1f8e..7e227cc 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -1,157 +1,7 @@ # frozen_string_literal: true require 'active_record' -require './utils' - -module IdsOfAllDirectDependencies - def ids_of_all_direct_dependencies - result = {} - - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - - symbol = association.klass.name.underscore.to_sym - self.send(association.name).map do |associated_object| - result[symbol] = [] if result[symbol].nil? - result[symbol] << associated_object.id - end - end - - result - end -end - -module IdsOfAllDependenciesNested - def ids_of_all_dependencies_nested(depth = Float::INFINITY) - result = depth > 0 ? get_associations(depth) : {} - result[:id] = id - result = result[:id] if result.size == 1 - result - end - - private - - def get_associations(depth) - result = {} - - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - - symbol = association.klass.name.underscore.to_sym - self.send(association.name).map do |associated_object| - result[symbol] = [] if result[symbol].nil? - result[symbol] << associated_object.ids_of_all_dependencies_nested(depth - 1) - end - end - - result - end -end - -module IdsOfAllDependencies - include IdsOfAllDependenciesNested - include IdsOfAllDirectDependencies - - def ids_of_all_dependencies(to_filter=nil) - ids_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) - return ids_hash unless to_filter - move_wrongly_assigned_to_main(to_filter, ids_hash) - end - - def ids_of_all_dependencies_without_reflection(to_filter) - result = { main: {}, filtered_out: {} } - - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, association: association } - - self.send(association.name).map do |associated_object| - hash_to_use = get_hash_to_use(result, **context, object: associated_object) - hash_to_use[symbol] = [] if hash_to_use[symbol].nil? - hash_to_use[symbol] << associated_object.id - end - result = get_result_with_grandchildren_hashes(result, context) - end - - result - end - - private - - def move_wrongly_assigned_to_main(to_filter, ids_hash) - ids_hash[:filtered_out].each do |model_symbol, array| - array.each do |id| - object = Utils.get_model(model_symbol).find(id) - move_object_to_main_if_necessary(to_filter[model_symbol], ids_hash, object) - end - end - ids_hash - end - - def move_object_to_main_if_necessary(associations_to_filter, ids_hash, object) - if should_object_be_moved?(associations_to_filter, ids_hash, object) - symbol = object.class.name.underscore.to_sym - ids_hash[:filtered_out][symbol].delete(object.id) - ids_hash[:main][symbol] = [] if ids_hash[:main][symbol].nil? - ids_hash[:main][symbol] << object.id - end - end - - def should_object_be_moved?(associations_to_filter, ids_hash, object) - associations_to_filter.map do |association| - associated = object.send(association) - - associated.to_a.empty? || associated.map do |associated_object| - class_symbol = associated_object.class.name.underscore.to_sym - ids_hash[:main][class_symbol]&.include?(associated_object.id) - end.reduce(:&) - end.reduce(:&) - end - - def get_result_with_grandchildren_hashes(result, context) - hashes = get_grandchildren_hashes(context) - main = hashes.map { |hash| hash[:main] } - filtered_out = hashes.map { |hash| hash[:filtered_out] } - - result[:main] = Utils.uniquely_join_hashes_of_arrays(result[:main], *main) - result[:filtered_out] = Utils.uniquely_join_hashes_of_arrays(result[:filtered_out], *filtered_out) - result - end - - def get_grandchildren_hashes(context) - association = context[:association] - to_filter = context[:to_filter] - - self.send(association.name).map do |associated_object| - next if should_be_filtered?(**context, object: associated_object) - associated_object.ids_of_all_dependencies_without_reflection(to_filter) - end.compact - end - - def get_hash_to_use(result, context) - symbol = should_be_filtered?(**context) ? :filtered_out : :main - result[symbol] - end - - def should_be_filtered?(to_filter:, association:, object:) - symbol = association.klass.name.underscore.to_sym - - association.klass.reflect_on_all_associations.each do |association2| - next if association2.macro == :belongs_to - - context = { to_filter: to_filter, symbol: symbol, association: association2 } - return true if object.send(association2.name).any? && is_this_association_filtered(**context) - end - - false - end - - def is_this_association_filtered(to_filter:, symbol:, association:) - arr = to_filter[symbol] - arr.present? && arr.any? { |a| a == association.name } - end -end +require 'ids_of_all_dependencies' # Model class class Model < ActiveRecord::Base @@ -162,6 +12,16 @@ class Model < ActiveRecord::Base def attributes_without_id self.attributes.reject{|k, v| k == "id"} end + + def self.get_model(name) + self.subclasses.find{ |m| m.name == name.to_s.camelcase } + end + + def self.get_sum_of_rows_of_all_models + self.subclasses.map do |subclass| + subclass.all.size + end.reduce(:+) + end end ActiveSupport::Inflector.inflections(:en) do |inflect| diff --git a/lib/utils.rb b/lib/utils.rb deleted file mode 100644 index 0010e89..0000000 --- a/lib/utils.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'models/repository' - -class Utils - def self.uniquely_join_hashes_of_arrays(*hashes) - result = {} - hashes.each do |hash| - hash.each do |key, array| - if result[key].nil? - result[key] = array - else - result[key].concat(array).uniq! - end - end - end - result - end - - def self.clone_hash_of_arrays(hash) - result = {} - hash.each do |key, array| - result[key] = hash[key].clone - end - result - end - - def self.difference_of_two_hashes_of_arrays(hash1, hash2) - result = self.clone_hash_of_arrays(hash1) - hash2.each do |key, array| - next if hash1[key].nil? - - array.each do |el| - result[key].delete(el) - end - - result.delete(key) if result[key].empty? - end - result - end - - def self.get_model(name) - Model.subclasses.find{ |m| m.name == name.to_s.camelcase } - end - - def self.get_sum_of_rows_of_all_models - Model.subclasses.map do |subclass| - subclass.all.size - end.reduce(:+) - end -end \ No newline at end of file diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 0965313..4ee486e 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -208,7 +208,7 @@ it 'does not remove entries from db' do expect { remove_specified.remove_repo_builds(repository) - }.not_to change { Utils.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_models } end end end @@ -294,14 +294,14 @@ it 'does not remove entries from db' do expect { remove_specified.remove_repo_requests(repository) - }.not_to change { Utils.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_models } end end end def db_summary_hash { - all: Utils.get_sum_of_rows_of_all_models, + all: Model.get_sum_of_rows_of_all_models, logs: Log.all.size, jobs: Job.all.size, builds: Build.all.size, @@ -415,7 +415,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.not_to change { Utils.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_models } end end end @@ -504,7 +504,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.not_to change { Utils.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_models } end end end @@ -593,7 +593,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.not_to change { Utils.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_models } end end end diff --git a/spec/utils_spec.rb b/spec/utils_spec.rb deleted file mode 100644 index fad108c..0000000 --- a/spec/utils_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -$: << 'lib' -require 'utils' - -describe Utils do - describe 'self.uniquely_join_hashes_of_arrays' do - context 'when proper hashes with arrays are given' do - let(:hash1) { - {a: [1, 2, 3], b: [2, 3, 4]} - } - let(:hash2) { - {a: [1, 2, 3, 4], b: [2, 5], c: [3, 4]} - } - let(:hash3) { - {a: [5, 1], d: [1, 3, 4]} - } - it 'returns proper hash with arrays joined uniquely' do - result = Utils.uniquely_join_hashes_of_arrays(hash1, hash2, hash3) - expect(result).to eql({ - a: [1, 2, 3, 4, 5], - b: [2, 3, 4, 5], - c: [3, 4], - d: [1, 3, 4] - }) - end - end - end - - describe 'self.difference_of_two_hashes_of_arrays' do - context 'when proper hashes with arrays are given' do - let(:hash1) { - {a: [1, 2, 3], b: [2, 3, 4], c: [1, 2]} - } - let(:hash2) { - {a: [1, 2, 3, 4], b: [2, 5], d: [3, 4]} - } - it 'returns proper hash with arrays joined uniquely' do - result = Utils.difference_of_two_hashes_of_arrays(hash1, hash2) - expect(result).to eql({ - b: [3, 4], - c: [1, 2] - }) - end - end - end -end \ No newline at end of file From 3c50ecdf1218cdafcea5809d556fa44f3c89d32a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 14 Oct 2021 11:29:20 +0200 Subject: [PATCH 40/88] saving heavy data to file tests wip --- .../remove_specified/remove_heavy_data.rb | 202 +++++++++++------- .../remove_with_all_dependencies.rb | 35 +-- lib/backup/save_id_hash_to_file.rb | 35 +++ lib/ids_of_all_dependencies.rb | 26 +-- spec/backup/remove_specified_spec.rb | 121 ++++------- .../remove_repo_builds/build_28-31.json | 77 +++++++ .../remove_repo_builds/job_29-30.json | 75 +++++++ .../remove_repo_builds/job_32-33.json | 75 +++++++ .../remove_repo_builds/log_37-38.json | 37 ++++ .../remove_repo_builds/log_39-40.json | 37 ++++ .../remove_repo_builds/log_41-42.json | 37 ++++ .../remove_repo_builds/log_43-44.json | 37 ++++ 12 files changed, 583 insertions(+), 211 deletions(-) create mode 100644 lib/backup/save_id_hash_to_file.rb create mode 100644 spec/support/expected_files/remove_repo_builds/build_28-31.json create mode 100644 spec/support/expected_files/remove_repo_builds/job_29-30.json create mode 100644 spec/support/expected_files/remove_repo_builds/job_32-33.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_37-38.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_39-40.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_41-42.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_43-44.json diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index c400601..5e5b43e 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -3,7 +3,7 @@ require 'backup/save_file' module RemoveHeavyData - include SaveFile + include SaveIdHashToFile def remove_heavy_data_for_repos_owned_by(owner_id, owner_type) Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| @@ -18,16 +18,32 @@ def remove_heavy_data_for_repo(repository) def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength threshold = @config.threshold.to_i.months.ago.to_datetime - current_build_id = repository.current_build_id || -1 - repository.builds.where('created_at < ? and id != ?', threshold, current_build_id) - .in_batches(of: @config.limit.to_i).map do |builds_batch| - if @config.if_backup - file_prefix = "repository_#{repository.id}" - save_and_destroy_builds_batch(builds_batch, file_prefix) - else - destroy_builds_batch(builds_batch) - end - end.compact.reduce(&:&) + builds_dependencies = repository.builds.where('created_at < ?', threshold).map do |build| + next if should_build_be_filtered?(build) + + result = build.ids_of_all_dependencies[:main] + result.add(:build, build.id) + result + end.compact + + ids_to_remove = IdHash.join(*builds_dependencies) + @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" + save_id_hash_to_file(ids_to_remove) if @config.if_backup + ids_to_remove.remove_entries_from_db + + + # .in_batches(of: @config.limit.to_i).map do |builds_batch| + # if @config.if_backup + # file_prefix = "repository_#{repository.id}" + # save_and_destroy_builds_batch(builds_batch, file_prefix) + # else + # destroy_builds_batch(builds_batch) + # end + # end.compact.reduce(&:&) + end + + def time_for_subfolder + Time.now.to_s.parameterize.underscore end def remove_repo_requests(repository) @@ -40,82 +56,106 @@ def remove_repo_requests(repository) private - def save_and_destroy_builds_batch(builds_batch, file_prefix) - builds_export = builds_batch.map(&:attributes) - - dependencies_saved = builds_batch.map do |build| - save_build_jobs_and_logs(build, file_prefix) - end.reduce(&:&) - - if dependencies_saved - file_name = "#{file_prefix}_builds_#{builds_batch.first.id}-#{builds_batch.last.id}.json" - pretty_json = JSON.pretty_generate(builds_export) - save_file(file_name, pretty_json) ? destroy_builds_batch(builds_batch) : false - else - false - end + def should_build_be_filtered?(build) + [ + build.repos_for_that_this_build_is_current.size, + build.repos_for_that_this_build_is_last.size, + build.tags_for_that_this_build_is_last.size, + build.branches_for_that_this_build_is_last.size + ].reduce(:+) > 0 end - def save_build_jobs_and_logs(build, file_prefix) - build.jobs.in_batches(of: @config.limit.to_i).map do |jobs_batch| - file_prefix = "#{file_prefix}_build_#{build.id}" - save_jobs_batch(jobs_batch, file_prefix) - end.compact.reduce(&:&) + def dependencies_to_filter + { + build: [ + :repos_for_that_this_build_is_current, + :repos_for_that_this_build_is_last, + :tags_for_that_this_build_is_last, + :branches_for_that_this_build_is_last + ] + } end - def save_jobs_batch(jobs_batch, file_prefix) - jobs_export = jobs_batch.map(&:attributes) - - logs_saved = jobs_batch.map do |job| - save_job_logs(job, file_prefix) - end.reduce(&:&) - - if logs_saved - file_name = "#{file_prefix}_jobs_#{jobs_batch.first.id}-#{jobs_batch.last.id}.json" - pretty_json = JSON.pretty_generate(jobs_export) - save_file(file_name, pretty_json) - else - false - end + def has_filtered_dependencies(build) + build.ids_of_all_dependencies(dependencies_to_filter)[:filtered_out].any? end - def save_job_logs(job, file_prefix) - job.logs.in_batches(of: @config.limit.to_i).map do |logs_batch| - file_prefix = "#{file_prefix}_job_#{job.id}" - save_logs_batch(logs_batch, file_prefix) - end.compact.reduce(&:&) - end - - def save_logs_batch(logs_batch, file_prefix) - logs_export = logs_batch.map(&:attributes) - file_name = "#{file_prefix}_logs_#{logs_batch.first.id}-#{logs_batch.last.id}.json" - pretty_json = JSON.pretty_generate(logs_export) - save_file(file_name, pretty_json) - end - - def destroy_builds_batch(builds_batch) - return destroy_builds_batch_dry(builds_batch) if @config.dry_run - - builds_batch.each(&:destroy) - end - - def destroy_builds_batch_dry(builds_batch) - @dry_run_reporter.add_to_report(:builds, *builds_batch.map(&:id)) - - jobs_ids = builds_batch.map do |build| - build.jobs.map(&:id) || [] - end.flatten - - @dry_run_reporter.add_to_report(:jobs, *jobs_ids) - - logs_ids = builds_batch.map do |build| - build.jobs.map do |job| - job.logs.map(&:id) || [] - end.flatten || [] - end.flatten - - @dry_run_reporter.add_to_report(:logs, *logs_ids) - end + # def save_and_destroy_builds_batch(builds_batch, file_prefix) + # builds_export = builds_batch.map(&:attributes) + + # dependencies_saved = builds_batch.map do |build| + # save_build_jobs_and_logs(build, file_prefix) + # end.reduce(&:&) + + # if dependencies_saved + # file_name = "#{file_prefix}_builds_#{builds_batch.first.id}-#{builds_batch.last.id}.json" + # pretty_json = JSON.pretty_generate(builds_export) + # save_file(file_name, pretty_json) ? destroy_builds_batch(builds_batch) : false + # else + # false + # end + # end + + # def save_build_jobs_and_logs(build, file_prefix) + # build.jobs.in_batches(of: @config.limit.to_i).map do |jobs_batch| + # file_prefix = "#{file_prefix}_build_#{build.id}" + # save_jobs_batch(jobs_batch, file_prefix) + # end.compact.reduce(&:&) + # end + + # def save_jobs_batch(jobs_batch, file_prefix) + # jobs_export = jobs_batch.map(&:attributes) + + # logs_saved = jobs_batch.map do |job| + # save_job_logs(job, file_prefix) + # end.reduce(&:&) + + # if logs_saved + # file_name = "#{file_prefix}_jobs_#{jobs_batch.first.id}-#{jobs_batch.last.id}.json" + # pretty_json = JSON.pretty_generate(jobs_export) + # save_file(file_name, pretty_json) + # else + # false + # end + # end + + # def save_job_logs(job, file_prefix) + # job.logs.in_batches(of: @config.limit.to_i).map do |logs_batch| + # file_prefix = "#{file_prefix}_job_#{job.id}" + # save_logs_batch(logs_batch, file_prefix) + # end.compact.reduce(&:&) + # end + + # def save_logs_batch(logs_batch, file_prefix) + # logs_export = logs_batch.map(&:attributes) + # file_name = "#{file_prefix}_logs_#{logs_batch.first.id}-#{logs_batch.last.id}.json" + # pretty_json = JSON.pretty_generate(logs_export) + # save_file(file_name, pretty_json) + # end + + # def destroy_builds_batch(builds_batch) + # return destroy_builds_batch_dry(builds_batch) if @config.dry_run + + # builds_batch.each(&:destroy) + # end + + # def destroy_builds_batch_dry(builds_batch) + # @dry_run_reporter.add_to_report(:builds, *builds_batch.map(&:id)) + + # jobs_ids = builds_batch.map do |build| + # build.jobs.map(&:id) || [] + # end.flatten + + # @dry_run_reporter.add_to_report(:jobs, *jobs_ids) + + # logs_ids = builds_batch.map do |build| + # build.jobs.map do |job| + # job.logs.map(&:id) || [] + # end.flatten || [] + # end.flatten + + # @dry_run_reporter.add_to_report(:logs, *logs_ids) + # end def save_and_destroy_requests_batch(requests_batch, repository) requests_export = requests_batch.map(&:attributes) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index c185f58..1fa09bf 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'backup/save_file' +require 'backup/save_id_hash_to_file' require 'models/user' require 'models/repository' module RemoveWithAllDependencies - include SaveFile + include SaveIdHashToFile def remove_user_with_dependencies(user_id) remove_entry_with_dependencies(:user, user_id) @@ -30,7 +30,7 @@ def remove_entry_with_dependencies(model_name, id) if @config.dry_run @dry_run_reporter.add_to_report(ids_to_remove) else - save_ids_hash_to_file(ids_to_remove) if @config.if_backup + save_id_hash_to_file(ids_to_remove) if @config.if_backup ids_to_remove.remove_entries_from_db(as_last: [:build]) # order important because of foreign key constraint between builds and repos end @@ -40,35 +40,6 @@ def time_for_subfolder Time.now.to_s.parameterize.underscore end - def save_ids_hash_to_file(ids_hash) - ids_hash.each do |name, ids| - ids.sort.each_slice(@config.limit.to_i) do |ids_batch| - save_ids_batch_to_file(name, ids_batch) - end - end - end - - def save_ids_batch_to_file(name, ids_batch) - model = Model.get_model(name) - - export = {} - export[:table_name] = model.table_name - export[:data] = ids_batch.map do |id| - get_exported_object(model, id) - end - - content = JSON.pretty_generate(export) - file_name = "#{@subfolder}/#{name}_#{ids_batch.first}-#{ids_batch.last}.json" - save_file(file_name, content) - end - - def get_exported_object(model, id) - object = model.find(id) - result = object.attributes - result[:_dependencies_] = object.ids_of_all_direct_dependencies - result - end - def dependencies_to_filter { build: [ diff --git a/lib/backup/save_id_hash_to_file.rb b/lib/backup/save_id_hash_to_file.rb new file mode 100644 index 0000000..0bae263 --- /dev/null +++ b/lib/backup/save_id_hash_to_file.rb @@ -0,0 +1,35 @@ +require 'backup/save_file' + +module SaveIdHashToFile + include SaveFile + + def save_id_hash_to_file(id_hash) + id_hash.each do |name, ids| + ids.sort.each_slice(@config.limit.to_i) do |ids_batch| + save_ids_batch_to_file(name, ids_batch) + end + end + end + + def save_ids_batch_to_file(name, ids_batch) + model = Model.get_model(name) + + export = {} + export[:table_name] = model.table_name + export[:data] = ids_batch.map do |id| + get_exported_object(model, id) + end + + content = JSON.pretty_generate(export) + file_name = "#{name}_#{ids_batch.first}-#{ids_batch.last}.json" + file_path = @subfolder.present? ? "#{@subfolder}/#{file_name}" : file_name + save_file(file_path, content) + end + + def get_exported_object(model, id) + object = model.find(id) + result = object.attributes + result[:_dependencies_] = object.ids_of_all_direct_dependencies + result + end +end \ No newline at end of file diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 305a621..79d2c78 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -49,9 +49,9 @@ module IdsOfAllDependencies include IdsOfAllDirectDependencies def ids_of_all_dependencies(to_filter=nil) - ids_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) - return ids_hash unless to_filter - move_wrongly_assigned_to_main(to_filter, ids_hash) + id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) + return id_hash unless to_filter + move_wrongly_assigned_to_main(to_filter, id_hash) end def ids_of_all_dependencies_without_reflection(to_filter) @@ -74,31 +74,31 @@ def ids_of_all_dependencies_without_reflection(to_filter) private - def move_wrongly_assigned_to_main(to_filter, ids_hash) - ids_hash[:filtered_out].each do |model_symbol, array| + def move_wrongly_assigned_to_main(to_filter, id_hash) + id_hash[:filtered_out].each do |model_symbol, array| array.each do |id| object = Model.get_model(model_symbol).find(id) - move_object_to_main_if_necessary(to_filter[model_symbol], ids_hash, object) + move_object_to_main_if_necessary(to_filter[model_symbol], id_hash, object) end end - ids_hash + id_hash end - def move_object_to_main_if_necessary(associations_to_filter, ids_hash, object) - if should_object_be_moved?(associations_to_filter, ids_hash, object) + def move_object_to_main_if_necessary(associations_to_filter, id_hash, object) + if should_object_be_moved?(associations_to_filter, id_hash, object) symbol = object.class.name.underscore.to_sym - ids_hash[:filtered_out][symbol].delete(object.id) - ids_hash[:main].add(symbol, object.id) + id_hash[:filtered_out][symbol].delete(object.id) + id_hash[:main].add(symbol, object.id) end end - def should_object_be_moved?(associations_to_filter, ids_hash, object) + def should_object_be_moved?(associations_to_filter, id_hash, object) associations_to_filter.map do |association| associated = object.send(association) associated.to_a.empty? || associated.map do |associated_object| class_symbol = associated_object.class.name.underscore.to_sym - ids_hash[:main][class_symbol]&.include?(associated_object.id) + id_hash[:main][class_symbol]&.include?(associated_object.id) end.reduce(:&) end.reduce(:&) end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 4ee486e..ce4cb7d 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -13,6 +13,37 @@ require 'byebug' describe Backup::RemoveSpecified do + def db_summary_hash + { + all: Model.get_sum_of_rows_of_all_models, + logs: Log.all.size, + jobs: Job.all.size, + builds: Build.all.size, + requests: Request.all.size, + repositories: Repository.all.size, + branches: Branch.all.size, + tags: Tag.all.size, + commits: Commit.all.size, + crons: Cron.all.size, + pull_requests: PullRequest.all.size, + ssl_keys: SslKey.all.size, + stages: Stage.all.size, + stars: Star.all.size, + permissions: Permission.all.size, + messages: Message.all.size, + abuses: Abuse.all.size, + annotations: Annotation.all.size, + queueable_jobs: QueueableJob.all.size + } + end + + def get_expected_files(directory, datetime) + Dir["spec/support/expected_files/#{directory}/*.json"].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end + end + before(:all) do BeforeTests.new.run end @@ -116,40 +147,12 @@ end context 'when if_backup config is set to true' do - it 'saves proper build JSON file' do - expect_method_calls_on( - File, :write, - [JSON.pretty_generate(expected_builds_json)], - allow_instances: true, - arguments_to_check: :first - ) do - remove_specified.remove_repo_builds(repository) - end - end - - it 'saves proper job JSON files' do - expect_method_calls_on( - File, :write, - [ - JSON.pretty_generate(expected_jobs_jsons.first), - JSON.pretty_generate(expected_jobs_jsons.second) - ], - allow_instances: true, - arguments_to_check: :first - ) do - remove_specified.remove_repo_builds(repository) - end - end + it_behaves_like 'removing builds and jobs' - it 'saves proper log JSON files' do + it 'saves removed data to files in proper format' do expect_method_calls_on( File, :write, - [ - JSON.pretty_generate(expected_logs_jsons.first), - JSON.pretty_generate(expected_logs_jsons.second), - JSON.pretty_generate(expected_logs_jsons.third), - JSON.pretty_generate(expected_logs_jsons.fourth), - ], + get_expected_files('remove_repo_builds', datetime), allow_instances: true, arguments_to_check: :first ) do @@ -157,35 +160,14 @@ end end - it 'saves JSON files at proper paths' do - expect_method_calls_on( - File, :open, - [ - Regexp.new('dump/tests/repository_\d+_build_\d+_job_\d+_logs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_build_\d+_job_\d+_logs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_build_\d+_jobs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_build_\d+_job_\d+_logs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_build_\d+_job_\d+_logs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_build_\d+_jobs_\d+-\d+.json'), - Regexp.new('dump/tests/repository_\d+_builds_\d+-\d+.json') - ], - match_mode: :match, - arguments_to_check: :first - ) do - remove_specified.remove_repo_builds(repository) - end - end - - it_behaves_like 'removing builds and jobs' - context 'when path with nonexistent folders is given' do let(:random_files_location) { "dump/tests/#{rand(100000)}" } let!(:config) { Config.new(files_location: random_files_location, limit: 2) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it 'creates needed folders' do - expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original + path_regexp = Regexp.new("#{random_files_location}/.+") + expect(FileUtils).to receive(:mkdir_p).once.with(path_regexp).and_call_original remove_specified.remove_repo_builds(repository) end end @@ -299,37 +281,6 @@ end end - def db_summary_hash - { - all: Model.get_sum_of_rows_of_all_models, - logs: Log.all.size, - jobs: Job.all.size, - builds: Build.all.size, - requests: Request.all.size, - repositories: Repository.all.size, - branches: Branch.all.size, - tags: Tag.all.size, - commits: Commit.all.size, - crons: Cron.all.size, - pull_requests: PullRequest.all.size, - ssl_keys: SslKey.all.size, - stages: Stage.all.size, - stars: Star.all.size, - permissions: Permission.all.size, - messages: Message.all.size, - abuses: Abuse.all.size, - annotations: Annotation.all.size, - queueable_jobs: QueueableJob.all.size - } - end - - def get_expected_files(directory, datetime) - Dir["spec/support/expected_files/#{directory}/*.json"].map do |file_path| - content = File.read(file_path) - content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") - end - end - describe 'remove_user_with_dependencies' do before(:each) do BeforeTests.new.run diff --git a/spec/support/expected_files/remove_repo_builds/build_28-31.json b/spec/support/expected_files/remove_repo_builds/build_28-31.json new file mode 100644 index 0000000..bfd8c9d --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/build_28-31.json @@ -0,0 +1,77 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 28, + "repository_id": 7, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "job": [ + 29, + 30 + ] + } + }, + { + "id": 31, + "repository_id": 7, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "job": [ + 32, + 33 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_29-30.json b/spec/support/expected_files/remove_repo_builds/job_29-30.json new file mode 100644 index 0000000..d8e0bb4 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_29-30.json @@ -0,0 +1,75 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 29, + "repository_id": 7, + "commit_id": null, + "source_id": 28, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 37, + 38 + ] + } + }, + { + "id": 30, + "repository_id": 7, + "commit_id": null, + "source_id": 28, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 39, + 40 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_32-33.json b/spec/support/expected_files/remove_repo_builds/job_32-33.json new file mode 100644 index 0000000..ce4c38d --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_32-33.json @@ -0,0 +1,75 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 32, + "repository_id": 7, + "commit_id": null, + "source_id": 31, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 41, + 42 + ] + } + }, + { + "id": 33, + "repository_id": 7, + "commit_id": null, + "source_id": 31, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 43, + 44 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_37-38.json b/spec/support/expected_files/remove_repo_builds/log_37-38.json new file mode 100644 index 0000000..c8af792 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_37-38.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 37, + "job_id": 29, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 38, + "job_id": 29, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_39-40.json b/spec/support/expected_files/remove_repo_builds/log_39-40.json new file mode 100644 index 0000000..c8674da --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_39-40.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 39, + "job_id": 30, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 40, + "job_id": 30, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_41-42.json b/spec/support/expected_files/remove_repo_builds/log_41-42.json new file mode 100644 index 0000000..29a438f --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_41-42.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 41, + "job_id": 32, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 42, + "job_id": 32, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_43-44.json b/spec/support/expected_files/remove_repo_builds/log_43-44.json new file mode 100644 index 0000000..c828ad2 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_43-44.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 43, + "job_id": 33, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 44, + "job_id": 33, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:18:55 UTC", + "updated_at": "2021-03-14 10:18:55 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file From 6a36a1b66c0e9794bdf66f62ef2d48d932da440b Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 14 Oct 2021 16:33:12 +0200 Subject: [PATCH 41/88] saving heavy data to files --- .../remove_specified/remove_heavy_data.rb | 129 ++++------------ spec/backup/remove_specified_spec.rb | 44 ++++-- .../{build_28-31.json => build_1-4.json} | 24 +-- .../remove_repo_builds/job_2-6.json | 145 ++++++++++++++++++ .../remove_repo_builds/job_29-30.json | 75 --------- .../remove_repo_builds/job_32-33.json | 75 --------- .../remove_repo_builds/log_1-5.json | 85 ++++++++++ .../remove_repo_builds/log_37-38.json | 37 ----- .../remove_repo_builds/log_39-40.json | 37 ----- .../remove_repo_builds/log_41-42.json | 37 ----- .../remove_repo_builds/log_43-44.json | 37 ----- .../remove_repo_builds/log_6-8.json | 53 +++++++ .../remove_repo_requests/request_1-2.json | 65 ++++++++ 13 files changed, 413 insertions(+), 430 deletions(-) rename spec/support/expected_files/remove_repo_builds/{build_28-31.json => build_1-4.json} (81%) create mode 100644 spec/support/expected_files/remove_repo_builds/job_2-6.json delete mode 100644 spec/support/expected_files/remove_repo_builds/job_29-30.json delete mode 100644 spec/support/expected_files/remove_repo_builds/job_32-33.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_1-5.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_37-38.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_39-40.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_41-42.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_43-44.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_6-8.json create mode 100644 spec/support/expected_files/remove_repo_requests/request_1-2.json diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 5e5b43e..2891d5f 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -28,41 +28,41 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me ids_to_remove = IdHash.join(*builds_dependencies) @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" - save_id_hash_to_file(ids_to_remove) if @config.if_backup - ids_to_remove.remove_entries_from_db - - - # .in_batches(of: @config.limit.to_i).map do |builds_batch| - # if @config.if_backup - # file_prefix = "repository_#{repository.id}" - # save_and_destroy_builds_batch(builds_batch, file_prefix) - # else - # destroy_builds_batch(builds_batch) - # end - # end.compact.reduce(&:&) - end - - def time_for_subfolder - Time.now.to_s.parameterize.underscore + process_ids_to_remove(ids_to_remove) end def remove_repo_requests(repository) threshold = @config.threshold.to_i.months.ago.to_datetime - repository.requests.where('created_at < ?', threshold) - .in_batches(of: @config.limit.to_i).map do |requests_batch| - @config.if_backup ? save_and_destroy_requests_batch(requests_batch, repository) : destroy_requests_batch(requests_batch) - end.compact + requests_dependencies = repository.requests.where('created_at < ?', threshold).map do |request| + result = request.ids_of_all_dependencies(dependencies_to_filter)[:main] + result.add(:request, request.id) + result + end + + ids_to_remove = IdHash.join(*requests_dependencies) + @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" + process_ids_to_remove(ids_to_remove) end private + def process_ids_to_remove(ids_to_remove) + if @config.dry_run + @dry_run_reporter.add_to_report(ids_to_remove) + else + save_id_hash_to_file(ids_to_remove) if @config.if_backup + ids_to_remove.remove_entries_from_db + end + end + + def time_for_subfolder + Time.now.to_s.parameterize.underscore + end + def should_build_be_filtered?(build) - [ - build.repos_for_that_this_build_is_current.size, - build.repos_for_that_this_build_is_last.size, - build.tags_for_that_this_build_is_last.size, - build.branches_for_that_this_build_is_last.size - ].reduce(:+) > 0 + dependencies_to_filter[:build].map do |association| + build.send(association).to_a + end.flatten.any? end def dependencies_to_filter @@ -80,83 +80,6 @@ def has_filtered_dependencies(build) build.ids_of_all_dependencies(dependencies_to_filter)[:filtered_out].any? end - # def save_and_destroy_builds_batch(builds_batch, file_prefix) - # builds_export = builds_batch.map(&:attributes) - - # dependencies_saved = builds_batch.map do |build| - # save_build_jobs_and_logs(build, file_prefix) - # end.reduce(&:&) - - # if dependencies_saved - # file_name = "#{file_prefix}_builds_#{builds_batch.first.id}-#{builds_batch.last.id}.json" - # pretty_json = JSON.pretty_generate(builds_export) - # save_file(file_name, pretty_json) ? destroy_builds_batch(builds_batch) : false - # else - # false - # end - # end - - # def save_build_jobs_and_logs(build, file_prefix) - # build.jobs.in_batches(of: @config.limit.to_i).map do |jobs_batch| - # file_prefix = "#{file_prefix}_build_#{build.id}" - # save_jobs_batch(jobs_batch, file_prefix) - # end.compact.reduce(&:&) - # end - - # def save_jobs_batch(jobs_batch, file_prefix) - # jobs_export = jobs_batch.map(&:attributes) - - # logs_saved = jobs_batch.map do |job| - # save_job_logs(job, file_prefix) - # end.reduce(&:&) - - # if logs_saved - # file_name = "#{file_prefix}_jobs_#{jobs_batch.first.id}-#{jobs_batch.last.id}.json" - # pretty_json = JSON.pretty_generate(jobs_export) - # save_file(file_name, pretty_json) - # else - # false - # end - # end - - # def save_job_logs(job, file_prefix) - # job.logs.in_batches(of: @config.limit.to_i).map do |logs_batch| - # file_prefix = "#{file_prefix}_job_#{job.id}" - # save_logs_batch(logs_batch, file_prefix) - # end.compact.reduce(&:&) - # end - - # def save_logs_batch(logs_batch, file_prefix) - # logs_export = logs_batch.map(&:attributes) - # file_name = "#{file_prefix}_logs_#{logs_batch.first.id}-#{logs_batch.last.id}.json" - # pretty_json = JSON.pretty_generate(logs_export) - # save_file(file_name, pretty_json) - # end - - # def destroy_builds_batch(builds_batch) - # return destroy_builds_batch_dry(builds_batch) if @config.dry_run - - # builds_batch.each(&:destroy) - # end - - # def destroy_builds_batch_dry(builds_batch) - # @dry_run_reporter.add_to_report(:builds, *builds_batch.map(&:id)) - - # jobs_ids = builds_batch.map do |build| - # build.jobs.map(&:id) || [] - # end.flatten - - # @dry_run_reporter.add_to_report(:jobs, *jobs_ids) - - # logs_ids = builds_batch.map do |build| - # build.jobs.map do |job| - # job.logs.map(&:id) || [] - # end.flatten || [] - # end.flatten - - # @dry_run_reporter.add_to_report(:logs, *logs_ids) - # end - def save_and_destroy_requests_batch(requests_batch, repository) requests_export = requests_batch.map(&:attributes) file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index ce4cb7d..6e2ca0a 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -71,6 +71,10 @@ def get_expected_files(directory, datetime) end describe 'remove_repo_builds' do + before(:each) do + BeforeTests.new.run + end + after(:each) do Repository.destroy_all Build.destroy_all @@ -139,9 +143,9 @@ def get_expected_files(directory, datetime) end end - shared_context 'not saving JSON to file' do - it 'does not save JSON to file' do - expect(File).not_to receive(:open) + shared_context 'not saving files' do + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) remove_specified.remove_repo_builds(repository) end end @@ -177,7 +181,7 @@ def get_expected_files(directory, datetime) let!(:config) { Config.new(files_location: files_location, limit: 2, if_backup: false) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it_behaves_like 'not saving JSON to file' + it_behaves_like 'not saving files' it_behaves_like 'removing builds and jobs' end @@ -185,7 +189,7 @@ def get_expected_files(directory, datetime) let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it_behaves_like 'not saving JSON to file' + it_behaves_like 'not saving files' it 'does not remove entries from db' do expect { @@ -196,9 +200,8 @@ def get_expected_files(directory, datetime) end describe 'remove_repo_requests' do - after(:each) do - Repository.destroy_all - Request.destroy_all + before(:each) do + BeforeTests.new.run end let!(:repository) { @@ -227,17 +230,23 @@ def get_expected_files(directory, datetime) end end - shared_context 'not saving JSON to file' do - it 'does not save JSON to file' do - expect(File).not_to receive(:open) + shared_context 'not saving files' do + it 'does not save files' do + expect_any_instance_of(File).not_to receive(:write) remove_specified.remove_repo_requests(repository) end end context 'when if_backup config is set to true' do - it 'saves proper build JSON to file' do - expect_any_instance_of(File).to receive(:write).once.with(JSON.pretty_generate(expected_requests_json)) - remove_specified.remove_repo_requests(repository) + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files('remove_repo_requests', datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_specified.remove_repo_requests(repository) + end end it 'saves JSON to file at proper path' do @@ -253,7 +262,8 @@ def get_expected_files(directory, datetime) let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it 'creates needed folders' do - expect(FileUtils).to receive(:mkdir_p).once.with(random_files_location).and_call_original + path_regexp = Regexp.new("#{random_files_location}/.+") + expect(FileUtils).to receive(:mkdir_p).once.with(path_regexp).and_call_original remove_specified.remove_repo_requests(repository) end end @@ -263,7 +273,7 @@ def get_expected_files(directory, datetime) let!(:config) { Config.new(files_location: files_location, limit: 2, if_backup: false) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it_behaves_like 'not saving JSON to file' + it_behaves_like 'not saving files' it_behaves_like 'removing requests' end @@ -271,7 +281,7 @@ def get_expected_files(directory, datetime) let!(:config) { Config.new(files_location: files_location, limit: 2, dry_run: true) } let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } - it_behaves_like 'not saving JSON to file' + it_behaves_like 'not saving files' it 'does not remove entries from db' do expect { diff --git a/spec/support/expected_files/remove_repo_builds/build_28-31.json b/spec/support/expected_files/remove_repo_builds/build_1-4.json similarity index 81% rename from spec/support/expected_files/remove_repo_builds/build_28-31.json rename to spec/support/expected_files/remove_repo_builds/build_1-4.json index bfd8c9d..3729e84 100644 --- a/spec/support/expected_files/remove_repo_builds/build_28-31.json +++ b/spec/support/expected_files/remove_repo_builds/build_1-4.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 28, - "repository_id": 7, + "id": 1, + "repository_id": 1, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", "config": null, "commit_id": null, "request_id": null, @@ -32,19 +32,19 @@ "sender_type": null, "_dependencies_": { "job": [ - 29, - 30 + 2, + 3 ] } }, { - "id": 31, - "repository_id": 7, + "id": 4, + "repository_id": 1, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", "config": null, "commit_id": null, "request_id": null, @@ -68,8 +68,8 @@ "sender_type": null, "_dependencies_": { "job": [ - 32, - 33 + 5, + 6 ] } } diff --git a/spec/support/expected_files/remove_repo_builds/job_2-6.json b/spec/support/expected_files/remove_repo_builds/job_2-6.json new file mode 100644 index 0000000..af9492e --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_2-6.json @@ -0,0 +1,145 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 2, + "repository_id": 1, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 1, + 2 + ] + } + }, + { + "id": 3, + "repository_id": 1, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 3, + 4 + ] + } + }, + { + "id": 5, + "repository_id": 1, + "commit_id": null, + "source_id": 4, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 5, + 6 + ] + } + }, + { + "id": 6, + "repository_id": 1, + "commit_id": null, + "source_id": 4, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 7, + 8 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_29-30.json b/spec/support/expected_files/remove_repo_builds/job_29-30.json deleted file mode 100644 index d8e0bb4..0000000 --- a/spec/support/expected_files/remove_repo_builds/job_29-30.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "table_name": "jobs", - "data": [ - { - "id": 29, - "repository_id": 7, - "commit_id": null, - "source_id": 28, - "source_type": "Build", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 37, - 38 - ] - } - }, - { - "id": 30, - "repository_id": 7, - "commit_id": null, - "source_id": 28, - "source_type": "Build", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 39, - 40 - ] - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_32-33.json b/spec/support/expected_files/remove_repo_builds/job_32-33.json deleted file mode 100644 index ce4c38d..0000000 --- a/spec/support/expected_files/remove_repo_builds/job_32-33.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "table_name": "jobs", - "data": [ - { - "id": 32, - "repository_id": 7, - "commit_id": null, - "source_id": 31, - "source_type": "Build", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 41, - 42 - ] - } - }, - { - "id": 33, - "repository_id": 7, - "commit_id": null, - "source_id": 31, - "source_type": "Build", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 43, - 44 - ] - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_1-5.json b/spec/support/expected_files/remove_repo_builds/log_1-5.json new file mode 100644 index 0000000..d0098fb --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_1-5.json @@ -0,0 +1,85 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 1, + "job_id": 2, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 2, + "job_id": 2, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 3, + "job_id": 3, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 4, + "job_id": 3, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 5, + "job_id": 5, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_37-38.json b/spec/support/expected_files/remove_repo_builds/log_37-38.json deleted file mode 100644 index c8af792..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_37-38.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 37, - "job_id": 29, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 38, - "job_id": 29, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_39-40.json b/spec/support/expected_files/remove_repo_builds/log_39-40.json deleted file mode 100644 index c8674da..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_39-40.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 39, - "job_id": 30, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 40, - "job_id": 30, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_41-42.json b/spec/support/expected_files/remove_repo_builds/log_41-42.json deleted file mode 100644 index 29a438f..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_41-42.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 41, - "job_id": 32, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 42, - "job_id": 32, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_43-44.json b/spec/support/expected_files/remove_repo_builds/log_43-44.json deleted file mode 100644 index c828ad2..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_43-44.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 43, - "job_id": 33, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 44, - "job_id": 33, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:18:55 UTC", - "updated_at": "2021-03-14 10:18:55 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_6-8.json b/spec/support/expected_files/remove_repo_builds/log_6-8.json new file mode 100644 index 0000000..4cfea9c --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_6-8.json @@ -0,0 +1,53 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 6, + "job_id": 5, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 7, + "job_id": 6, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 8, + "job_id": 6, + "content": "some log content", + "removed_by": null, + "created_at": "2021-03-14 10:46:41 UTC", + "updated_at": "2021-03-14 10:46:41 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/request_1-2.json b/spec/support/expected_files/remove_repo_requests/request_1-2.json new file mode 100644 index 0000000..26123a9 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/request_1-2.json @@ -0,0 +1,65 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 1, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 13:18:13 UTC", + "updated_at": "2021-03-14 13:18:13 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 2, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-14 13:18:13 UTC", + "updated_at": "2021-03-14 13:18:13 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file From f75926ae2af5699c2755fe3972f62bdc04ec302f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Sun, 17 Oct 2021 22:30:26 +0200 Subject: [PATCH 42/88] wip --- spec/backup/remove_specified_spec.rb | 87 +++++--------- .../remove_repo_builds/annotation_57-58.json | 29 +++++ .../{build_1-4.json => build_50-161.json} | 24 ++-- .../{job_2-6.json => job_162-166.json} | 107 +++++++++++------- .../remove_repo_builds/job_167-167.json | 36 ++++++ .../remove_repo_builds/log_1-5.json | 85 -------------- .../remove_repo_builds/log_57-58.json | 37 ++++++ .../remove_repo_builds/log_6-8.json | 53 --------- .../queueable_job_57-58.json | 17 +++ .../remove_repo_builds/stage_52-53.json | 35 ++++++ spec/support/factories/build.rb | 59 +++++----- spec/support/factories/repository.rb | 23 ++++ 12 files changed, 319 insertions(+), 273 deletions(-) create mode 100644 spec/support/expected_files/remove_repo_builds/annotation_57-58.json rename spec/support/expected_files/remove_repo_builds/{build_1-4.json => build_50-161.json} (82%) rename spec/support/expected_files/remove_repo_builds/{job_2-6.json => job_162-166.json} (56%) create mode 100644 spec/support/expected_files/remove_repo_builds/job_167-167.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_1-5.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_57-58.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_6-8.json create mode 100644 spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json create mode 100644 spec/support/expected_files/remove_repo_builds/stage_52-53.json diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 6e2ca0a..c8d9e78 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -75,71 +75,46 @@ def get_expected_files(directory, datetime) BeforeTests.new.run end - after(:each) do - Repository.destroy_all - Build.destroy_all - Job.destroy_all - Log.destroy_all - end - let!(:repository) { - db_helper.do_without_triggers do - FactoryBot.create( - :repository_with_builds_jobs_and_logs, - created_at: datetime, - updated_at: datetime - ) - end - } - let!(:repository2) { FactoryBot.create( - :repository_with_builds_jobs_and_logs, + :repository_for_removing_heavy_data, created_at: datetime, - updated_at: datetime, - builds_count: 1 + updated_at: datetime ) } - let(:expected_files_creator) { - ExpectedFilesProvider.new(repository, datetime) - } - let!(:expected_builds_json) { - expected_files_creator.builds_json - } - let!(:expected_jobs_jsons) { - repository.builds.map do |build| - expected_files_creator.jobs_json(build) - end - } - let!(:expected_logs_jsons) { - repository.builds.map do |build| - build.jobs.map do |job| - expected_files_creator.logs_json(job) - end - end.flatten(1) - } + # let!(:repository2) { + # FactoryBot.create( + # :repository_with_all_dependencies, + # created_at: datetime, + # updated_at: datetime + # ) + # } shared_context 'removing builds and jobs' do - it 'deletes all builds of the repository' do + it 'removes builds with all its dependencies' do remove_specified.remove_repo_builds(repository) - expect(Build.all.map(&:repository_id)).to eq([repository2.id]) - end - - it 'deletes all jobs of removed builds and leaves the rest' do - expect { - remove_specified.remove_repo_builds(repository) - }.to change { Job.all.size }.by -4 - build_id = Build.first.id - expect(Job.all.map(&:source_id)).to eq([build_id, build_id]) - end - - it 'deletes all logs of removed jobs and leaves the rest' do - expect { - remove_specified.remove_repo_builds(repository) - }.to change { Log.all.size }.by -8 - - build_id = Build.first.id - expect(Log.all.map(&:job).map(&:source_id)).to eq(Array.new(4, build_id)) + expect(db_summary_hash).to eql( + all: 672, + logs: 60, + jobs: 108, + builds: 65, + requests: 34, + repositories: 65, + branches: 38, + tags: 38, + commits: 18, + crons: 6, + pull_requests: 6, + ssl_keys: 6, + stages: 36, + stars: 6, + permissions: 6, + messages: 30, + abuses: 30, + annotations: 60, + queueable_jobs: 60 + ) end end diff --git a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json new file mode 100644 index 0000000..a8edc46 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json @@ -0,0 +1,29 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 57, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-03-17 21:28:08 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-03-17 21:28:08 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/build_1-4.json b/spec/support/expected_files/remove_repo_builds/build_50-161.json similarity index 82% rename from spec/support/expected_files/remove_repo_builds/build_1-4.json rename to spec/support/expected_files/remove_repo_builds/build_50-161.json index 3729e84..334766a 100644 --- a/spec/support/expected_files/remove_repo_builds/build_1-4.json +++ b/spec/support/expected_files/remove_repo_builds/build_50-161.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 1, + "id": 50, "repository_id": 1, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:09 UTC", "config": null, "commit_id": null, "request_id": null, @@ -31,20 +31,16 @@ "sender_id": null, "sender_type": null, "_dependencies_": { - "job": [ - 2, - 3 - ] } }, { - "id": 4, + "id": 161, "repository_id": 1, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", "config": null, "commit_id": null, "request_id": null, @@ -68,8 +64,12 @@ "sender_type": null, "_dependencies_": { "job": [ - 5, - 6 + 166, + 167 + ], + "stage": [ + 52, + 53 ] } } diff --git a/spec/support/expected_files/remove_repo_builds/job_2-6.json b/spec/support/expected_files/remove_repo_builds/job_162-166.json similarity index 56% rename from spec/support/expected_files/remove_repo_builds/job_2-6.json rename to spec/support/expected_files/remove_repo_builds/job_162-166.json index af9492e..341929d 100644 --- a/spec/support/expected_files/remove_repo_builds/job_2-6.json +++ b/spec/support/expected_files/remove_repo_builds/job_162-166.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 2, - "repository_id": 1, + "id": 162, + "repository_id": null, "commit_id": null, - "source_id": 1, - "source_type": "Build", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -28,20 +28,16 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, + "stage_id": 52, "_dependencies_": { - "log": [ - 1, - 2 - ] } }, { - "id": 3, - "repository_id": 1, + "id": 163, + "repository_id": null, "commit_id": null, - "source_id": 1, - "source_type": "Build", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -50,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -63,20 +59,16 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, + "stage_id": 52, "_dependencies_": { - "log": [ - 3, - 4 - ] } }, { - "id": 5, - "repository_id": 1, + "id": 164, + "repository_id": null, "commit_id": null, - "source_id": 4, - "source_type": "Build", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -85,8 +77,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -98,19 +90,46 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, + "stage_id": 53, + "_dependencies_": { + } + }, + { + "id": 165, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53, "_dependencies_": { - "log": [ - 5, - 6 - ] } }, { - "id": 6, - "repository_id": 1, + "id": 166, + "repository_id": null, "commit_id": null, - "source_id": 4, + "source_id": 161, "source_type": "Build", "queue": null, "type": null, @@ -120,8 +139,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -136,8 +155,16 @@ "stage_id": null, "_dependencies_": { "log": [ - 7, - 8 + 57, + 58 + ], + "annotation": [ + 57, + 58 + ], + "queueable_job": [ + 57, + 58 ] } } diff --git a/spec/support/expected_files/remove_repo_builds/job_167-167.json b/spec/support/expected_files/remove_repo_builds/job_167-167.json new file mode 100644 index 0000000..c66eeb6 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_167-167.json @@ -0,0 +1,36 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 167, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-10-17 20:28:10 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_1-5.json b/spec/support/expected_files/remove_repo_builds/log_1-5.json deleted file mode 100644 index d0098fb..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_1-5.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 1, - "job_id": 2, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 2, - "job_id": 2, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 3, - "job_id": 3, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 4, - "job_id": 3, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 5, - "job_id": 5, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_57-58.json b/spec/support/expected_files/remove_repo_builds/log_57-58.json new file mode 100644 index 0000000..cb19944 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_57-58.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 57, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-03-17 21:28:08 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-17 21:28:08 UTC", + "updated_at": "2021-03-17 21:28:08 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_6-8.json b/spec/support/expected_files/remove_repo_builds/log_6-8.json deleted file mode 100644 index 4cfea9c..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_6-8.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 6, - "job_id": 5, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 7, - "job_id": 6, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - }, - { - "id": 8, - "job_id": 6, - "content": "some log content", - "removed_by": null, - "created_at": "2021-03-14 10:46:41 UTC", - "updated_at": "2021-03-14 10:46:41 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true, - "_dependencies_": { - } - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json b/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json new file mode 100644 index 0000000..520851f --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json @@ -0,0 +1,17 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 57, + "job_id": 166, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/stage_52-53.json b/spec/support/expected_files/remove_repo_builds/stage_52-53.json new file mode 100644 index 0000000..d61a2c9 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/stage_52-53.json @@ -0,0 +1,35 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 52, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null, + "_dependencies_": { + "job": [ + 162, + 163 + ] + } + }, + { + "id": 53, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null, + "_dependencies_": { + "job": [ + 164, + 165 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index a24a2d8..6a88407 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -94,7 +94,7 @@ tag_id { Tag.first.id } end - factory :build_with_all_dependencies do + factory :build_for_removing_heavy_data do after(:create) do |build| create_list( :stage_with_jobs, 2, @@ -109,34 +109,39 @@ created_at: build.created_at, updated_at: build.updated_at ) - create( - :tag_with_all_dependencies_and_sibling, - last_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - create( - :branch_with_all_dependencies_and_sibling, - last_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - create( - :repository_with_safe_dependencies_and_sibling, - last_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) - create( - :repository_with_safe_dependencies_and_sibling, - current_build_id: build.id, - created_at: build.created_at, - updated_at: build.updated_at - ) end - factory :build_with_all_dependencies_and_sibling do + + factory :build_with_all_dependencies do after(:create) do |build| - create(:build, build.attributes_without_id.symbolize_keys) + create( + :tag_with_all_dependencies_and_sibling, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create( + :branch_with_all_dependencies_and_sibling, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create( + :repository_with_safe_dependencies_and_sibling, + last_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + create( + :repository_with_safe_dependencies_and_sibling, + current_build_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) + end + factory :build_with_all_dependencies_and_sibling do + after(:create) do |build| + create(:build, build.attributes_without_id.symbolize_keys) + end end end end diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index 7eae034..aad5d5d 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -127,11 +127,34 @@ updated_at: repository.updated_at ) end + factory :repository_with_all_dependencies_and_sibling do after(:create) do |repository| create(:repository, repository.attributes_without_id.symbolize_keys) end end + + factory :repository_for_removing_heavy_data do + after(:create) do |repository| + create( + :build_for_removing_heavy_data, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create( + :build_for_removing_heavy_data, + repository_id: repository.id + ) + last_build = create( + :build_for_removing_heavy_data, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + repository.update(last_build_id: last_build.id) + end + end end factory :repository_with_safe_dependencies do after(:create) do |repository| From 0bb88ea54616d24649e3293780160bfe42ac6e06 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 18 Oct 2021 12:45:24 +0200 Subject: [PATCH 43/88] remove_repo_builds tested --- spec/backup/remove_specified_spec.rb | 19 +++++++----------- .../remove_repo_builds/annotation_57-58.json | 8 ++++---- .../remove_repo_builds/build_50-161.json | 8 ++++---- .../remove_repo_builds/job_162-166.json | 20 +++++++++---------- .../remove_repo_builds/job_167-167.json | 4 ++-- .../remove_repo_builds/log_57-58.json | 8 ++++---- 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index c8d9e78..9b1bec0 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -76,19 +76,14 @@ def get_expected_files(directory, datetime) end let!(:repository) { - FactoryBot.create( - :repository_for_removing_heavy_data, - created_at: datetime, - updated_at: datetime - ) + db_helper.do_without_triggers do + FactoryBot.create( + :repository_for_removing_heavy_data, + created_at: datetime, + updated_at: datetime + ) + end } - # let!(:repository2) { - # FactoryBot.create( - # :repository_with_all_dependencies, - # created_at: datetime, - # updated_at: datetime - # ) - # } shared_context 'removing builds and jobs' do it 'removes builds with all its dependencies' do diff --git a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json index a8edc46..790f653 100644 --- a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json @@ -6,8 +6,8 @@ "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-03-17 21:28:08 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { @@ -18,8 +18,8 @@ "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-03-17 21:28:08 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, "status": null, "_dependencies_": { diff --git a/spec/support/expected_files/remove_repo_builds/build_50-161.json b/spec/support/expected_files/remove_repo_builds/build_50-161.json index 334766a..0b225df 100644 --- a/spec/support/expected_files/remove_repo_builds/build_50-161.json +++ b/spec/support/expected_files/remove_repo_builds/build_50-161.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:09 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:25 UTC", "config": null, "commit_id": null, "request_id": null, @@ -39,8 +39,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_repo_builds/job_162-166.json b/spec/support/expected_files/remove_repo_builds/job_162-166.json index 341929d..046f5c8 100644 --- a/spec/support/expected_files/remove_repo_builds/job_162-166.json +++ b/spec/support/expected_files/remove_repo_builds/job_162-166.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -46,8 +46,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -77,8 +77,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -108,8 +108,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -139,8 +139,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_builds/job_167-167.json b/spec/support/expected_files/remove_repo_builds/job_167-167.json index c66eeb6..3971614 100644 --- a/spec/support/expected_files/remove_repo_builds/job_167-167.json +++ b/spec/support/expected_files/remove_repo_builds/job_167-167.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-10-17 20:28:10 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_builds/log_57-58.json b/spec/support/expected_files/remove_repo_builds/log_57-58.json index cb19944..718b3a9 100644 --- a/spec/support/expected_files/remove_repo_builds/log_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/log_57-58.json @@ -6,8 +6,8 @@ "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-03-17 21:28:08 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -22,8 +22,8 @@ "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-17 21:28:08 UTC", - "updated_at": "2021-03-17 21:28:08 UTC", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, From 6e5ac35078933a608aa16bd6056ac9884b040a2e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 18 Oct 2021 13:42:50 +0200 Subject: [PATCH 44/88] remove_repo_requests tested --- spec/backup/remove_specified_spec.rb | 69 +++++++++------- .../remove_repo_requests/abuse_9-10.json | 29 +++++++ .../annotation_17-18.json | 29 +++++++ .../remove_repo_requests/build_53-53.json | 37 +++++++++ .../remove_repo_requests/job_54-55.json | 79 +++++++++++++++++++ .../remove_repo_requests/log_17-18.json | 37 +++++++++ .../remove_repo_requests/message_9-10.json | 31 ++++++++ .../queueable_job_17-18.json | 17 ++++ .../{request_1-2.json => request_11-12.json} | 28 +++++-- 9 files changed, 320 insertions(+), 36 deletions(-) create mode 100644 spec/support/expected_files/remove_repo_requests/abuse_9-10.json create mode 100644 spec/support/expected_files/remove_repo_requests/annotation_17-18.json create mode 100644 spec/support/expected_files/remove_repo_requests/build_53-53.json create mode 100644 spec/support/expected_files/remove_repo_requests/job_54-55.json create mode 100644 spec/support/expected_files/remove_repo_requests/log_17-18.json create mode 100644 spec/support/expected_files/remove_repo_requests/message_9-10.json create mode 100644 spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json rename spec/support/expected_files/remove_repo_requests/{request_1-2.json => request_11-12.json} (74%) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 9b1bec0..5544f9f 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -85,7 +85,7 @@ def get_expected_files(directory, datetime) end } - shared_context 'removing builds and jobs' do + shared_context 'removing builds with dependencies' do it 'removes builds with all its dependencies' do remove_specified.remove_repo_builds(repository) @@ -121,7 +121,7 @@ def get_expected_files(directory, datetime) end context 'when if_backup config is set to true' do - it_behaves_like 'removing builds and jobs' + it_behaves_like 'removing builds with dependencies' it 'saves removed data to files in proper format' do expect_method_calls_on( @@ -152,7 +152,7 @@ def get_expected_files(directory, datetime) let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving files' - it_behaves_like 'removing builds and jobs' + it_behaves_like 'removing builds with dependencies' end context 'when dry_run config is set to true' do @@ -175,28 +175,42 @@ def get_expected_files(directory, datetime) end let!(:repository) { - FactoryBot.create( - :repository_with_requests, - created_at: datetime, - updated_at: datetime - ) - } - let!(:repository2) { - FactoryBot.create( - :repository_with_requests, - created_at: datetime, - updated_at: datetime, - requests_count: 1 - ) - } - let!(:expected_requests_json) { - ExpectedFilesProvider.new(repository, datetime).requests_json + FactoryBot.rewind_sequences + + db_helper.do_without_triggers do + FactoryBot.create( + :repository_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + end } - shared_context 'removing requests' do - it 'deletes all requests of the repository' do + shared_context 'removing requests with dependencies' do + it 'removes requests with all its dependencies' do remove_specified.remove_repo_requests(repository) - expect(Request.all.map(&:repository_id)).to eq([repository2.id]) + + expect(db_summary_hash).to eql( + all: 628, + logs: 54, + jobs: 94, + builds: 63, + requests: 32, + repositories: 65, + branches: 38, + tags: 38, + commits: 18, + crons: 6, + pull_requests: 6, + ssl_keys: 6, + stages: 32, + stars: 6, + permissions: 6, + messages: 28, + abuses: 28, + annotations: 54, + queueable_jobs: 54 + ) end end @@ -208,6 +222,8 @@ def get_expected_files(directory, datetime) end context 'when if_backup config is set to true' do + it_behaves_like 'removing requests with dependencies' + it 'saves removed data to files in proper format' do expect_method_calls_on( File, :write, @@ -219,13 +235,6 @@ def get_expected_files(directory, datetime) end end - it 'saves JSON to file at proper path' do - expect(File).to receive(:open).once.with(Regexp.new(files_location), 'w') - remove_specified.remove_repo_requests(repository) - end - - it_behaves_like 'removing requests' - context 'when path with nonexistent folders is given' do let(:random_files_location) { "dump/tests/#{rand(100000)}" } let!(:config) { Config.new(files_location: random_files_location, limit: 2) } @@ -244,7 +253,7 @@ def get_expected_files(directory, datetime) let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } it_behaves_like 'not saving files' - it_behaves_like 'removing requests' + it_behaves_like 'removing requests with dependencies' end context 'when dry_run config is set to true' do diff --git a/spec/support/expected_files/remove_repo_requests/abuse_9-10.json b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json new file mode 100644 index 0000000..9e0e1a8 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json @@ -0,0 +1,29 @@ +{ + "table_name": "abuses", + "data": [ + { + "id": 9, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 9, + "reason": "some text", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "owner_id": null, + "owner_type": null, + "request_id": 11, + "level": 10, + "reason": "some text", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/annotation_17-18.json b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json new file mode 100644 index 0000000..9895543 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json @@ -0,0 +1,29 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 17, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "url": null, + "description": "some text", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/build_53-53.json b/spec/support/expected_files/remove_repo_requests/build_53-53.json new file mode 100644 index 0000000..c1b60b2 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/build_53-53.json @@ -0,0 +1,37 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/job_54-55.json b/spec/support/expected_files/remove_repo_requests/job_54-55.json new file mode 100644 index 0000000..91c84ea --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/job_54-55.json @@ -0,0 +1,79 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 54, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 17, + 18 + ], + "annotation": [ + 17, + 18 + ], + "queueable_job": [ + 17, + 18 + ] + } + }, + { + "id": 55, + "repository_id": null, + "commit_id": null, + "source_id": 11, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/log_17-18.json b/spec/support/expected_files/remove_repo_requests/log_17-18.json new file mode 100644 index 0000000..365bcb4 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/log_17-18.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 17, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/message_9-10.json b/spec/support/expected_files/remove_repo_requests/message_9-10.json new file mode 100644 index 0000000..cfb0d4b --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/message_9-10.json @@ -0,0 +1,31 @@ +{ + "table_name": "messages", + "data": [ + { + "id": 9, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "_dependencies_": { + } + }, + { + "id": 10, + "subject_id": 11, + "subject_type": "Request", + "level": null, + "key": null, + "code": null, + "args": null, + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json b/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json new file mode 100644 index 0000000..f885a36 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json @@ -0,0 +1,17 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 17, + "job_id": 54, + "_dependencies_": { + } + }, + { + "id": 18, + "job_id": 54, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/request_1-2.json b/spec/support/expected_files/remove_repo_requests/request_11-12.json similarity index 74% rename from spec/support/expected_files/remove_repo_requests/request_1-2.json rename to spec/support/expected_files/remove_repo_requests/request_11-12.json index 26123a9..07f2680 100644 --- a/spec/support/expected_files/remove_repo_requests/request_1-2.json +++ b/spec/support/expected_files/remove_repo_requests/request_11-12.json @@ -2,7 +2,7 @@ "table_name": "requests", "data": [ { - "id": 1, + "id": 11, "repository_id": 1, "commit_id": null, "state": null, @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 13:18:13 UTC", - "updated_at": "2021-03-14 13:18:13 UTC", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -29,10 +29,26 @@ "sender_id": null, "sender_type": null, "_dependencies_": { + "abuse": [ + 9, + 10 + ], + "message": [ + 9, + 10 + ], + "job": [ + 54, + 55 + ], + "build": [ + 51, + 53 + ] } }, { - "id": 2, + "id": 12, "repository_id": 1, "commit_id": null, "state": null, @@ -42,8 +58,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-14 13:18:13 UTC", - "updated_at": "2021-03-14 13:18:13 UTC", + "created_at": "2021-03-18 12:32:24 UTC", + "updated_at": "2021-03-18 12:32:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, From 02866d65d67e646fc5a8135f57e83b931a15e65a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 19 Oct 2021 10:00:49 +0200 Subject: [PATCH 45/88] bug fixed --- lib/dry_run_reporter.rb | 2 +- spec/backup_spec.rb | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/dry_run_reporter.rb b/lib/dry_run_reporter.rb index b37bb7b..ec033f6 100644 --- a/lib/dry_run_reporter.rb +++ b/lib/dry_run_reporter.rb @@ -8,7 +8,7 @@ def initialize end def add_to_report(*args) - if args.first.class == Hash + if args.first.is_a?(Hash) add_to_report_as_hash(args.first) else add_to_report_as_key_and_values(*args) diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index cab194c..1511997 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -9,6 +9,7 @@ require 'support/before_tests' require 'support/utils' require 'pry' +require 'byebug' describe Backup do before(:all) do @@ -176,10 +177,10 @@ it 'prepares proper dry run report' do backup.run - expect(backup.dry_run_report[:builds].size).to eql 24 - expect(backup.dry_run_report[:jobs].size).to eql 48 - expect(backup.dry_run_report[:logs].size).to eql 96 - expect(backup.dry_run_report[:requests].size).to eql 6 + expect(backup.dry_run_report[:build].size).to eql 24 + expect(backup.dry_run_report[:job].size).to eql 48 + expect(backup.dry_run_report[:log].size).to eql 96 + expect(backup.dry_run_report[:request].size).to eql 6 end it 'prints dry run report' do From 41ff7f248b75b24308c04f43f517532b36e13b19 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 19 Oct 2021 12:17:37 +0200 Subject: [PATCH 46/88] load from files mode in Config and Backup; bare LoadFromFiles class --- README.md | 8 +++++++- lib/backup/load_from_files.rb | 13 +++++++++++++ lib/config.rb | 22 ++++++++++++++++++++-- lib/travis-backup.rb | 3 +++ spec/backup_spec.rb | 9 +++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 lib/backup/load_from_files.rb diff --git a/README.md b/README.md index 0a83c37..3a9a99a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ All arguments: --move_logs # run in move logs mode - move all logs to database at destination_db_url URL --destination_db_url URL # URL for moving logs to --remove_orphans # run in remove orphans mode + --load_from_files # loads files stored in files_location to the database + --id_gap # concerns file loading - the gap between the biggest id in database and the lowest one that will be set to loaded data (that's for data inserted by other users during the load being performed; equals 1000 by default) ``` Or inside your app: @@ -64,6 +66,8 @@ Using `--remove_orphans` flag you can remove all orphaned data from tables. When Using `--user_id`, `--org_id` or `--repo_id` flag without setting `--threshold` results in removing the specified user/organization/repository with all its dependencies. It can be combined with `--backup` flag in order to save removed data in files. +Using `--load_from_files` flag you can restore dumped data from files located at path given by `--files_location`. The distance defined by `--id_gap` is going to be kept between biggest ids in the database and the lowest ones from the data loaded from files (and it equals 1000 by default). + Using `--dry_run` flag you can check which data would be removed by gem, but without removing them actually. Instead of that reports will be printed on standard output. This flag can be also combined with special modes. ### Configuration options @@ -82,9 +86,11 @@ backup: repo_id: 1 # run only for given repository move_logs: false # run in move logs mode - move all logs to database at destination_db_url URL remove_orphans: false # run in remove orphans mode + load_from_files: false # loads files stored in files_location to the database + id_gap: 1500 # concerns file loading - the gap between the biggest id in database and the lowest one that will be set to loaded data (that's for data inserted by other users during the load being performed; equals 1000 by default) ``` -You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `BACKUP_USER_ID`, `BACKUP_ORG_ID`, `BACKUP_REPO_ID`, `BACKUP_MOVE_LOGS`, `BACKUP_REMOVE_ORPHANS`. +You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `BACKUP_USER_ID`, `BACKUP_ORG_ID`, `BACKUP_REPO_ID`, `BACKUP_MOVE_LOGS`, `BACKUP_REMOVE_ORPHANS`, `BACKUP_LOAD_FROM_FILES`, `BACKUP_ID_GAP`. You should also specify your database url. You can do this the standard way in `config/database.yml` file, setting the `database_url` hash argument while creating `Backup` instance or using the `DATABASE_URL` env var. Your database should be consistent with the Travis 2.2 database schema. diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb new file mode 100644 index 0000000..2614aec --- /dev/null +++ b/lib/backup/load_from_files.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class Backup + class LoadFromFiles + def initialize(config, dry_run_reporter=nil) + @config = config + @dry_run_reporter = dry_run_reporter + end + + def run + end + end +end \ No newline at end of file diff --git a/lib/config.rb b/lib/config.rb index 1f6987a..a84f0ed 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -13,7 +13,9 @@ class Config :org_id, :move_logs, :remove_orphans, - :destination_db_url + :destination_db_url, + :load_from_files, + :id_gap def initialize(args={}) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength set_values(args) @@ -102,10 +104,24 @@ def set_values(args) ENV['BACKUP_DESTINATION_DB_URL'], connection_details.dig(ENV['RAILS_ENV'], 'destination') ) + @load_from_files = first_not_nil( + args[:load_from_files], + argv_opts[:load_from_files], + ENV['BACKUP_LOAD_FROM_FILES'], + config.dig('backup', 'load_from_files'), + false + ) + @id_gap = first_not_nil( + args[:id_gap], + argv_opts[:id_gap], + ENV['BACKUP_ID_GAP'], + config.dig('backup', 'id_gap'), + 1000 + ) end def check_values - if !@move_logs && !@remove_orphans && !@threshold && !@user_id && !org_id && !repo_id + if !@move_logs && !@remove_orphans && !@threshold && !@user_id && !org_id && !repo_id && !load_from_files message = abort_message("Please provide the threshold argument. Data younger than it will be omitted. " + "Threshold defines number of months from now. Alternatively you can define user_id, org_id or repo_id " + "to remove whole user, organization or repository with all dependencies.") @@ -151,6 +167,8 @@ def argv_options opt.on('--move_logs') { |o| options[:move_logs] = o } opt.on('--remove_orphans') { |o| options[:remove_orphans] = o } opt.on('--destination_db_url X') { |o| options[:destination_db_url] = o } + opt.on('--load_from_files') { |o| options[:load_from_files] = o } + opt.on('--id_gap X') { |o| options[:id_gap] = o.to_i } end.parse! options[:database_url] = ARGV.shift if ARGV[0] diff --git a/lib/travis-backup.rb b/lib/travis-backup.rb index 6f8ce8c..e8a2ca3 100644 --- a/lib/travis-backup.rb +++ b/lib/travis-backup.rb @@ -17,6 +17,7 @@ require 'models/stage' require 'backup/move_logs' require 'backup/remove_orphans' +require 'backup/load_from_files' require 'backup/remove_specified' # main travis-backup class @@ -39,6 +40,8 @@ def dry_run_report def run(args={}) if @config.move_logs Backup::MoveLogs.new(@config, @db_helper, @dry_run_reporter).run + elsif @config.load_from_files + Backup::LoadFromFiles.new(@config, @dry_run_reporter).run elsif @config.remove_orphans Backup::RemoveOrphans.new(@config, @dry_run_reporter).run else diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index 1511997..1be337f 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -168,6 +168,15 @@ end end + context 'when load from files mode is on' do + let!(:backup) { Backup.new(files_location: files_location, limit: 5, load_from_files: true) } + + it 'loads data from files to the database' do + expect_any_instance_of(Backup::LoadFromFiles).to receive(:run).once + backup.run + end + end + context 'when dry run mode is on' do let!(:backup) { Backup.new(files_location: files_location, limit: 10, dry_run: true, threshold: 0) } From d9e3b0ddbcf71ab0624dd1c1d2be2d53b39204e5 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 21 Oct 2021 11:30:27 +0200 Subject: [PATCH 47/88] LoadFromFiles --- lib/backup/load_from_files.rb | 167 +++++++++++++++++ .../remove_specified/remove_heavy_data.rb | 6 +- .../remove_with_all_dependencies.rb | 2 +- lib/config.rb | 2 +- lib/ids_of_all_dependencies.rb | 4 + lib/model.rb | 4 + lib/models/abuse.rb | 1 + lib/models/annotation.rb | 1 + lib/models/branch.rb | 2 + lib/models/build.rb | 6 + lib/models/commit.rb | 3 + lib/models/cron.rb | 1 + lib/models/email.rb | 1 + lib/models/invoice.rb | 1 + lib/models/job.rb | 3 + lib/models/membership.rb | 2 + lib/models/message.rb | 1 + lib/models/permission.rb | 2 + lib/models/pull_request.rb | 1 + lib/models/queueable_job.rb | 1 + lib/models/repository.rb | 2 + lib/models/request.rb | 4 + lib/models/ssl_key.rb | 1 + lib/models/stage.rb | 1 + lib/models/star.rb | 2 + lib/models/tag.rb | 2 + lib/models/token.rb | 1 + lib/models/trial_allowance.rb | 1 + lib/models/user_beta_feature.rb | 1 + spec/backup/load_from_files_spec.rb | 103 +++++++++++ spec/model_spec.rb | 6 +- .../annotation_57-58.json | 29 +++ .../build_50-161.json | 77 ++++++++ .../job_162-166.json | 172 ++++++++++++++++++ .../job_167-167.json | 36 ++++ .../associated_db_data_problem/log_57-58.json | 37 ++++ .../queueable_job_57-58.json | 17 ++ .../repository_1-1.json | 32 ++++ .../stage_52-53.json | 35 ++++ 39 files changed, 762 insertions(+), 8 deletions(-) create mode 100644 spec/backup/load_from_files_spec.rb create mode 100644 spec/support/expected_files/associated_db_data_problem/annotation_57-58.json create mode 100644 spec/support/expected_files/associated_db_data_problem/build_50-161.json create mode 100644 spec/support/expected_files/associated_db_data_problem/job_162-166.json create mode 100644 spec/support/expected_files/associated_db_data_problem/job_167-167.json create mode 100644 spec/support/expected_files/associated_db_data_problem/log_57-58.json create mode 100644 spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json create mode 100644 spec/support/expected_files/associated_db_data_problem/repository_1-1.json create mode 100644 spec/support/expected_files/associated_db_data_problem/stage_52-53.json diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index 2614aec..767b6e5 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -1,13 +1,180 @@ # frozen_string_literal: true +require 'id_hash' + class Backup class LoadFromFiles + class DataFile + attr_accessor :content + + def initialize(content) + @content = content + end + + def table_name + @content.match(/"table_name":\s?"(\w+)"/)[1] + end + + def table_name_sym + table_name.to_sym + end + + def ids + @content.scan(/"id":\s?(\d+)/).flatten.map(&:to_i) + end + + def lowest_id + ids.min + end + + def full_hash + @full_hash ||= JSON.parse(@content).symbolize_keys + end + + def data_hash + full_hash[:data] + end + end + def initialize(config, dry_run_reporter=nil) @config = config @dry_run_reporter = dry_run_reporter + @touched_models = [] end def run + set_id_offsets + load_data_with_offsets + cancel_offset_for_foreign_data + set_id_sequences + end + + private + + def set_id_sequences + @touched_models.each do |model| + next if [Build, Job].include?(model) + + value = model.last.id + 1 + seq = model.table_name + '_id_seq' + set_sequence(seq, value) + end + + set_shared_builds_tasks_seq + end + + def set_shared_builds_tasks_seq + value = [Build.last&.id || -1, Job.last&.id || -1].max + 1 + + if value > 0 + set_sequence("shared_builds_tasks_seq", value) + end + end + + def set_sequence(seq, value) + ActiveRecord::Base.connection.execute("alter sequence #{seq} restart with #{value};") + end + + def cancel_offset_for_foreign_data + @loaded_entries.each do |entry| + entry.class.reflect_on_all_associations.select { |a| a.macro == :belongs_to }.each do |association| + foreign_key = association.foreign_key.to_sym + if entry.send(association.name).nil? && entry.send(foreign_key).present? + entry_hash = entry.attributes.symbolize_keys + table_name = get_table_name(entry_hash, association) + offset = @id_offsets[table_name.to_sym] + next if offset.nil? + + proper_id = entry.send(foreign_key) - offset + entry.update(foreign_key => proper_id) + end + end + end + end + + def load_data_with_offsets + @loaded_entries = files.map do |data_file| + model = Model.get_model_by_table_name(data_file.table_name) + @touched_models << model + + data_file.data_hash.map do |entry_hash| + entry_hash.symbolize_keys! + entry_hash.delete(:_dependencies_) + entry_hash[:id] += @id_offsets[data_file.table_name.to_sym] + add_offset_to_foreign_keys!(model, entry_hash) + model.create(entry_hash) + end + end.flatten + end + + def add_offset_to_foreign_keys!(model, entry_hash) + model.reflect_on_all_associations.select { |a| a.macro == :belongs_to }.each do |association| + foreign_key_sym = association.foreign_key.to_sym + next unless entry_hash[foreign_key_sym] + + table_name = get_table_name(entry_hash, association) + entry_hash[foreign_key_sym] += @id_offsets[table_name.to_sym] || 0 + end + end + + def get_table_name(entry_hash, association) + if association.polymorphic? + type_symbol = association.foreign_key.gsub(/_id$/, '_type').to_sym + class_name = entry_hash[type_symbol] + else + class_name = association.class_name + end + + Model.get_model(class_name).table_name + end + + def files + @files ||= Dir["#{@config.files_location}/**/*.json"].map do |file_path| + content = File.read(file_path) + DataFile.new(content) + end + end + + def find_lowest_ids_from_files + @lowest_ids_from_files = HashOfArrays.new + + files.each do |data_file| + table_name = data_file.table_name_sym + min_id = data_file.lowest_id + @lowest_ids_from_files.add(table_name, min_id) + end + + @lowest_ids_from_files = @lowest_ids_from_files.map { |k, arr| [k, arr.min] }.to_h + end + + def find_highest_ids_from_db + @highest_ids_from_db = {} + + Model.subclasses.each do |model| + table_name = model.table_name.to_sym + @highest_ids_from_db[table_name] = model.order(:id).last&.id || 0 + end + end + + def set_id_offsets + find_lowest_ids_from_files + find_highest_ids_from_db + + @id_offsets = @lowest_ids_from_files.map do |key, file_min| + db_max = @highest_ids_from_db[key] + offset = db_max - file_min + @config.id_gap + [key, offset] + end.to_h + + make_offset_common_for_builds_and_jobs + end + + def make_offset_common_for_builds_and_jobs + if @id_offsets[:builds] && @id_offsets[:jobs] + offset = [@id_offsets[:builds], @id_offsets[:jobs]].max + @id_offsets[:builds] = offset + @id_offsets[:jobs] = offset + end end end end \ No newline at end of file diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 2891d5f..b031755 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -21,7 +21,7 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me builds_dependencies = repository.builds.where('created_at < ?', threshold).map do |build| next if should_build_be_filtered?(build) - result = build.ids_of_all_dependencies[:main] + result = build.ids_of_all_dependencies result.add(:build, build.id) result end.compact @@ -34,7 +34,7 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me def remove_repo_requests(repository) threshold = @config.threshold.to_i.months.ago.to_datetime requests_dependencies = repository.requests.where('created_at < ?', threshold).map do |request| - result = request.ids_of_all_dependencies(dependencies_to_filter)[:main] + result = request.ids_of_all_dependencies(dependencies_to_filter) result.add(:request, request.id) result end @@ -77,7 +77,7 @@ def dependencies_to_filter end def has_filtered_dependencies(build) - build.ids_of_all_dependencies(dependencies_to_filter)[:filtered_out].any? + build.ids_of_all_dependencies_with_filtered(dependencies_to_filter)[:filtered_out].any? end def save_and_destroy_requests_batch(requests_batch, repository) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 1fa09bf..0f6a7a8 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -24,7 +24,7 @@ def remove_repo_with_dependencies(repo_id) def remove_entry_with_dependencies(model_name, id) @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" entry = Model.get_model(model_name).find(id) - ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter)[:main] + ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter) ids_to_remove[model_name] = [id] if @config.dry_run diff --git a/lib/config.rb b/lib/config.rb index a84f0ed..b149317 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -2,7 +2,7 @@ require 'optparse' class Config - attr_reader :if_backup, + attr_accessor :if_backup, :dry_run, :limit, :threshold, diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 79d2c78..a421c5b 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -49,6 +49,10 @@ module IdsOfAllDependencies include IdsOfAllDirectDependencies def ids_of_all_dependencies(to_filter=nil) + ids_of_all_dependencies_with_filtered(to_filter)[:main] + end + + def ids_of_all_dependencies_with_filtered(to_filter=nil) id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) return id_hash unless to_filter move_wrongly_assigned_to_main(to_filter, id_hash) diff --git a/lib/model.rb b/lib/model.rb index 7e227cc..b2944d4 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -17,6 +17,10 @@ def self.get_model(name) self.subclasses.find{ |m| m.name == name.to_s.camelcase } end + def self.get_model_by_table_name(name) + self.subclasses.find{ |m| m.table_name == name.to_s } + end + def self.get_sum_of_rows_of_all_models self.subclasses.map do |subclass| subclass.all.size diff --git a/lib/models/abuse.rb b/lib/models/abuse.rb index 7d2fa31..0c57cc3 100644 --- a/lib/models/abuse.rb +++ b/lib/models/abuse.rb @@ -4,5 +4,6 @@ class Abuse < Model belongs_to :owner, polymorphic: true + belongs_to :request self.table_name = 'abuses' end diff --git a/lib/models/annotation.rb b/lib/models/annotation.rb index abdfcbb..7e23dbb 100644 --- a/lib/models/annotation.rb +++ b/lib/models/annotation.rb @@ -3,5 +3,6 @@ require 'model' class Annotation < Model + belongs_to :job self.table_name = 'annotations' end diff --git a/lib/models/branch.rb b/lib/models/branch.rb index 5c53f92..4c392c9 100644 --- a/lib/models/branch.rb +++ b/lib/models/branch.rb @@ -3,6 +3,8 @@ require 'model' class Branch < Model + belongs_to :last_build, foreign_key: :last_build_id, class_name: 'Build' + belongs_to :repository has_many :builds has_many :commits has_many :crons diff --git a/lib/models/build.rb b/lib/models/build.rb index 204146c..69b9775 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -8,6 +8,12 @@ class Build < Model belongs_to :repository belongs_to :owner, polymorphic: true + belongs_to :sender, polymorphic: true + belongs_to :branch + belongs_to :commit + belongs_to :pull_request + belongs_to :tag + belongs_to :request has_many :jobs, -> { order('id') }, as: :source, dependent: :destroy has_many :repos_for_that_this_build_is_current, foreign_key: :current_build_id, dependent: :destroy, class_name: 'Repository' has_many :repos_for_that_this_build_is_last, foreign_key: :last_build_id, class_name: 'Repository' diff --git a/lib/models/commit.rb b/lib/models/commit.rb index 726be4e..0631246 100644 --- a/lib/models/commit.rb +++ b/lib/models/commit.rb @@ -3,6 +3,9 @@ require 'model' class Commit < Model + belongs_to :branch + belongs_to :repository + belongs_to :tag has_many :builds has_many :jobs has_many :requests diff --git a/lib/models/cron.rb b/lib/models/cron.rb index 8f3a80a..c248ec1 100644 --- a/lib/models/cron.rb +++ b/lib/models/cron.rb @@ -3,5 +3,6 @@ require 'model' class Cron < Model + belongs_to :branch self.table_name = 'crons' end diff --git a/lib/models/email.rb b/lib/models/email.rb index d89673a..3224e3d 100644 --- a/lib/models/email.rb +++ b/lib/models/email.rb @@ -3,5 +3,6 @@ require 'model' class Email < Model + belongs_to :user self.table_name = 'emails' end diff --git a/lib/models/invoice.rb b/lib/models/invoice.rb index 7f2e502..eedc469 100644 --- a/lib/models/invoice.rb +++ b/lib/models/invoice.rb @@ -3,5 +3,6 @@ require 'model' class Invoice < Model + belongs_to :subscription self.table_name = 'invoices' end diff --git a/lib/models/job.rb b/lib/models/job.rb index b16d06f..7ca9bc3 100644 --- a/lib/models/job.rb +++ b/lib/models/job.rb @@ -10,8 +10,11 @@ class Job < Model self.inheritance_column = :_type_disabled + belongs_to :source, polymorphic: true belongs_to :owner, polymorphic: true belongs_to :repository + belongs_to :commit + belongs_to :stage has_many :logs, -> { order('id') }, dependent: :destroy has_many :annotations has_many :queueable_jobs diff --git a/lib/models/membership.rb b/lib/models/membership.rb index 36a5738..2c18182 100644 --- a/lib/models/membership.rb +++ b/lib/models/membership.rb @@ -3,5 +3,7 @@ require 'model' class Membership < Model + belongs_to :organization + belongs_to :user self.table_name = 'memberships' end diff --git a/lib/models/message.rb b/lib/models/message.rb index 4f90a3e..c0baddc 100644 --- a/lib/models/message.rb +++ b/lib/models/message.rb @@ -3,5 +3,6 @@ require 'model' class Message < Model + belongs_to :subject, polymorphic: true self.table_name = 'messages' end diff --git a/lib/models/permission.rb b/lib/models/permission.rb index 3350166..ebb00b7 100644 --- a/lib/models/permission.rb +++ b/lib/models/permission.rb @@ -3,5 +3,7 @@ require 'model' class Permission < Model + belongs_to :repository + belongs_to :user self.table_name = 'permissions' end diff --git a/lib/models/pull_request.rb b/lib/models/pull_request.rb index e8bb853..317eff9 100644 --- a/lib/models/pull_request.rb +++ b/lib/models/pull_request.rb @@ -3,6 +3,7 @@ require 'model' class PullRequest < Model + belongs_to :repository has_many :requests has_many :builds diff --git a/lib/models/queueable_job.rb b/lib/models/queueable_job.rb index 68751f5..9643841 100644 --- a/lib/models/queueable_job.rb +++ b/lib/models/queueable_job.rb @@ -3,5 +3,6 @@ require 'model' class QueueableJob < Model + belongs_to :job self.table_name = 'queueable_jobs' end diff --git a/lib/models/repository.rb b/lib/models/repository.rb index 8102fc0..ca1772c 100644 --- a/lib/models/repository.rb +++ b/lib/models/repository.rb @@ -9,6 +9,8 @@ # Repository model class Repository < Model belongs_to :owner, polymorphic: true + belongs_to :current_build, foreign_key: :current_build_id, class_name: 'Build' + belongs_to :last_build, foreign_key: :last_build_id, class_name: 'Build' has_many :builds, -> { order('id') } has_many :requests, -> { order('id') }, dependent: :destroy has_many :jobs diff --git a/lib/models/request.rb b/lib/models/request.rb index 948efec..b0b2f97 100644 --- a/lib/models/request.rb +++ b/lib/models/request.rb @@ -7,6 +7,10 @@ class Request < Model belongs_to :owner, polymorphic: true belongs_to :sender, polymorphic: true belongs_to :repository + belongs_to :branch + belongs_to :pull_request + belongs_to :tag + belongs_to :commit has_many :abuses has_many :messages, as: :subject has_many :jobs, as: :source diff --git a/lib/models/ssl_key.rb b/lib/models/ssl_key.rb index 4565054..1c1e4e0 100644 --- a/lib/models/ssl_key.rb +++ b/lib/models/ssl_key.rb @@ -3,5 +3,6 @@ require 'model' class SslKey < Model + belongs_to :repository self.table_name = 'ssl_keys' end diff --git a/lib/models/stage.rb b/lib/models/stage.rb index 5376cc6..abf5cc2 100644 --- a/lib/models/stage.rb +++ b/lib/models/stage.rb @@ -3,6 +3,7 @@ require 'model' class Stage < Model + belongs_to :build has_many :jobs self.table_name = 'stages' diff --git a/lib/models/star.rb b/lib/models/star.rb index 8dd9dfe..3fbe239 100644 --- a/lib/models/star.rb +++ b/lib/models/star.rb @@ -3,5 +3,7 @@ require 'model' class Star < Model + belongs_to :repository + belongs_to :user self.table_name = 'stars' end diff --git a/lib/models/tag.rb b/lib/models/tag.rb index 8d9c911..257fda1 100644 --- a/lib/models/tag.rb +++ b/lib/models/tag.rb @@ -3,6 +3,8 @@ require 'model' class Tag < Model + belongs_to :last_build, foreign_key: :last_build_id, class_name: 'Build' + belongs_to :repository has_many :builds has_many :commits has_many :requests diff --git a/lib/models/token.rb b/lib/models/token.rb index 29ab1bc..86f9207 100644 --- a/lib/models/token.rb +++ b/lib/models/token.rb @@ -3,5 +3,6 @@ require 'model' class Token < Model + belongs_to :user self.table_name = 'tokens' end diff --git a/lib/models/trial_allowance.rb b/lib/models/trial_allowance.rb index 4432a76..244df8b 100644 --- a/lib/models/trial_allowance.rb +++ b/lib/models/trial_allowance.rb @@ -4,5 +4,6 @@ class TrialAllowance < Model belongs_to :creator, polymorphic: true + belongs_to :trial self.table_name = 'trial_allowances' end diff --git a/lib/models/user_beta_feature.rb b/lib/models/user_beta_feature.rb index d7d08bc..8c08afe 100644 --- a/lib/models/user_beta_feature.rb +++ b/lib/models/user_beta_feature.rb @@ -3,5 +3,6 @@ require 'model' class UserBetaFeature < Model + belongs_to :user self.table_name = 'user_beta_features' end diff --git a/spec/backup/load_from_files_spec.rb b/spec/backup/load_from_files_spec.rb new file mode 100644 index 0000000..a2cac8a --- /dev/null +++ b/spec/backup/load_from_files_spec.rb @@ -0,0 +1,103 @@ +$: << 'lib' +require 'uri' +require 'travis-backup' +require 'models/build' +require 'models/job' +require 'models/organization' +require 'models/user' +require 'support/factories' +require 'support/expected_files_provider' +require 'support/before_tests' +require 'support/utils' +require 'pry' +require 'byebug' + +describe Backup::LoadFromFiles do + before(:each) do + BeforeTests.new.run + end + + let(:files_location) { "spec/support/expected_files/remove_repo_builds" } + let!(:config) { Config.new(files_location: files_location, load_from_files: true, id_gap: 100) } + let!(:db_helper) { DbHelper.new(config) } + let!(:load_from_files) { Backup::LoadFromFiles.new(config, DryRunReporter.new) } + + describe 'run' do + context 'when it has remove_repo_builds resulting files to load' do + let!(:expected_structure) { + [ + 100, + { + job: [ + { + log: [100, 101], + annotation: [100, 101], + queueable_job: [100, 101], + id: 216 + }, + 217 + ], + stage: [ + { + job: [212, 213], + id: 100 + }, + { + job: [214, 215], + id: 101 + } + ], + id: 211 + } + ] + } + + it 'loads data properly' do + load_from_files.run + expect(Build.all.map(&:ids_of_all_dependencies_nested)).to eql(expected_structure) + end + + it 'sets id sequences properly' do + load_from_files.run + expected_ids = [ + Job.last.id + 1, + Job.last.id + 2, + Log.last.id + 1, + Stage.last.id + 1, + Annotation.last.id + 1, + QueueableJob.last.id + 1, + ] + + expect([ + Build.create({}).id, + Job.create({}).id, + Log.create({}).id, + Stage.create({}).id, + Annotation.create({job_id: 1, description: 'x', annotation_provider_id: 1}).id, + QueueableJob.create({}).id + ]).to eql(expected_ids) + end + end + + context 'when old data is present in db' do + context 'when the problem with associated data in db occurs' do + before do + config.files_location = "spec/support/expected_files/associated_db_data_problem" + end + + let!(:repository) { + db_helper.do_without_triggers do + FactoryBot.create( + :repository + ) + end + } + + it 'loads data with proper ids' do + load_from_files.run + expect(Build.all.map(&:repository_id)).to eql([1,1]) + end + end + end + end +end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 33a9707..c990f7e 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -10,7 +10,7 @@ BeforeTests.new.run end - describe 'ids_of_all_dependencies' do + describe 'ids_of_all_dependencies_with_filtered' do let!(:config) { Config.new(limit: 5) } let!(:db_helper) { DbHelper.new(config) } let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } @@ -24,7 +24,7 @@ } context 'when no filters are given' do it 'returns all dependencies ids in hash' do - expect(commit.ids_of_all_dependencies).to eql({ + expect(commit.ids_of_all_dependencies_with_filtered).to eql({ filtered_out: {}, main: { abuse: [1, 2], @@ -49,7 +49,7 @@ filter = { request: [ :jobs, :builds ] } - expect(commit.ids_of_all_dependencies(filter)).to eql({ + expect(commit.ids_of_all_dependencies_with_filtered(filter)).to eql({ main: { annotation: [1, 2], branch: [73], diff --git a/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json b/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json new file mode 100644 index 0000000..790f653 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json @@ -0,0 +1,29 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 57, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", + "annotation_provider_id": 0, + "status": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/build_50-161.json b/spec/support/expected_files/associated_db_data_problem/build_50-161.json new file mode 100644 index 0000000..0b225df --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/build_50-161.json @@ -0,0 +1,77 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:25 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + } + }, + { + "id": 161, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null, + "_dependencies_": { + "job": [ + 166, + 167 + ], + "stage": [ + 52, + 53 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/job_162-166.json b/spec/support/expected_files/associated_db_data_problem/job_162-166.json new file mode 100644 index 0000000..046f5c8 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/job_162-166.json @@ -0,0 +1,172 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 162, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52, + "_dependencies_": { + } + }, + { + "id": 163, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52, + "_dependencies_": { + } + }, + { + "id": 164, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53, + "_dependencies_": { + } + }, + { + "id": 165, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53, + "_dependencies_": { + } + }, + { + "id": 166, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + "log": [ + 57, + 58 + ], + "annotation": [ + 57, + 58 + ], + "queueable_job": [ + 57, + 58 + ] + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/job_167-167.json b/spec/support/expected_files/associated_db_data_problem/job_167-167.json new file mode 100644 index 0000000..3971614 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/job_167-167.json @@ -0,0 +1,36 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 167, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-10-17 20:29:26 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/log_57-58.json b/spec/support/expected_files/associated_db_data_problem/log_57-58.json new file mode 100644 index 0000000..718b3a9 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/log_57-58.json @@ -0,0 +1,37 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 57, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-03-17 21:29:24 UTC", + "updated_at": "2021-03-17 21:29:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json b/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json new file mode 100644 index 0000000..520851f --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json @@ -0,0 +1,17 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 57, + "job_id": 166, + "_dependencies_": { + } + }, + { + "id": 58, + "job_id": 166, + "_dependencies_": { + } + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/repository_1-1.json b/spec/support/expected_files/associated_db_data_problem/repository_1-1.json new file mode 100644 index 0000000..2c5e9e7 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/repository_1-1.json @@ -0,0 +1,32 @@ +{ + "table_name": "repositories", + "data": [ + { + "id": 10, + "name": null, + "url": null, + "created_at": "2021-03-12 18:18:22 UTC", + "updated_at": "2021-03-12 18:18:22 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/stage_52-53.json b/spec/support/expected_files/associated_db_data_problem/stage_52-53.json new file mode 100644 index 0000000..d61a2c9 --- /dev/null +++ b/spec/support/expected_files/associated_db_data_problem/stage_52-53.json @@ -0,0 +1,35 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 52, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null, + "_dependencies_": { + "job": [ + 162, + 163 + ] + } + }, + { + "id": 53, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null, + "_dependencies_": { + "job": [ + 164, + 165 + ] + } + } + ] +} \ No newline at end of file From 42f5da2fbf2b30e7735e59dd28ca10d6fb2813a6 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 21 Oct 2021 11:40:52 +0200 Subject: [PATCH 48/88] _dependencies_ in file format removed --- lib/backup/load_from_files.rb | 1 - lib/backup/save_id_hash_to_file.rb | 4 +- .../annotation_57-58.json | 8 +-- .../build_50-161.json | 16 +---- .../job_162-166.json | 32 ++------- .../job_167-167.json | 4 +- .../associated_db_data_problem/log_57-58.json | 8 +-- .../queueable_job_57-58.json | 8 +-- .../stage_52-53.json | 16 +---- .../abuse_14-26.json | 20 ++---- .../abuse_27-47.json | 20 ++---- .../abuse_48-52.json | 20 ++---- .../abuse_9-13.json | 20 ++---- .../annotation_17-21.json | 20 ++---- .../annotation_22-26.json | 20 ++---- .../annotation_27-31.json | 20 ++---- .../annotation_32-52.json | 20 ++---- .../annotation_53-89.json | 20 ++---- .../annotation_90-94.json | 20 ++---- .../branch_86-91.json | 28 +------- .../broadcast_1-2.json | 8 +-- .../build_145-210.json | 23 ++---- .../build_260-268.json | 15 +--- .../build_50-70.json | 20 ++---- .../build_75-140.json | 20 ++---- .../commit_217-227.json | 56 ++------------- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +-- .../invoice_1-4.json | 16 ++--- .../job_154-264.json | 56 ++------------- .../job_265-272.json | 44 ++---------- .../job_54-61.json | 56 ++------------- .../job_62-72.json | 44 ++---------- .../job_76-86.json | 56 ++------------- .../job_87-150.json | 44 ++---------- .../log_17-21.json | 20 ++---- .../log_22-26.json | 20 ++---- .../log_27-31.json | 20 ++---- .../log_32-52.json | 20 ++---- .../log_53-89.json | 20 ++---- .../log_90-94.json | 20 ++---- .../membership_1-2.json | 8 +-- .../message_14-26.json | 20 ++---- .../message_27-47.json | 20 ++---- .../message_48-50.json | 12 +--- .../message_9-13.json | 20 ++---- .../organization_1-1.json | 52 +------------- .../owner_group_1-2.json | 8 +-- .../permission_3-4.json | 8 +-- .../pull_request_3-6.json | 16 +---- .../queueable_job_17-21.json | 20 ++---- .../queueable_job_22-26.json | 20 ++---- .../queueable_job_27-31.json | 20 ++---- .../queueable_job_32-52.json | 20 ++---- .../queueable_job_53-89.json | 20 ++---- .../queueable_job_90-94.json | 20 ++---- .../repository_1-66.json | 48 +------------ .../request_11-15.json | 68 ++---------------- .../request_16-30.json | 52 ++------------ .../request_31-55.json | 68 ++---------------- .../request_56-58.json | 28 +------- .../ssl_key_33-34.json | 8 +-- .../star_3-4.json | 8 +-- .../subscription_1-2.json | 16 +---- .../tag_33-38.json | 20 +----- .../trial_1-2.json | 16 +---- .../trial_allowance_1-5.json | 20 ++---- .../trial_allowance_6-6.json | 4 +- .../remove_repo_builds/annotation_57-58.json | 8 +-- .../remove_repo_builds/build_50-161.json | 16 +---- .../remove_repo_builds/job_162-166.json | 32 ++------- .../remove_repo_builds/job_167-167.json | 4 +- .../remove_repo_builds/log_57-58.json | 8 +-- .../queueable_job_57-58.json | 8 +-- .../remove_repo_builds/stage_52-53.json | 16 +---- .../remove_repo_requests/abuse_9-10.json | 8 +-- .../annotation_17-18.json | 8 +-- .../remove_repo_requests/build_53-53.json | 4 +- .../remove_repo_requests/job_54-55.json | 20 +----- .../remove_repo_requests/log_17-18.json | 8 +-- .../remove_repo_requests/message_9-10.json | 8 +-- .../queueable_job_17-18.json | 8 +-- .../remove_repo_requests/request_11-12.json | 24 +------ .../abuse_14-26.json | 20 ++---- .../abuse_27-30.json | 16 ++--- .../abuse_9-13.json | 20 ++---- .../annotation_17-21.json | 20 ++---- .../annotation_22-26.json | 20 ++---- .../annotation_27-31.json | 20 ++---- .../annotation_32-52.json | 20 ++---- .../annotation_53-56.json | 16 ++--- .../branch_86-91.json | 28 +------- .../build_145-158.json | 16 ++--- .../build_50-70.json | 20 ++---- .../build_75-140.json | 20 ++---- .../commit_217-227.json | 56 ++------------- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +-- .../job_154-160.json | 40 ++--------- .../job_54-61.json | 56 ++------------- .../job_62-72.json | 44 ++---------- .../job_76-86.json | 56 ++------------- .../job_87-150.json | 44 ++---------- .../log_17-21.json | 20 ++---- .../log_22-26.json | 20 ++---- .../log_27-31.json | 20 ++---- .../log_32-52.json | 20 ++---- .../log_53-56.json | 16 ++--- .../message_14-26.json | 20 ++---- .../message_27-30.json | 16 ++--- .../message_9-13.json | 20 ++---- .../permission_3-4.json | 8 +-- .../pull_request_3-6.json | 16 +---- .../queueable_job_17-21.json | 20 ++---- .../queueable_job_22-26.json | 20 ++---- .../queueable_job_27-31.json | 20 ++---- .../queueable_job_32-52.json | 20 ++---- .../queueable_job_53-56.json | 16 ++--- .../repository_1-1.json | 44 +----------- .../request_11-15.json | 68 ++---------------- .../request_16-30.json | 52 ++------------ .../request_31-34.json | 48 ++----------- .../ssl_key_33-34.json | 8 +-- .../star_3-4.json | 8 +-- .../tag_33-38.json | 20 +----- .../abuse_14-26.json | 20 ++---- .../abuse_27-47.json | 20 ++---- .../abuse_48-52.json | 20 ++---- .../abuse_9-13.json | 20 ++---- .../annotation_17-21.json | 20 ++---- .../annotation_22-26.json | 20 ++---- .../annotation_27-31.json | 20 ++---- .../annotation_32-52.json | 20 ++---- .../annotation_53-89.json | 20 ++---- .../annotation_90-94.json | 20 ++---- .../branch_86-91.json | 28 +------- .../broadcast_1-2.json | 8 +-- .../build_145-210.json | 23 ++---- .../build_260-268.json | 15 +--- .../build_50-70.json | 20 ++---- .../build_75-140.json | 20 ++---- .../commit_217-227.json | 56 ++------------- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +-- .../email_9-10.json | 8 +-- .../invoice_1-4.json | 16 ++--- .../job_154-264.json | 56 ++------------- .../job_265-272.json | 44 ++---------- .../job_54-61.json | 56 ++------------- .../job_62-72.json | 44 ++---------- .../job_76-86.json | 56 ++------------- .../job_87-150.json | 44 ++---------- .../log_17-21.json | 20 ++---- .../log_22-26.json | 20 ++---- .../log_27-31.json | 20 ++---- .../log_32-52.json | 20 ++---- .../log_53-89.json | 20 ++---- .../log_90-94.json | 20 ++---- .../membership_1-2.json | 8 +-- .../message_14-26.json | 20 ++---- .../message_27-47.json | 20 ++---- .../message_48-50.json | 12 +--- .../message_9-13.json | 20 ++---- .../owner_group_1-2.json | 8 +-- .../permission_1-6.json | 16 ++--- .../pull_request_3-6.json | 16 +---- .../queueable_job_17-21.json | 20 ++---- .../queueable_job_22-26.json | 20 ++---- .../queueable_job_27-31.json | 20 ++---- .../queueable_job_32-52.json | 20 ++---- .../queueable_job_53-89.json | 20 ++---- .../queueable_job_90-94.json | 20 ++---- .../repository_1-66.json | 48 +------------ .../request_11-15.json | 68 ++---------------- .../request_16-30.json | 52 ++------------ .../request_31-55.json | 68 ++---------------- .../request_56-58.json | 28 +------- .../ssl_key_33-34.json | 8 +-- .../star_1-6.json | 16 ++--- .../subscription_1-2.json | 16 +---- .../tag_33-38.json | 20 +----- .../token_9-10.json | 8 +-- .../trial_1-2.json | 16 +---- .../trial_allowance_1-5.json | 20 ++---- .../trial_allowance_6-6.json | 4 +- .../user_9-9.json | 72 +------------------ .../user_beta_feature_1-2.json | 8 +-- 187 files changed, 705 insertions(+), 3612 deletions(-) diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index 767b6e5..18cc6b9 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -99,7 +99,6 @@ def load_data_with_offsets data_file.data_hash.map do |entry_hash| entry_hash.symbolize_keys! - entry_hash.delete(:_dependencies_) entry_hash[:id] += @id_offsets[data_file.table_name.to_sym] add_offset_to_foreign_keys!(model, entry_hash) model.create(entry_hash) diff --git a/lib/backup/save_id_hash_to_file.rb b/lib/backup/save_id_hash_to_file.rb index 0bae263..7347f1d 100644 --- a/lib/backup/save_id_hash_to_file.rb +++ b/lib/backup/save_id_hash_to_file.rb @@ -28,8 +28,6 @@ def save_ids_batch_to_file(name, ids_batch) def get_exported_object(model, id) object = model.find(id) - result = object.attributes - result[:_dependencies_] = object.ids_of_all_direct_dependencies - result + object.attributes end end \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json b/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json index 790f653..adaaceb 100644 --- a/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json +++ b/spec/support/expected_files/associated_db_data_problem/annotation_57-58.json @@ -9,9 +9,7 @@ "created_at": "2021-03-17 21:29:24 UTC", "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 58, @@ -21,9 +19,7 @@ "created_at": "2021-03-17 21:29:24 UTC", "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/build_50-161.json b/spec/support/expected_files/associated_db_data_problem/build_50-161.json index 0b225df..0783c47 100644 --- a/spec/support/expected_files/associated_db_data_problem/build_50-161.json +++ b/spec/support/expected_files/associated_db_data_problem/build_50-161.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 161, @@ -61,17 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "job": [ - 166, - 167 - ], - "stage": [ - 52, - 53 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/job_162-166.json b/spec/support/expected_files/associated_db_data_problem/job_162-166.json index 046f5c8..6a366e3 100644 --- a/spec/support/expected_files/associated_db_data_problem/job_162-166.json +++ b/spec/support/expected_files/associated_db_data_problem/job_162-166.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 52, - "_dependencies_": { - } + "stage_id": 52 }, { "id": 163, @@ -59,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 52, - "_dependencies_": { - } + "stage_id": 52 }, { "id": 164, @@ -90,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 53, - "_dependencies_": { - } + "stage_id": 53 }, { "id": 165, @@ -121,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 53, - "_dependencies_": { - } + "stage_id": 53 }, { "id": 166, @@ -152,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 57, - 58 - ], - "annotation": [ - 57, - 58 - ], - "queueable_job": [ - 57, - 58 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/job_167-167.json b/spec/support/expected_files/associated_db_data_problem/job_167-167.json index 3971614..ca7204d 100644 --- a/spec/support/expected_files/associated_db_data_problem/job_167-167.json +++ b/spec/support/expected_files/associated_db_data_problem/job_167-167.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/log_57-58.json b/spec/support/expected_files/associated_db_data_problem/log_57-58.json index 718b3a9..b4959cd 100644 --- a/spec/support/expected_files/associated_db_data_problem/log_57-58.json +++ b/spec/support/expected_files/associated_db_data_problem/log_57-58.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 58, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json b/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json index 520851f..09971dd 100644 --- a/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json +++ b/spec/support/expected_files/associated_db_data_problem/queueable_job_57-58.json @@ -3,15 +3,11 @@ "data": [ { "id": 57, - "job_id": 166, - "_dependencies_": { - } + "job_id": 166 }, { "id": 58, - "job_id": 166, - "_dependencies_": { - } + "job_id": 166 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/associated_db_data_problem/stage_52-53.json b/spec/support/expected_files/associated_db_data_problem/stage_52-53.json index d61a2c9..bffd072 100644 --- a/spec/support/expected_files/associated_db_data_problem/stage_52-53.json +++ b/spec/support/expected_files/associated_db_data_problem/stage_52-53.json @@ -8,13 +8,7 @@ "name": null, "state": null, "started_at": null, - "finished_at": null, - "_dependencies_": { - "job": [ - 162, - 163 - ] - } + "finished_at": null }, { "id": 53, @@ -23,13 +17,7 @@ "name": null, "state": null, "started_at": null, - "finished_at": null, - "_dependencies_": { - "job": [ - 164, - 165 - ] - } + "finished_at": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json index 762506f..ebedf9c 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -9,9 +9,7 @@ "level": 14, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 15, @@ -21,9 +19,7 @@ "level": 15, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 16, @@ -33,9 +29,7 @@ "level": 16, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 25, @@ -45,9 +39,7 @@ "level": 25, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 26, @@ -57,9 +49,7 @@ "level": 26, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json index e01ad2a..7947dc1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -9,9 +9,7 @@ "level": 27, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 28, @@ -21,9 +19,7 @@ "level": 28, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 29, @@ -33,9 +29,7 @@ "level": 29, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 30, @@ -45,9 +39,7 @@ "level": 30, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 47, @@ -57,9 +49,7 @@ "level": 47, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json index 8ee7915..c83af21 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -9,9 +9,7 @@ "level": 48, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 49, @@ -21,9 +19,7 @@ "level": 49, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 50, @@ -33,9 +29,7 @@ "level": 50, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 51, @@ -45,9 +39,7 @@ "level": 51, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 52, @@ -57,9 +49,7 @@ "level": 52, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json index 77bb26d..cbd7c03 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -9,9 +9,7 @@ "level": 9, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 10, @@ -21,9 +19,7 @@ "level": 10, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 11, @@ -33,9 +29,7 @@ "level": 11, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 12, @@ -45,9 +39,7 @@ "level": 12, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 13, @@ -57,9 +49,7 @@ "level": 13, "reason": "some text", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json index 07ac111..1aaa8a8 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 18, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 19, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 20, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 21, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json index 97477c0..5f3d9b9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 23, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 24, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 25, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 26, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json index fd60cc4..d0b52ae 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 28, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 29, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 30, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 31, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json index df5d4ca..0de94fd 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 49, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 50, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 51, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 52, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json index 779356b..545bbfb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 54, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 55, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 56, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 89, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json index 355dc84..d1237ed 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 91, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 92, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 93, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 94, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json index 638cb53..8ec1455 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -8,29 +8,7 @@ "name": "branch_14", "exists_on_github": true, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - "build": [ - 58, - 60 - ], - "commit": [ - 217, - 218 - ], - "cron": [ - 3, - 4 - ], - "job": [ - 61, - 62 - ], - "request": [ - 15, - 16 - ] - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 91, @@ -39,9 +17,7 @@ "name": "branch_19", "exists_on_github": true, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json index d26b30e..c70a88d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -10,9 +10,7 @@ "expired": null, "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", - "category": null, - "_dependencies_": { - } + "category": null }, { "id": 2, @@ -23,9 +21,7 @@ "expired": null, "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", - "category": null, - "_dependencies_": { - } + "category": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json index f29a7d3..79a5882 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 148, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 153, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 158, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 210, @@ -157,12 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "repository": [ - 1 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json index 4e82703..c504ff1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json @@ -29,12 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": 1, - "sender_type": "Organization", - "_dependencies_": { - "repository": [ - 1 - ] - } + "sender_type": "Organization" }, { "id": 263, @@ -64,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 268, @@ -96,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json index 8658a87..8fd9d6e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 53, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 60, @@ -93,9 +89,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 65, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 70, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json index 32897fe..d3d28c5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 80, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 85, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 137, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 140, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json index c61dbd3..e241ba2 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -17,21 +17,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - "build": [ - 63, - 65 - ], - "job": [ - 66, - 67 - ], - "request": [ - 13, - 14 - ] - } + "tag_id": null }, { "id": 218, @@ -49,9 +35,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 219, @@ -69,21 +53,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - "build": [ - 78, - 80 - ], - "job": [ - 81, - 82 - ], - "request": [ - 17, - 18 - ] - } + "tag_id": null }, { "id": 220, @@ -101,9 +71,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 227, @@ -121,21 +89,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - "build": [ - 146, - 148 - ], - "job": [ - 149, - 150 - ], - "request": [ - 31, - 32 - ] - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json index d1e00a6..7a2f051 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -17,9 +17,7 @@ "created_at": "2021-03-12 10:36:58 UTC", "updated_at": "2021-03-12 10:36:58 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json index 057010e..08bf714 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -9,9 +9,7 @@ "updated_at": "2021-03-12 10:36:58 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false }, { "id": 4, @@ -21,9 +19,7 @@ "updated_at": "2021-03-12 10:36:58 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json index dfb7d29..234c492 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -9,9 +9,7 @@ "subscription_id": 1, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 2, @@ -21,9 +19,7 @@ "subscription_id": 1, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 3, @@ -33,9 +29,7 @@ "subscription_id": 2, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 4, @@ -45,9 +39,7 @@ "subscription_id": 2, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json index b601972..c7c04f3 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 53, - 54 - ], - "annotation": [ - 53, - 54 - ], - "queueable_job": [ - 53, - 54 - ] - } + "stage_id": null }, { "id": 155, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 159, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 55, - 56 - ], - "annotation": [ - 55, - 56 - ], - "queueable_job": [ - 55, - 56 - ] - } + "stage_id": null }, { "id": 160, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 264, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 89, - 90 - ], - "annotation": [ - 89, - 90 - ], - "queueable_job": [ - 89, - 90 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json index 344c2cc..ca68aa6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 269, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 91, - 92 - ], - "annotation": [ - 91, - 92 - ], - "queueable_job": [ - 91, - 92 - ] - } + "stage_id": null }, { "id": 270, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 271, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 93, - 94 - ], - "annotation": [ - 93, - 94 - ], - "queueable_job": [ - 93, - 94 - ] - } + "stage_id": null }, { "id": 272, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json index d776e33..6ea972e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 17, - 18 - ], - "annotation": [ - 17, - 18 - ], - "queueable_job": [ - 17, - 18 - ] - } + "stage_id": null }, { "id": 55, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 56, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 19, - 20 - ], - "annotation": [ - 19, - 20 - ], - "queueable_job": [ - 19, - 20 - ] - } + "stage_id": null }, { "id": 57, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 61, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 21, - 22 - ], - "annotation": [ - 21, - 22 - ], - "queueable_job": [ - 21, - 22 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json index 2a0b201..dfa1044 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 66, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 23, - 24 - ], - "annotation": [ - 23, - 24 - ], - "queueable_job": [ - 23, - 24 - ] - } + "stage_id": null }, { "id": 67, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 71, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 25, - 26 - ], - "annotation": [ - 25, - 26 - ], - "queueable_job": [ - 25, - 26 - ] - } + "stage_id": null }, { "id": 72, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json index ebde598..98cf653 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 27, - 28 - ], - "annotation": [ - 27, - 28 - ], - "queueable_job": [ - 27, - 28 - ] - } + "stage_id": null }, { "id": 77, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 81, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 29, - 30 - ], - "annotation": [ - 29, - 30 - ], - "queueable_job": [ - 29, - 30 - ] - } + "stage_id": null }, { "id": 82, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 86, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 31, - 32 - ], - "annotation": [ - 31, - 32 - ], - "queueable_job": [ - 31, - 32 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json index 8194f28..85156f5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 141, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 49, - 50 - ], - "annotation": [ - 49, - 50 - ], - "queueable_job": [ - 49, - 50 - ] - } + "stage_id": null }, { "id": 142, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 149, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 51, - 52 - ], - "annotation": [ - 51, - 52 - ], - "queueable_job": [ - 51, - 52 - ] - } + "stage_id": null }, { "id": 150, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json index 4a3aaf0..fe096bd 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 18, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 19, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 20, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 21, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json index a72f5ee..e39fab6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 23, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 24, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 25, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 26, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json index 8da8533..cc9a0a1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 28, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 29, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 30, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 31, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json index 2924210..8f6f1aa 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 49, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 50, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 51, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 52, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json index 2d07359..6609c3d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 54, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 55, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 56, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 89, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json index 776efc1..73f7a28 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 91, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 92, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 93, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 94, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json index 3e46a24..aa9f4cb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/membership_1-2.json @@ -5,17 +5,13 @@ "id": 1, "organization_id": 1, "user_id": null, - "role": null, - "_dependencies_": { - } + "role": null }, { "id": 2, "organization_id": 1, "user_id": null, - "role": null, - "_dependencies_": { - } + "role": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json index 3942d15..3da58fa 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 15, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 16, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 25, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 26, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json index 7230b1f..b2d7a53 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 28, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 29, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 30, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 47, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json index 0adf532..0e8ec3a 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 49, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 50, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json index e80d08d..71a8709 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 10, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 11, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 12, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 13, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json index ca78a8f..bc512fc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -13,57 +13,7 @@ "email": null, "company": null, "homepage": null, - "billing_admin_only": null, - "_dependencies_": { - "build": [ - 161, - 210, - 211, - 260 - ], - "repository": [ - 1, - 66 - ], - "job": [ - 271, - 272 - ], - "request": [ - 57, - 58, - 55, - 56 - ], - "abuse": [ - 51, - 52 - ], - "subscription": [ - 1, - 2 - ], - "owner_group": [ - 1, - 2 - ], - "trial": [ - 1, - 2 - ], - "trial_allowance": [ - 5, - 6 - ], - "broadcast": [ - 1, - 2 - ], - "membership": [ - 1, - 2 - ] - } + "billing_admin_only": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json index 8df0e1f..522ea16 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -7,9 +7,7 @@ "owner_id": 1, "owner_type": "Organization", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 2, @@ -17,9 +15,7 @@ "owner_id": 1, "owner_type": "Organization", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json index 9e5945b..56c2d35 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/permission_3-4.json @@ -7,9 +7,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false }, { "id": 4, @@ -17,9 +15,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json index fd321ba..f67b359 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -11,17 +11,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - "request": [ - 29, - 30 - ], - "build": [ - 88, - 137 - ] - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 6, @@ -33,9 +23,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json index 281cd6a..383a7f2 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json @@ -3,33 +3,23 @@ "data": [ { "id": 17, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 18, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 19, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 20, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 21, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json index be28310..f88dd7e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json @@ -3,33 +3,23 @@ "data": [ { "id": 22, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 }, { "id": 23, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 24, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 25, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 }, { "id": 26, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json index f288927..fd90ec4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json @@ -3,33 +3,23 @@ "data": [ { "id": 27, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 28, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 29, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 30, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 31, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json index 9bd6198..f922173 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json @@ -3,33 +3,23 @@ "data": [ { "id": 32, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 }, { "id": 49, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 50, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 51, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 }, { "id": 52, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json index afeb7f3..091c4ca 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json @@ -3,33 +3,23 @@ "data": [ { "id": 53, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 54, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 55, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 }, { "id": 56, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 }, { "id": 89, - "job_id": 264, - "_dependencies_": { - } + "job_id": 264 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json index ebfff7c..f37a5eb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json @@ -3,33 +3,23 @@ "data": [ { "id": 90, - "job_id": 264, - "_dependencies_": { - } + "job_id": 264 }, { "id": 91, - "job_id": 269, - "_dependencies_": { - } + "job_id": 269 }, { "id": 92, - "job_id": 269, - "_dependencies_": { - } + "job_id": 269 }, { "id": 93, - "job_id": 271, - "_dependencies_": { - } + "job_id": 271 }, { "id": 94, - "job_id": 271, - "_dependencies_": { - } + "job_id": 271 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json index 8ab8586..b6db4a9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -26,49 +26,7 @@ "settings": null, "next_build_number": null, "invalidated_at": null, - "current_build_id": 210, - "_dependencies_": { - "build": [ - 1, - 50 - ], - "request": [ - 11, - 12 - ], - "job": [ - 56, - 57 - ], - "branch": [ - 86, - 91 - ], - "ssl_key": [ - 33, - 34 - ], - "commit": [ - 219, - 220 - ], - "permission": [ - 3, - 4 - ], - "star": [ - 3, - 4 - ], - "pull_request": [ - 3, - 6 - ], - "tag": [ - 33, - 38 - ] - } + "current_build_id": 210 }, { "id": 66, @@ -95,9 +53,7 @@ "settings": null, "next_build_number": null, "invalidated_at": null, - "current_build_id": null, - "_dependencies_": { - } + "current_build_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json index 56f0de6..0a560c0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 9, - 10 - ], - "message": [ - 9, - 10 - ], - "job": [ - 54, - 55 - ], - "build": [ - 51, - 53 - ] - } + "sender_type": null }, { "id": 12, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 13, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 11, - 12 - ], - "message": [ - 11, - 12 - ], - "job": [ - 71, - 72 - ], - "build": [ - 68, - 70 - ] - } + "sender_type": null }, { "id": 14, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 15, @@ -179,25 +139,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 13, - 14 - ], - "message": [ - 13, - 14 - ], - "job": [ - 76, - 77 - ], - "build": [ - 73, - 75 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json index 2043e96..1757adf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -27,9 +27,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 17, @@ -57,25 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 15, - 16 - ], - "message": [ - 15, - 16 - ], - "job": [ - 86, - 87 - ], - "build": [ - 83, - 85 - ] - } + "sender_type": null }, { "id": 18, @@ -103,9 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 29, @@ -133,25 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 25, - 26 - ], - "message": [ - 25, - 26 - ], - "job": [ - 141, - 142 - ], - "build": [ - 138, - 140 - ] - } + "sender_type": null }, { "id": 30, @@ -179,9 +139,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json index 9975824..4b2a16d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 27, - 28 - ], - "message": [ - 27, - 28 - ], - "job": [ - 154, - 155 - ], - "build": [ - 151, - 153 - ] - } + "sender_type": null }, { "id": 32, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 33, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 29, - 30 - ], - "message": [ - 29, - 30 - ], - "job": [ - 159, - 160 - ], - "build": [ - 156, - 158 - ] - } + "sender_type": null }, { "id": 34, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 55, @@ -179,25 +139,7 @@ "branch_id": null, "tag_id": null, "sender_id": 1, - "sender_type": "Organization", - "_dependencies_": { - "abuse": [ - 47, - 48 - ], - "message": [ - 47, - 48 - ], - "job": [ - 264, - 265 - ], - "build": [ - 261, - 263 - ] - } + "sender_type": "Organization" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json index 152bdb7..13907dc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -27,9 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": 1, - "sender_type": "Organization", - "_dependencies_": { - } + "sender_type": "Organization" }, { "id": 57, @@ -57,25 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 49, - 50 - ], - "message": [ - 49, - 50 - ], - "job": [ - 269, - 270 - ], - "build": [ - 266, - 268 - ] - } + "sender_type": null }, { "id": 58, @@ -103,9 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json index 354b803..c43c2fc 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -7,9 +7,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 34, @@ -17,9 +15,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json index a36cfb2..72d4308 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -6,18 +6,14 @@ "repository_id": 1, "user_id": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 4, "repository_id": 1, "user_id": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json index c04a988..6b4e660 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -31,13 +31,7 @@ "canceled_by_id": null, "status": null, "source": "unknown", - "concurrency": null, - "_dependencies_": { - "invoice": [ - 1, - 2 - ] - } + "concurrency": null }, { "id": 2, @@ -69,13 +63,7 @@ "canceled_by_id": null, "status": null, "source": "unknown", - "concurrency": null, - "_dependencies_": { - "invoice": [ - 3, - 4 - ] - } + "concurrency": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json index 9e89424..93816df 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -8,21 +8,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - "build": [ - 143, - 145 - ], - "commit": [ - 227, - 228 - ], - "request": [ - 33, - 34 - ] - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 38, @@ -31,9 +17,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json index a31ec03..c63384b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -10,13 +10,7 @@ ], "status": "new", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - "trial_allowance": [ - 1, - 2 - ] - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 2, @@ -27,13 +21,7 @@ ], "status": "new", "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - "trial_allowance": [ - 3, - 4 - ] - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json index 97373df..d45a224 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -9,9 +9,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 2, @@ -21,9 +19,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 3, @@ -33,9 +29,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 4, @@ -45,9 +39,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" }, { "id": 5, @@ -57,9 +49,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json index a540698..cb12b8d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -9,9 +9,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:36:58 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json index 790f653..adaaceb 100644 --- a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json @@ -9,9 +9,7 @@ "created_at": "2021-03-17 21:29:24 UTC", "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 58, @@ -21,9 +19,7 @@ "created_at": "2021-03-17 21:29:24 UTC", "updated_at": "2021-03-17 21:29:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/build_50-161.json b/spec/support/expected_files/remove_repo_builds/build_50-161.json index 0b225df..0783c47 100644 --- a/spec/support/expected_files/remove_repo_builds/build_50-161.json +++ b/spec/support/expected_files/remove_repo_builds/build_50-161.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 161, @@ -61,17 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "job": [ - 166, - 167 - ], - "stage": [ - 52, - 53 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_162-166.json b/spec/support/expected_files/remove_repo_builds/job_162-166.json index 046f5c8..6a366e3 100644 --- a/spec/support/expected_files/remove_repo_builds/job_162-166.json +++ b/spec/support/expected_files/remove_repo_builds/job_162-166.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 52, - "_dependencies_": { - } + "stage_id": 52 }, { "id": 163, @@ -59,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 52, - "_dependencies_": { - } + "stage_id": 52 }, { "id": 164, @@ -90,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 53, - "_dependencies_": { - } + "stage_id": 53 }, { "id": 165, @@ -121,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 53, - "_dependencies_": { - } + "stage_id": 53 }, { "id": 166, @@ -152,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 57, - 58 - ], - "annotation": [ - 57, - 58 - ], - "queueable_job": [ - 57, - 58 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_167-167.json b/spec/support/expected_files/remove_repo_builds/job_167-167.json index 3971614..ca7204d 100644 --- a/spec/support/expected_files/remove_repo_builds/job_167-167.json +++ b/spec/support/expected_files/remove_repo_builds/job_167-167.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_57-58.json b/spec/support/expected_files/remove_repo_builds/log_57-58.json index 718b3a9..b4959cd 100644 --- a/spec/support/expected_files/remove_repo_builds/log_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/log_57-58.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 58, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json b/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json index 520851f..09971dd 100644 --- a/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json @@ -3,15 +3,11 @@ "data": [ { "id": 57, - "job_id": 166, - "_dependencies_": { - } + "job_id": 166 }, { "id": 58, - "job_id": 166, - "_dependencies_": { - } + "job_id": 166 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/stage_52-53.json b/spec/support/expected_files/remove_repo_builds/stage_52-53.json index d61a2c9..bffd072 100644 --- a/spec/support/expected_files/remove_repo_builds/stage_52-53.json +++ b/spec/support/expected_files/remove_repo_builds/stage_52-53.json @@ -8,13 +8,7 @@ "name": null, "state": null, "started_at": null, - "finished_at": null, - "_dependencies_": { - "job": [ - 162, - 163 - ] - } + "finished_at": null }, { "id": 53, @@ -23,13 +17,7 @@ "name": null, "state": null, "started_at": null, - "finished_at": null, - "_dependencies_": { - "job": [ - 164, - 165 - ] - } + "finished_at": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/abuse_9-10.json b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json index 9e0e1a8..75c861e 100644 --- a/spec/support/expected_files/remove_repo_requests/abuse_9-10.json +++ b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json @@ -9,9 +9,7 @@ "level": 9, "reason": "some text", "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-18 12:32:24 UTC" }, { "id": 10, @@ -21,9 +19,7 @@ "level": 10, "reason": "some text", "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-18 12:32:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/annotation_17-18.json b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json index 9895543..08019e8 100644 --- a/spec/support/expected_files/remove_repo_requests/annotation_17-18.json +++ b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json @@ -9,9 +9,7 @@ "created_at": "2021-03-18 12:32:24 UTC", "updated_at": "2021-03-18 12:32:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 18, @@ -21,9 +19,7 @@ "created_at": "2021-03-18 12:32:24 UTC", "updated_at": "2021-03-18 12:32:24 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/build_53-53.json b/spec/support/expected_files/remove_repo_requests/build_53-53.json index c1b60b2..e11c3e5 100644 --- a/spec/support/expected_files/remove_repo_requests/build_53-53.json +++ b/spec/support/expected_files/remove_repo_requests/build_53-53.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/job_54-55.json b/spec/support/expected_files/remove_repo_requests/job_54-55.json index 91c84ea..8ae07cf 100644 --- a/spec/support/expected_files/remove_repo_requests/job_54-55.json +++ b/spec/support/expected_files/remove_repo_requests/job_54-55.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 17, - 18 - ], - "annotation": [ - 17, - 18 - ], - "queueable_job": [ - 17, - 18 - ] - } + "stage_id": null }, { "id": 55, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/log_17-18.json b/spec/support/expected_files/remove_repo_requests/log_17-18.json index 365bcb4..9201781 100644 --- a/spec/support/expected_files/remove_repo_requests/log_17-18.json +++ b/spec/support/expected_files/remove_repo_requests/log_17-18.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 18, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/message_9-10.json b/spec/support/expected_files/remove_repo_requests/message_9-10.json index cfb0d4b..fa7aa69 100644 --- a/spec/support/expected_files/remove_repo_requests/message_9-10.json +++ b/spec/support/expected_files/remove_repo_requests/message_9-10.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-18 12:32:24 UTC" }, { "id": 10, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-18 12:32:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json b/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json index f885a36..53de3e8 100644 --- a/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json +++ b/spec/support/expected_files/remove_repo_requests/queueable_job_17-18.json @@ -3,15 +3,11 @@ "data": [ { "id": 17, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 18, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/request_11-12.json b/spec/support/expected_files/remove_repo_requests/request_11-12.json index 07f2680..30f67cb 100644 --- a/spec/support/expected_files/remove_repo_requests/request_11-12.json +++ b/spec/support/expected_files/remove_repo_requests/request_11-12.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 9, - 10 - ], - "message": [ - 9, - 10 - ], - "job": [ - 54, - 55 - ], - "build": [ - 51, - 53 - ] - } + "sender_type": null }, { "id": 12, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json index 1e3d4b6..b8c2a2f 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json @@ -9,9 +9,7 @@ "level": 14, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 15, @@ -21,9 +19,7 @@ "level": 15, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 16, @@ -33,9 +29,7 @@ "level": 16, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 25, @@ -45,9 +39,7 @@ "level": 25, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 26, @@ -57,9 +49,7 @@ "level": 26, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json index 976b712..0c9495d 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json @@ -9,9 +9,7 @@ "level": 27, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 28, @@ -21,9 +19,7 @@ "level": 28, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 29, @@ -33,9 +29,7 @@ "level": 29, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 30, @@ -45,9 +39,7 @@ "level": 30, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json index ccbc679..8e1debe 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json @@ -9,9 +9,7 @@ "level": 9, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 10, @@ -21,9 +19,7 @@ "level": 10, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 11, @@ -33,9 +29,7 @@ "level": 11, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 12, @@ -45,9 +39,7 @@ "level": 12, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 13, @@ -57,9 +49,7 @@ "level": 13, "reason": "some text", "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json index b4394f7..2de4b6b 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 18, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 19, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 20, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 21, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json index 0798bd9..41e50e9 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 23, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 24, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 25, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 26, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json index d951317..87eaac1 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 28, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 29, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 30, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 31, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json index 3fe71bf..bf32a41 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 49, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 50, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 51, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 52, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json index c7a937f..bd42d0b 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 54, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 55, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 56, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json index 176ec97..774630f 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json @@ -8,29 +8,7 @@ "name": "branch_14", "exists_on_github": true, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - "build": [ - 58, - 60 - ], - "commit": [ - 217, - 218 - ], - "cron": [ - 3, - 4 - ], - "job": [ - 61, - 62 - ], - "request": [ - 15, - 16 - ] - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 91, @@ -39,9 +17,7 @@ "name": "branch_19", "exists_on_github": true, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json b/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json index cb79fe0..2f829f4 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 148, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 153, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 158, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json index dbd358b..de1ca12 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 53, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 60, @@ -93,9 +89,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 65, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 70, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json index 3a2667c..2d12552 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 80, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 85, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 137, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 140, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json index f94acb1..ef73196 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json @@ -17,21 +17,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - "build": [ - 63, - 65 - ], - "job": [ - 66, - 67 - ], - "request": [ - 13, - 14 - ] - } + "tag_id": null }, { "id": 218, @@ -49,9 +35,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 219, @@ -69,21 +53,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - "build": [ - 78, - 80 - ], - "job": [ - 81, - 82 - ], - "request": [ - 17, - 18 - ] - } + "tag_id": null }, { "id": 220, @@ -101,9 +71,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 227, @@ -121,21 +89,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - "build": [ - 146, - 148 - ], - "job": [ - 149, - 150 - ], - "request": [ - 31, - 32 - ] - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json index 5272bc7..5e0d3d9 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json @@ -17,9 +17,7 @@ "created_at": "2021-03-12 18:18:22 UTC", "updated_at": "2021-03-12 18:18:22 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json index ae34c7a..696a3e0 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json @@ -9,9 +9,7 @@ "updated_at": "2021-03-12 18:18:22 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false }, { "id": 4, @@ -21,9 +19,7 @@ "updated_at": "2021-03-12 18:18:22 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json b/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json index 99726ba..c401407 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 53, - 54 - ], - "annotation": [ - 53, - 54 - ], - "queueable_job": [ - 53, - 54 - ] - } + "stage_id": null }, { "id": 155, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 159, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 55, - 56 - ], - "annotation": [ - 55, - 56 - ], - "queueable_job": [ - 55, - 56 - ] - } + "stage_id": null }, { "id": 160, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json index 29e564b..b2fc592 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 17, - 18 - ], - "annotation": [ - 17, - 18 - ], - "queueable_job": [ - 17, - 18 - ] - } + "stage_id": null }, { "id": 55, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 56, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 19, - 20 - ], - "annotation": [ - 19, - 20 - ], - "queueable_job": [ - 19, - 20 - ] - } + "stage_id": null }, { "id": 57, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 61, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 21, - 22 - ], - "annotation": [ - 21, - 22 - ], - "queueable_job": [ - 21, - 22 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json index 1151bda..95205a5 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 66, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 23, - 24 - ], - "annotation": [ - 23, - 24 - ], - "queueable_job": [ - 23, - 24 - ] - } + "stage_id": null }, { "id": 67, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 71, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 25, - 26 - ], - "annotation": [ - 25, - 26 - ], - "queueable_job": [ - 25, - 26 - ] - } + "stage_id": null }, { "id": 72, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json index fc8ce04..2266228 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 27, - 28 - ], - "annotation": [ - 27, - 28 - ], - "queueable_job": [ - 27, - 28 - ] - } + "stage_id": null }, { "id": 77, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 81, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 29, - 30 - ], - "annotation": [ - 29, - 30 - ], - "queueable_job": [ - 29, - 30 - ] - } + "stage_id": null }, { "id": 82, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 86, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 31, - 32 - ], - "annotation": [ - 31, - 32 - ], - "queueable_job": [ - 31, - 32 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json index 01e92fb..36679d0 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 141, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 49, - 50 - ], - "annotation": [ - 49, - 50 - ], - "queueable_job": [ - 49, - 50 - ] - } + "stage_id": null }, { "id": 142, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 149, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 51, - 52 - ], - "annotation": [ - 51, - 52 - ], - "queueable_job": [ - 51, - 52 - ] - } + "stage_id": null }, { "id": 150, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json index 18e2587..77dca65 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 18, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 19, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 20, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 21, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json index d4fa48b..defb4d2 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 23, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 24, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 25, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 26, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json index bd0c24b..79c226e 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 28, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 29, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 30, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 31, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json index 0fa3365..f629c92 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 49, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 50, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 51, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 52, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json index 64d8617..339ae7e 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 54, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 55, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 56, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json index 7f1db05..0a1286f 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 15, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 16, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 25, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 26, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json index 0ccd7ba..dcd8e59 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 28, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 29, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 30, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json index 083a2eb..dd9e489 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 10, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 11, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 12, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 13, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json index 9e5945b..56c2d35 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/permission_3-4.json @@ -7,9 +7,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false }, { "id": 4, @@ -17,9 +15,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json index 67841b2..fb30e80 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json @@ -11,17 +11,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - "request": [ - 29, - 30 - ], - "build": [ - 88, - 137 - ] - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 6, @@ -33,9 +23,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json index 281cd6a..383a7f2 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json @@ -3,33 +3,23 @@ "data": [ { "id": 17, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 18, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 19, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 20, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 21, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json index be28310..f88dd7e 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json @@ -3,33 +3,23 @@ "data": [ { "id": 22, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 }, { "id": 23, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 24, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 25, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 }, { "id": 26, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json index f288927..fd90ec4 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json @@ -3,33 +3,23 @@ "data": [ { "id": 27, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 28, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 29, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 30, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 31, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json index 9bd6198..f922173 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json @@ -3,33 +3,23 @@ "data": [ { "id": 32, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 }, { "id": 49, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 50, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 51, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 }, { "id": 52, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json index e52cb93..32911b2 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json @@ -3,27 +3,19 @@ "data": [ { "id": 53, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 54, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 55, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 }, { "id": 56, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json index 417fcd3..9931f17 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json @@ -26,49 +26,7 @@ "settings": null, "next_build_number": null, "invalidated_at": null, - "current_build_id": null, - "_dependencies_": { - "build": [ - 1, - 50 - ], - "request": [ - 11, - 12 - ], - "job": [ - 56, - 57 - ], - "branch": [ - 86, - 91 - ], - "ssl_key": [ - 33, - 34 - ], - "commit": [ - 219, - 220 - ], - "permission": [ - 3, - 4 - ], - "star": [ - 3, - 4 - ], - "pull_request": [ - 3, - 6 - ], - "tag": [ - 33, - 38 - ] - } + "current_build_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json index 0cd9879..b0feaed 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 9, - 10 - ], - "message": [ - 9, - 10 - ], - "job": [ - 54, - 55 - ], - "build": [ - 51, - 53 - ] - } + "sender_type": null }, { "id": 12, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 13, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 11, - 12 - ], - "message": [ - 11, - 12 - ], - "job": [ - 71, - 72 - ], - "build": [ - 68, - 70 - ] - } + "sender_type": null }, { "id": 14, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 15, @@ -179,25 +139,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 13, - 14 - ], - "message": [ - 13, - 14 - ], - "job": [ - 76, - 77 - ], - "build": [ - 73, - 75 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json index bc27a62..97d948e 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json @@ -27,9 +27,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 17, @@ -57,25 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 15, - 16 - ], - "message": [ - 15, - 16 - ], - "job": [ - 86, - 87 - ], - "build": [ - 83, - 85 - ] - } + "sender_type": null }, { "id": 18, @@ -103,9 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 29, @@ -133,25 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 25, - 26 - ], - "message": [ - 25, - 26 - ], - "job": [ - 141, - 142 - ], - "build": [ - 138, - 140 - ] - } + "sender_type": null }, { "id": 30, @@ -179,9 +139,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json index 40ffe06..dee765c 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 27, - 28 - ], - "message": [ - 27, - 28 - ], - "job": [ - 154, - 155 - ], - "build": [ - 151, - 153 - ] - } + "sender_type": null }, { "id": 32, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 33, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 29, - 30 - ], - "message": [ - 29, - 30 - ], - "job": [ - 159, - 160 - ], - "build": [ - 156, - 158 - ] - } + "sender_type": null }, { "id": 34, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json index 63f0596..8d0c3a7 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json @@ -7,9 +7,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 34, @@ -17,9 +15,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json index 878d51f..f71d6cd 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json @@ -6,18 +6,14 @@ "repository_id": 1, "user_id": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 4, "repository_id": 1, "user_id": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json index 89c33f0..cfc821c 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json @@ -8,21 +8,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - "build": [ - 143, - 145 - ], - "commit": [ - 227, - 228 - ], - "request": [ - 33, - 34 - ] - } + "updated_at": "2021-03-12 18:18:22 UTC" }, { "id": 38, @@ -31,9 +17,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 18:18:22 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json index cde8ee4..f2f927c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json @@ -9,9 +9,7 @@ "level": 14, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 15, @@ -21,9 +19,7 @@ "level": 15, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 16, @@ -33,9 +29,7 @@ "level": 16, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 25, @@ -45,9 +39,7 @@ "level": 25, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 26, @@ -57,9 +49,7 @@ "level": 26, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json index 3187eea..6e34704 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json @@ -9,9 +9,7 @@ "level": 27, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 28, @@ -21,9 +19,7 @@ "level": 28, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 29, @@ -33,9 +29,7 @@ "level": 29, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 30, @@ -45,9 +39,7 @@ "level": 30, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 47, @@ -57,9 +49,7 @@ "level": 47, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json index 8497948..45c3e2c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json @@ -9,9 +9,7 @@ "level": 48, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 49, @@ -21,9 +19,7 @@ "level": 49, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 50, @@ -33,9 +29,7 @@ "level": 50, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 51, @@ -45,9 +39,7 @@ "level": 51, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 52, @@ -57,9 +49,7 @@ "level": 52, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json index 1b7a729..eaf85ef 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json @@ -9,9 +9,7 @@ "level": 9, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 10, @@ -21,9 +19,7 @@ "level": 10, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 11, @@ -33,9 +29,7 @@ "level": 11, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 12, @@ -45,9 +39,7 @@ "level": 12, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 13, @@ -57,9 +49,7 @@ "level": 13, "reason": "some text", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json index aeb97a7..b09ff59 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 18, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 19, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 20, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 21, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json index 8591cf7..e34ac17 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 23, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 24, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 25, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 26, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json index fe39373..6466a02 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 28, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 29, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 30, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 31, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json index 3d7a8aa..e1e743a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 49, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 50, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 51, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 52, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json index 1c5550a..46904ed 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 54, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 55, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 56, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 89, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json index 739fd54..5478913 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json @@ -9,9 +9,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 91, @@ -21,9 +19,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 92, @@ -33,9 +29,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 93, @@ -45,9 +39,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null }, { "id": 94, @@ -57,9 +49,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "annotation_provider_id": 0, - "status": null, - "_dependencies_": { - } + "status": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json index 88559dd..4632dd8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json @@ -8,29 +8,7 @@ "name": "branch_14", "exists_on_github": true, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - "build": [ - 58, - 60 - ], - "commit": [ - 217, - 218 - ], - "cron": [ - 3, - 4 - ], - "job": [ - 61, - 62 - ], - "request": [ - 15, - 16 - ] - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 91, @@ -39,9 +17,7 @@ "name": "branch_19", "exists_on_github": true, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json index e1cbcd6..ba07dc4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json @@ -10,9 +10,7 @@ "expired": null, "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", - "category": null, - "_dependencies_": { - } + "category": null }, { "id": 2, @@ -23,9 +21,7 @@ "expired": null, "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", - "category": null, - "_dependencies_": { - } + "category": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json index 821886e..5f681f0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 148, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 153, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 158, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 210, @@ -157,12 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "repository": [ - 1 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json index dcdae76..365df24 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json @@ -29,12 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": 9, - "sender_type": "User", - "_dependencies_": { - "repository": [ - 1 - ] - } + "sender_type": "User" }, { "id": 263, @@ -64,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 268, @@ -96,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json index cb95b14..36f5cf1 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 53, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 60, @@ -93,9 +89,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 65, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 70, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json index c4699a6..6c696af 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json @@ -29,9 +29,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 80, @@ -61,9 +59,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 85, @@ -93,9 +89,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 137, @@ -125,9 +119,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 140, @@ -157,9 +149,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json index 84b48ef..6e2662d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json @@ -17,21 +17,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - "build": [ - 63, - 65 - ], - "job": [ - 66, - 67 - ], - "request": [ - 13, - 14 - ] - } + "tag_id": null }, { "id": 218, @@ -49,9 +35,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": 86, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 219, @@ -69,21 +53,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - "build": [ - 78, - 80 - ], - "job": [ - 81, - 82 - ], - "request": [ - 17, - 18 - ] - } + "tag_id": null }, { "id": 220, @@ -101,9 +71,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, - "tag_id": null, - "_dependencies_": { - } + "tag_id": null }, { "id": 227, @@ -121,21 +89,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - "build": [ - 146, - 148 - ], - "job": [ - 149, - 150 - ], - "request": [ - 31, - 32 - ] - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json index fab0dc8..2ed7577 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json @@ -17,9 +17,7 @@ "created_at": "2021-03-12 10:46:10 UTC", "updated_at": "2021-03-12 10:46:10 UTC", "branch_id": null, - "tag_id": 33, - "_dependencies_": { - } + "tag_id": 33 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json index 8326582..f151520 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json @@ -9,9 +9,7 @@ "updated_at": "2021-03-12 10:46:10 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false }, { "id": 4, @@ -21,9 +19,7 @@ "updated_at": "2021-03-12 10:46:10 UTC", "next_run": null, "last_run": null, - "dont_run_if_recent_build_exists": false, - "_dependencies_": { - } + "dont_run_if_recent_build_exists": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json index bc73eb8..19af964 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json @@ -6,18 +6,14 @@ "user_id": 9, "email": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 10, "user_id": 9, "email": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json index baa5e93..6eaa5a3 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json @@ -9,9 +9,7 @@ "subscription_id": 1, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 2, @@ -21,9 +19,7 @@ "subscription_id": 1, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 3, @@ -33,9 +29,7 @@ "subscription_id": 2, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null }, { "id": 4, @@ -45,9 +39,7 @@ "subscription_id": 2, "invoice_id": null, "stripe_id": null, - "cc_last_digits": null, - "_dependencies_": { - } + "cc_last_digits": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json index a0fa6d7..bc4b35d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 53, - 54 - ], - "annotation": [ - 53, - 54 - ], - "queueable_job": [ - 53, - 54 - ] - } + "stage_id": null }, { "id": 155, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 159, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 55, - 56 - ], - "annotation": [ - 55, - 56 - ], - "queueable_job": [ - 55, - 56 - ] - } + "stage_id": null }, { "id": 160, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 264, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 89, - 90 - ], - "annotation": [ - 89, - 90 - ], - "queueable_job": [ - 89, - 90 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json index 8a967bd..a824fcb 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 269, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 91, - 92 - ], - "annotation": [ - 91, - 92 - ], - "queueable_job": [ - 91, - 92 - ] - } + "stage_id": null }, { "id": 270, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 271, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 93, - 94 - ], - "annotation": [ - 93, - 94 - ], - "queueable_job": [ - 93, - 94 - ] - } + "stage_id": null }, { "id": 272, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json index f8c7968..2cff48b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 17, - 18 - ], - "annotation": [ - 17, - 18 - ], - "queueable_job": [ - 17, - 18 - ] - } + "stage_id": null }, { "id": 55, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 56, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 19, - 20 - ], - "annotation": [ - 19, - 20 - ], - "queueable_job": [ - 19, - 20 - ] - } + "stage_id": null }, { "id": 57, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 61, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 21, - 22 - ], - "annotation": [ - 21, - 22 - ], - "queueable_job": [ - 21, - 22 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json index 6e2bff7..b617f85 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 66, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 23, - 24 - ], - "annotation": [ - 23, - 24 - ], - "queueable_job": [ - 23, - 24 - ] - } + "stage_id": null }, { "id": 67, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 71, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 25, - 26 - ], - "annotation": [ - 25, - 26 - ], - "queueable_job": [ - 25, - 26 - ] - } + "stage_id": null }, { "id": 72, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json index bc0016f..467a9a8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json @@ -28,21 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 27, - 28 - ], - "annotation": [ - 27, - 28 - ], - "queueable_job": [ - 27, - 28 - ] - } + "stage_id": null }, { "id": 77, @@ -71,9 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 81, @@ -102,21 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 29, - 30 - ], - "annotation": [ - 29, - 30 - ], - "queueable_job": [ - 29, - 30 - ] - } + "stage_id": null }, { "id": 82, @@ -145,9 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 86, @@ -176,21 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 31, - 32 - ], - "annotation": [ - 31, - 32 - ], - "queueable_job": [ - 31, - 32 - ] - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json index 240cdfd..5416a0e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json @@ -28,9 +28,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 141, @@ -59,21 +57,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 49, - 50 - ], - "annotation": [ - 49, - 50 - ], - "queueable_job": [ - 49, - 50 - ] - } + "stage_id": null }, { "id": 142, @@ -102,9 +86,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null }, { "id": 149, @@ -133,21 +115,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - "log": [ - 51, - 52 - ], - "annotation": [ - 51, - 52 - ], - "queueable_job": [ - 51, - 52 - ] - } + "stage_id": null }, { "id": 150, @@ -176,9 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null, - "_dependencies_": { - } + "stage_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json index 2d65ae4..1c57c97 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 18, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 19, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 20, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 21, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json index 59ec0c5..03bb3e2 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 23, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 24, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 25, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 26, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json index 93af892..de85ad6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 28, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 29, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 30, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 31, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json index eed558e..d04df49 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 49, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 50, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 51, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 52, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json index cbd2f4c..a3bdc26 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 54, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 55, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 56, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 89, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json index 87c2a15..07a3b92 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json @@ -13,9 +13,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 91, @@ -29,9 +27,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 92, @@ -45,9 +41,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 93, @@ -61,9 +55,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true }, { "id": 94, @@ -77,9 +69,7 @@ "purged_at": null, "removed_at": null, "archiving": false, - "archive_verified": true, - "_dependencies_": { - } + "archive_verified": true } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json index bdaf17f..a019065 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/membership_1-2.json @@ -5,17 +5,13 @@ "id": 1, "organization_id": null, "user_id": 9, - "role": null, - "_dependencies_": { - } + "role": null }, { "id": 2, "organization_id": null, "user_id": 9, - "role": null, - "_dependencies_": { - } + "role": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json index fb99264..54e9dca 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 15, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 16, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 25, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 26, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json index 80e139b..45630ab 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 28, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 29, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 30, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 47, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json index ef693e6..fbc232c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 49, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 50, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json index 98b7057..9aaa35a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json @@ -10,9 +10,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 10, @@ -23,9 +21,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 11, @@ -36,9 +32,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 12, @@ -49,9 +43,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 13, @@ -62,9 +54,7 @@ "code": null, "args": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json index 7b61697..b0ea118 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json @@ -7,9 +7,7 @@ "owner_id": 9, "owner_type": "User", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 2, @@ -17,9 +15,7 @@ "owner_id": 9, "owner_type": "User", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json index 218839b..f0fb06f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/permission_1-6.json @@ -7,9 +7,7 @@ "repository_id": null, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false }, { "id": 2, @@ -17,9 +15,7 @@ "repository_id": null, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false }, { "id": 5, @@ -27,9 +23,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false }, { "id": 6, @@ -37,9 +31,7 @@ "repository_id": 1, "admin": false, "push": false, - "pull": false, - "_dependencies_": { - } + "pull": false } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json index 394ed68..794a625 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json @@ -11,17 +11,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - "request": [ - 29, - 30 - ], - "build": [ - 88, - 137 - ] - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 6, @@ -33,9 +23,7 @@ "head_repo_slug": null, "head_ref": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json index 281cd6a..383a7f2 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json @@ -3,33 +3,23 @@ "data": [ { "id": 17, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 18, - "job_id": 54, - "_dependencies_": { - } + "job_id": 54 }, { "id": 19, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 20, - "job_id": 56, - "_dependencies_": { - } + "job_id": 56 }, { "id": 21, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json index be28310..f88dd7e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json @@ -3,33 +3,23 @@ "data": [ { "id": 22, - "job_id": 61, - "_dependencies_": { - } + "job_id": 61 }, { "id": 23, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 24, - "job_id": 66, - "_dependencies_": { - } + "job_id": 66 }, { "id": 25, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 }, { "id": 26, - "job_id": 71, - "_dependencies_": { - } + "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json index f288927..fd90ec4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json @@ -3,33 +3,23 @@ "data": [ { "id": 27, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 28, - "job_id": 76, - "_dependencies_": { - } + "job_id": 76 }, { "id": 29, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 30, - "job_id": 81, - "_dependencies_": { - } + "job_id": 81 }, { "id": 31, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json index 9bd6198..f922173 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json @@ -3,33 +3,23 @@ "data": [ { "id": 32, - "job_id": 86, - "_dependencies_": { - } + "job_id": 86 }, { "id": 49, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 50, - "job_id": 141, - "_dependencies_": { - } + "job_id": 141 }, { "id": 51, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 }, { "id": 52, - "job_id": 149, - "_dependencies_": { - } + "job_id": 149 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json index afeb7f3..091c4ca 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json @@ -3,33 +3,23 @@ "data": [ { "id": 53, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 54, - "job_id": 154, - "_dependencies_": { - } + "job_id": 154 }, { "id": 55, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 }, { "id": 56, - "job_id": 159, - "_dependencies_": { - } + "job_id": 159 }, { "id": 89, - "job_id": 264, - "_dependencies_": { - } + "job_id": 264 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json index ebfff7c..f37a5eb 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json @@ -3,33 +3,23 @@ "data": [ { "id": 90, - "job_id": 264, - "_dependencies_": { - } + "job_id": 264 }, { "id": 91, - "job_id": 269, - "_dependencies_": { - } + "job_id": 269 }, { "id": 92, - "job_id": 269, - "_dependencies_": { - } + "job_id": 269 }, { "id": 93, - "job_id": 271, - "_dependencies_": { - } + "job_id": 271 }, { "id": 94, - "job_id": 271, - "_dependencies_": { - } + "job_id": 271 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json index d1f41b5..561e83f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json @@ -26,49 +26,7 @@ "settings": null, "next_build_number": null, "invalidated_at": null, - "current_build_id": 210, - "_dependencies_": { - "build": [ - 1, - 50 - ], - "request": [ - 11, - 12 - ], - "job": [ - 56, - 57 - ], - "branch": [ - 86, - 91 - ], - "ssl_key": [ - 33, - 34 - ], - "commit": [ - 219, - 220 - ], - "permission": [ - 5, - 6 - ], - "star": [ - 5, - 6 - ], - "pull_request": [ - 3, - 6 - ], - "tag": [ - 33, - 38 - ] - } + "current_build_id": 210 }, { "id": 66, @@ -95,9 +53,7 @@ "settings": null, "next_build_number": null, "invalidated_at": null, - "current_build_id": null, - "_dependencies_": { - } + "current_build_id": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json index f86ee7e..e3f96d6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 9, - 10 - ], - "message": [ - 9, - 10 - ], - "job": [ - 54, - 55 - ], - "build": [ - 51, - 53 - ] - } + "sender_type": null }, { "id": 12, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 13, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 11, - 12 - ], - "message": [ - 11, - 12 - ], - "job": [ - 71, - 72 - ], - "build": [ - 68, - 70 - ] - } + "sender_type": null }, { "id": 14, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 15, @@ -179,25 +139,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 13, - 14 - ], - "message": [ - 13, - 14 - ], - "job": [ - 76, - 77 - ], - "build": [ - 73, - 75 - ] - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json index d3d8706..5d63adb 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json @@ -27,9 +27,7 @@ "branch_id": 86, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 17, @@ -57,25 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 15, - 16 - ], - "message": [ - 15, - 16 - ], - "job": [ - 86, - 87 - ], - "build": [ - 83, - 85 - ] - } + "sender_type": null }, { "id": 18, @@ -103,9 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 29, @@ -133,25 +111,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 25, - 26 - ], - "message": [ - 25, - 26 - ], - "job": [ - 141, - 142 - ], - "build": [ - 138, - 140 - ] - } + "sender_type": null }, { "id": 30, @@ -179,9 +139,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json index 5e8770b..90d1e1e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json @@ -27,25 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 27, - 28 - ], - "message": [ - 27, - 28 - ], - "job": [ - 154, - 155 - ], - "build": [ - 151, - 153 - ] - } + "sender_type": null }, { "id": 32, @@ -73,9 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 33, @@ -103,25 +83,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 29, - 30 - ], - "message": [ - 29, - 30 - ], - "job": [ - 159, - 160 - ], - "build": [ - 156, - 158 - ] - } + "sender_type": null }, { "id": 34, @@ -149,9 +111,7 @@ "branch_id": null, "tag_id": 33, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null }, { "id": 55, @@ -179,25 +139,7 @@ "branch_id": null, "tag_id": null, "sender_id": 9, - "sender_type": "User", - "_dependencies_": { - "abuse": [ - 47, - 48 - ], - "message": [ - 47, - 48 - ], - "job": [ - 264, - 265 - ], - "build": [ - 261, - 263 - ] - } + "sender_type": "User" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json index 42a1cb0..4e24321 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json @@ -27,9 +27,7 @@ "branch_id": null, "tag_id": null, "sender_id": 9, - "sender_type": "User", - "_dependencies_": { - } + "sender_type": "User" }, { "id": 57, @@ -57,25 +55,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - "abuse": [ - 49, - 50 - ], - "message": [ - 49, - 50 - ], - "job": [ - 269, - 270 - ], - "build": [ - 266, - 268 - ] - } + "sender_type": null }, { "id": 58, @@ -103,9 +83,7 @@ "branch_id": null, "tag_id": null, "sender_id": null, - "sender_type": null, - "_dependencies_": { - } + "sender_type": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json index 857dcec..f6c78fd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json @@ -7,9 +7,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 34, @@ -17,9 +15,7 @@ "public_key": null, "private_key": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json index a412d2f..e794dad 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json @@ -6,36 +6,28 @@ "repository_id": null, "user_id": 9, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 2, "repository_id": null, "user_id": 9, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 5, "repository_id": 1, "user_id": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 6, "repository_id": 1, "user_id": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json index a33f74b..37dc6cf 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json @@ -31,13 +31,7 @@ "canceled_by_id": null, "status": null, "source": "unknown", - "concurrency": null, - "_dependencies_": { - "invoice": [ - 1, - 2 - ] - } + "concurrency": null }, { "id": 2, @@ -69,13 +63,7 @@ "canceled_by_id": null, "status": null, "source": "unknown", - "concurrency": null, - "_dependencies_": { - "invoice": [ - 3, - 4 - ] - } + "concurrency": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json index 17b6435..dbf611e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json @@ -8,21 +8,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - "build": [ - 143, - 145 - ], - "commit": [ - 227, - 228 - ], - "request": [ - 33, - 34 - ] - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 38, @@ -31,9 +17,7 @@ "last_build_id": null, "exists_on_github": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json index ccf57cd..00c49b1 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json @@ -6,18 +6,14 @@ "user_id": 9, "token": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 10, "user_id": 9, "token": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json index 9666d2e..f52f9a4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json @@ -10,13 +10,7 @@ ], "status": "new", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - "trial_allowance": [ - 1, - 2 - ] - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 2, @@ -27,13 +21,7 @@ ], "status": "new", "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - "trial_allowance": [ - 3, - 4 - ] - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json index 59cb67d..9043ec6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json @@ -9,9 +9,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 2, @@ -21,9 +19,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 3, @@ -33,9 +29,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 4, @@ -45,9 +39,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" }, { "id": 5, @@ -57,9 +49,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json index 0239be6..eede241 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json @@ -9,9 +9,7 @@ "builds_allowed": null, "builds_remaining": null, "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "_dependencies_": { - } + "updated_at": "2021-03-12 10:46:10 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json index a161836..bcc2b6f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json +++ b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json @@ -20,77 +20,7 @@ "first_logged_in_at": null, "avatar_url": null, "suspended": false, - "suspended_at": null, - "_dependencies_": { - "build": [ - 161, - 210, - 211, - 260 - ], - "repository": [ - 1, - 66 - ], - "job": [ - 271, - 272 - ], - "request": [ - 57, - 58, - 55, - 56 - ], - "abuse": [ - 51, - 52 - ], - "subscription": [ - 1, - 2 - ], - "owner_group": [ - 1, - 2 - ], - "trial": [ - 1, - 2 - ], - "trial_allowance": [ - 5, - 6 - ], - "broadcast": [ - 1, - 2 - ], - "star": [ - 1, - 2 - ], - "permission": [ - 1, - 2 - ], - "token": [ - 9, - 10 - ], - "email": [ - 9, - 10 - ], - "membership": [ - 1, - 2 - ], - "user_beta_feature": [ - 1, - 2 - ] - } + "suspended_at": null } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json index 8db628b..f137909 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/user_beta_feature_1-2.json @@ -7,9 +7,7 @@ "beta_feature_id": null, "enabled": null, "last_deactivated_at": null, - "last_activated_at": null, - "_dependencies_": { - } + "last_activated_at": null }, { "id": 2, @@ -17,9 +15,7 @@ "beta_feature_id": null, "enabled": null, "last_deactivated_at": null, - "last_activated_at": null, - "_dependencies_": { - } + "last_activated_at": null } ] } \ No newline at end of file From 9698c76b7c41434a45d8f1823db0349df8d4bf5a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 22 Oct 2021 15:30:07 +0200 Subject: [PATCH 49/88] loading tested with cooperation with removing, bugs fixed --- lib/backup/load_from_files.rb | 36 +++- lib/ids_of_all_dependencies.rb | 2 +- lib/model.rb | 8 +- spec/backup/load_from_files_spec.rb | 82 ++++++++- spec/backup/remove_specified_spec.rb | 13 +- spec/support/expected_files_provider.rb | 228 ------------------------ 6 files changed, 123 insertions(+), 246 deletions(-) delete mode 100644 spec/support/expected_files_provider.rb diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index 18cc6b9..9fcc7f6 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -53,8 +53,6 @@ def run def set_id_sequences @touched_models.each do |model| - next if [Build, Job].include?(model) - value = model.last.id + 1 seq = model.table_name + '_id_seq' set_sequence(seq, value) @@ -93,17 +91,39 @@ def cancel_offset_for_foreign_data end def load_data_with_offsets + @repository_files = [] + @loaded_entries = files.map do |data_file| model = Model.get_model_by_table_name(data_file.table_name) - @touched_models << model - data_file.data_hash.map do |entry_hash| - entry_hash.symbolize_keys! - entry_hash[:id] += @id_offsets[data_file.table_name.to_sym] - add_offset_to_foreign_keys!(model, entry_hash) - model.create(entry_hash) + if model == Repository + @repository_files << data_file + next end + + load_file(model, data_file) + end.flatten.compact + + repository_entries = @repository_files.map do |data_file| + load_file(Repository, data_file) end.flatten + + @loaded_entries.concat(repository_entries) + end + + def load_file(model, data_file) + @touched_models << model + + data_file.data_hash.map do |entry_hash| + load_entry(model, entry_hash) + end + end + + def load_entry(model, entry_hash) + entry_hash.symbolize_keys! + entry_hash[:id] += @id_offsets[model.table_name.to_sym] + add_offset_to_foreign_keys!(model, entry_hash) + model.create(entry_hash) end def add_offset_to_foreign_keys!(model, entry_hash) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index a421c5b..192a619 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -80,7 +80,7 @@ def ids_of_all_dependencies_without_reflection(to_filter) def move_wrongly_assigned_to_main(to_filter, id_hash) id_hash[:filtered_out].each do |model_symbol, array| - array.each do |id| + array.clone.each do |id| object = Model.get_model(model_symbol).find(id) move_object_to_main_if_necessary(to_filter[model_symbol], id_hash, object) end diff --git a/lib/model.rb b/lib/model.rb index b2944d4..b8f97af 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -21,7 +21,13 @@ def self.get_model_by_table_name(name) self.subclasses.find{ |m| m.table_name == name.to_s } end - def self.get_sum_of_rows_of_all_models + def self.get_ids_of_entries_of_all_subclasses + self.subclasses.map do |subclass| + [subclass.name, subclass.all.map(&:id)] if subclass.any? + end.compact.to_h + end + + def self.get_sum_of_rows_of_all_subclasses self.subclasses.map do |subclass| subclass.all.size end.reduce(:+) diff --git a/spec/backup/load_from_files_spec.rb b/spec/backup/load_from_files_spec.rb index a2cac8a..5be6787 100644 --- a/spec/backup/load_from_files_spec.rb +++ b/spec/backup/load_from_files_spec.rb @@ -6,7 +6,6 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files_provider' require 'support/before_tests' require 'support/utils' require 'pry' @@ -80,6 +79,87 @@ end context 'when old data is present in db' do + context 'when it cooperates with removing method in dumping and reloading' do + context 'when it cooperates with remove_heavy_data_for_repo' do + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } + let!(:other_data) { + FactoryBot.rewind_sequences + + db_helper.do_without_triggers do + FactoryBot.create_list( + :user_with_all_dependencies, 2, + created_at: datetime, + updated_at: datetime + ) + end + } + let!(:user) { + db_helper.do_without_triggers do + FactoryBot.create( + :user_with_all_dependencies, + created_at: datetime, + updated_at: datetime + ) + end + } + + it 'reloads data properly' do + time_for_folder = Time.now.to_s.parameterize.underscore + config.files_location = "dump/tests/load_files/#{time_for_folder}_1" + remove_specified.remove_user_with_dependencies(user.id) + load_from_files.run + loaded_user = User.last + expected_data = loaded_user.ids_of_all_dependencies_nested + config.files_location = "dump/tests/load_files/#{time_for_folder}_2" + remove_specified.remove_user_with_dependencies(loaded_user.id) + load_from_files = Backup::LoadFromFiles.new(config, DryRunReporter.new) + load_from_files.run + + expect(User.last.ids_of_all_dependencies_nested).to eql(expected_data) + end + end + + context 'when it cooperates with repository_for_removing_heavy_data' do + let!(:remove_specified) { Backup::RemoveSpecified.new(config, DryRunReporter.new) } + let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } + let!(:other_data) { + FactoryBot.rewind_sequences + + db_helper.do_without_triggers do + FactoryBot.create_list( + :user_with_all_dependencies, 2, + created_at: datetime, + updated_at: datetime + ) + end + } + let!(:repository) { + db_helper.do_without_triggers do + FactoryBot.create( + :repository_for_removing_heavy_data, + created_at: datetime, + updated_at: datetime + ) + end + } + + it 'reloads data properly' do + time_for_folder = Time.now.to_s.parameterize.underscore + config.files_location = "dump/tests/load_files/#{time_for_folder}_1" + remove_specified.remove_heavy_data_for_repo(repository) + load_from_files.run + expected_data = repository.ids_of_all_dependencies_nested(6) + config.files_location = "dump/tests/load_files/#{time_for_folder}_2" + remove_specified.remove_heavy_data_for_repo(repository) + load_from_files = Backup::LoadFromFiles.new(config, DryRunReporter.new) + load_from_files.run + + expect(repository.ids_of_all_dependencies_nested(6)).to eql(expected_data) + end + end + end + context 'when the problem with associated data in db occurs' do before do config.files_location = "spec/support/expected_files/associated_db_data_problem" diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 5544f9f..adb1ef4 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -6,7 +6,6 @@ require 'models/organization' require 'models/user' require 'support/factories' -require 'support/expected_files_provider' require 'support/before_tests' require 'support/utils' require 'pry' @@ -15,7 +14,7 @@ describe Backup::RemoveSpecified do def db_summary_hash { - all: Model.get_sum_of_rows_of_all_models, + all: Model.get_sum_of_rows_of_all_subclasses, logs: Log.all.size, jobs: Job.all.size, builds: Build.all.size, @@ -164,7 +163,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_builds(repository) - }.not_to change { Model.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_subclasses } end end end @@ -265,7 +264,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_requests(repository) - }.not_to change { Model.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_subclasses } end end end @@ -355,7 +354,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.not_to change { Model.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_subclasses } end end end @@ -444,7 +443,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.not_to change { Model.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_subclasses } end end end @@ -533,7 +532,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.not_to change { Model.get_sum_of_rows_of_all_models } + }.not_to change { Model.get_sum_of_rows_of_all_subclasses } end end end diff --git a/spec/support/expected_files_provider.rb b/spec/support/expected_files_provider.rb deleted file mode 100644 index efbced2..0000000 --- a/spec/support/expected_files_provider.rb +++ /dev/null @@ -1,228 +0,0 @@ -class ExpectedFilesProvider - def initialize(repository, datetime) - @repository = repository - @datetime = datetime - end - - def builds_json - [ - { - "id": @repository.builds.first.id, - "repository_id": @repository.id, - "number": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "config": nil, - "commit_id": nil, - "request_id": nil, - "state": nil, - "duration": nil, - "owner_id": nil, - "owner_type": nil, - "event_type": nil, - "previous_state": nil, - "pull_request_title": nil, - "pull_request_number": nil, - "branch": nil, - "canceled_at": nil, - "cached_matrix_ids": nil, - "received_at": nil, - "private": nil, - "pull_request_id": nil, - "branch_id": nil, - "tag_id": nil, - "sender_id": nil, - "sender_type": nil - }, - { - "id": @repository.builds.second.id, - "repository_id": @repository.id, - "number": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "config": nil, - "commit_id": nil, - "request_id": nil, - "state": nil, - "duration": nil, - "owner_id": nil, - "owner_type": nil, - "event_type": nil, - "previous_state": nil, - "pull_request_title": nil, - "pull_request_number": nil, - "branch": nil, - "canceled_at": nil, - "cached_matrix_ids": nil, - "received_at": nil, - "private": nil, - "pull_request_id": nil, - "branch_id": nil, - "tag_id": nil, - "sender_id": nil, - "sender_type": nil, - } - ] - end - - def jobs_json(build) - [ - { - "id": build.jobs.first.id, - "repository_id": @repository.id, - "commit_id": nil, - "source_id": build.id, - "source_type": "Build", - "queue": nil, - "type": nil, - "state": nil, - "number": nil, - "config": nil, - "worker": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "tags": nil, - "allow_failure": false, - "owner_id": nil, - "owner_type": nil, - "result": nil, - "queued_at": nil, - "canceled_at": nil, - "received_at": nil, - "debug_options": nil, - "private": nil, - "stage_number": nil, - "stage_id": nil, - }, - { - "id": build.jobs.second.id, - "repository_id": @repository.id, - "commit_id": nil, - "source_id": build.id, - "source_type": "Build", - "queue": nil, - "type": nil, - "state": nil, - "number": nil, - "config": nil, - "worker": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "tags": nil, - "allow_failure": false, - "owner_id": nil, - "owner_type": nil, - "result": nil, - "queued_at": nil, - "canceled_at": nil, - "received_at": nil, - "debug_options": nil, - "private": nil, - "stage_number": nil, - "stage_id": nil, - } - ] - end - - def logs_json(job) - [ - { - "id": job.logs.first.id, - "job_id": job.id, - "content": "some log content", - "removed_by": nil, - "created_at": @datetime, - "updated_at": @datetime, - "aggregated_at": nil, - "archived_at": nil, - "purged_at": nil, - "removed_at": nil, - "archiving": false, - "archive_verified": true - }, - { - "id": job.logs.second.id, - "job_id": job.id, - "content": "some log content", - "removed_by": nil, - "created_at": @datetime, - "updated_at": @datetime, - "aggregated_at": nil, - "archived_at": nil, - "purged_at": nil, - "removed_at": nil, - "archiving": false, - "archive_verified": true - } - ] - end - - def requests_json - [ - { - "id": @repository.requests.first.id, - "repository_id": @repository.id, - "commit_id": nil, - "state": nil, - "source": nil, - "payload": nil, - "token": nil, - "config": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "event_type": nil, - "comments_url": nil, - "base_commit": nil, - "head_commit": nil, - "owner_id": nil, - "owner_type": nil, - "result": nil, - "message": nil, - "private": nil, - "pull_request_id": nil, - "branch_id": nil, - "tag_id": nil, - "sender_id": nil, - "sender_type": nil - }, - { - "id": @repository.requests.second.id, - "repository_id": @repository.id, - "commit_id": nil, - "state": nil, - "source": nil, - "payload": nil, - "token": nil, - "config": nil, - "started_at": nil, - "finished_at": nil, - "created_at": @datetime, - "updated_at": @datetime, - "event_type": nil, - "comments_url": nil, - "base_commit": nil, - "head_commit": nil, - "owner_id": nil, - "owner_type": nil, - "result": nil, - "message": nil, - "private": nil, - "pull_request_id": nil, - "branch_id": nil, - "tag_id": nil, - "sender_id": nil, - "sender_type": nil - } - ] - end -end From 177c8f9e7e38db84b4eba859c8656dd5a14fd670 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 25 Oct 2021 09:39:09 +0200 Subject: [PATCH 50/88] fix --- spec/model_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/model_spec.rb b/spec/model_spec.rb index c990f7e..716f4cc 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -1,5 +1,5 @@ $: << 'lib' -require './model' +require 'model' require 'travis-backup' require 'support/factories' require 'support/before_tests' From 6e8b9dcc5eea259fe0e5efecd62b2c34bc9042f0 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 25 Oct 2021 11:31:34 +0200 Subject: [PATCH 51/88] fix --- lib/ids_of_all_dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 192a619..ba0c183 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -34,7 +34,7 @@ def get_associations(depth) next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - self.send(association.name).map do |associated_object| + self.send(association.name).sort_by(&:id).map do |associated_object| result[symbol] = [] if result[symbol].nil? result[symbol] << associated_object.ids_of_all_dependencies_nested(depth - 1) end From 49c5408c2c1782ffddaa0bc85c97152a452e8ad7 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 25 Oct 2021 11:36:52 +0200 Subject: [PATCH 52/88] wip --- spec/support/before_tests.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/before_tests.rb b/spec/support/before_tests.rb index d3fb128..9481ef4 100644 --- a/spec/support/before_tests.rb +++ b/spec/support/before_tests.rb @@ -1,7 +1,9 @@ class BeforeTests def run config = Config.new - system("psql '#{config.database_url}' -f db/schema.sql > /dev/null 2> /dev/null") + puts '-------------------' + system("psql '#{config.database_url}' -f db/schema.sql") + puts '-------------------' if config.destination_db_url system("psql '#{config.destination_db_url}' -f db/schema.sql > /dev/null 2> /dev/null") end From 07391e22599d220690fa641a9b7e186597bb98f7 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 25 Oct 2021 16:07:35 +0200 Subject: [PATCH 53/88] fix --- spec/support/before_tests.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/support/before_tests.rb b/spec/support/before_tests.rb index 9481ef4..26f8f5f 100644 --- a/spec/support/before_tests.rb +++ b/spec/support/before_tests.rb @@ -1,13 +1,17 @@ class BeforeTests def run config = Config.new - puts '-------------------' - system("psql '#{config.database_url}' -f db/schema.sql") - puts '-------------------' - if config.destination_db_url - system("psql '#{config.destination_db_url}' -f db/schema.sql > /dev/null 2> /dev/null") + helper = DbHelper.new(config) + truncate_all_tables + helper.do_in_other_db(config.destination_db_url) do + truncate_all_tables end end + + def truncate_all_tables + sql = File.read('db/schema.sql') + ActiveRecord::Base.connection.execute(sql) + end end ARGV = ['-t', '6'] From 0bed840878c8a426d09f59d2e99320fb89db3cdf Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 25 Oct 2021 17:23:32 +0200 Subject: [PATCH 54/88] fix --- lib/id_hash.rb | 6 ++++++ lib/ids_of_all_dependencies.rb | 6 ++++-- spec/model_spec.rb | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/id_hash.rb b/lib/id_hash.rb index cabdac2..3e8cd47 100644 --- a/lib/id_hash.rb +++ b/lib/id_hash.rb @@ -43,6 +43,12 @@ def join(*hashes) end self end + + def sort_arrays! + self.each do |key, array| + array.sort! + end + end end class IdHash < HashOfArrays diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index ba0c183..10d8462 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -54,8 +54,10 @@ def ids_of_all_dependencies(to_filter=nil) def ids_of_all_dependencies_with_filtered(to_filter=nil) id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) - return id_hash unless to_filter - move_wrongly_assigned_to_main(to_filter, id_hash) + move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter + id_hash[:main].sort_arrays! + id_hash[:filtered_out].sort_arrays! + id_hash end def ids_of_all_dependencies_without_reflection(to_filter) diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 716f4cc..6c4bb75 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -31,11 +31,11 @@ annotation: [1, 2, 3, 4], branch: [73, 74], build: [1, 3, 6, 8], - job: [2, 4, 5, 9, 10, 7], + job: [2, 4, 5, 7, 9, 10], log: [1, 2, 3, 4], message: [1, 2], queueable_job: [1, 2, 3, 4], - repository: [2, 1, 4, 3], + repository: [1, 2, 3, 4], request: [1, 2], stage: [20, 21], tag: [1, 2] @@ -57,7 +57,7 @@ job: [2, 4, 5], log: [1, 2], queueable_job: [1, 2], - repository: [2, 1], + repository: [1, 2], request: [2], stage: [20], tag: [1] From ecabe1da9e64e31dd501bd4c0d910292033e4c2f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 2 Nov 2021 11:56:03 +0100 Subject: [PATCH 55/88] checking db diff instead of db state in tests --- spec/backup/remove_specified_spec.rb | 304 +++++++++++++++------------ 1 file changed, 165 insertions(+), 139 deletions(-) diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index adb1ef4..30dc032 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -12,30 +12,6 @@ require 'byebug' describe Backup::RemoveSpecified do - def db_summary_hash - { - all: Model.get_sum_of_rows_of_all_subclasses, - logs: Log.all.size, - jobs: Job.all.size, - builds: Build.all.size, - requests: Request.all.size, - repositories: Repository.all.size, - branches: Branch.all.size, - tags: Tag.all.size, - commits: Commit.all.size, - crons: Cron.all.size, - pull_requests: PullRequest.all.size, - ssl_keys: SslKey.all.size, - stages: Stage.all.size, - stars: Star.all.size, - permissions: Permission.all.size, - messages: Message.all.size, - abuses: Abuse.all.size, - annotations: Annotation.all.size, - queueable_jobs: QueueableJob.all.size - } - end - def get_expected_files(directory, datetime) Dir["spec/support/expected_files/#{directory}/*.json"].map do |file_path| content = File.read(file_path) @@ -86,29 +62,39 @@ def get_expected_files(directory, datetime) shared_context 'removing builds with dependencies' do it 'removes builds with all its dependencies' do - remove_specified.remove_repo_builds(repository) - - expect(db_summary_hash).to eql( - all: 672, - logs: 60, - jobs: 108, - builds: 65, - requests: 34, - repositories: 65, - branches: 38, - tags: 38, - commits: 18, - crons: 6, - pull_requests: 6, - ssl_keys: 6, - stages: 36, - stars: 6, - permissions: 6, - messages: 30, - abuses: 30, - annotations: 60, - queueable_jobs: 60 - ) + expect { + remove_specified.remove_repo_builds(repository) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-16) + .and change { Log.all.size }.by(-2) + .and change { Job.all.size }.by(-6) + .and change { Build.all.size }.by(-2) + .and change { Request.all.size }.by(0) + .and change { Repository.all.size }.by(0) + .and change { Branch.all.size }.by(0) + .and change { Tag.all.size }.by(0) + .and change { Commit.all.size }.by(0) + .and change { Cron.all.size }.by(0) + .and change { PullRequest.all.size }.by(0) + .and change { SslKey.all.size }.by(0) + .and change { Stage.all.size }.by(-2) + .and change { Star.all.size }.by(0) + .and change { Permission.all.size }.by(0) + .and change { Message.all.size }.by(0) + .and change { Abuse.all.size }.by(0) + .and change { Annotation.all.size }.by(-2) + .and change { QueueableJob.all.size }.by(-2) + .and change { Email.all.size }.by(0) + .and change { Invoice.all.size }.by(0) + .and change { Membership.all.size }.by(0) + .and change { Organization.all.size }.by(0) + .and change { OwnerGroup.all.size }.by(0) + .and change { Broadcast.all.size }.by(0) + .and change { Subscription.all.size }.by(0) + .and change { Token.all.size }.by(0) + .and change { TrialAllowance.all.size }.by(0) + .and change { Trial.all.size }.by(0) + .and change { UserBetaFeature.all.size }.by(0) + .and change { User.all.size }.by(0) end end @@ -187,29 +173,39 @@ def get_expected_files(directory, datetime) shared_context 'removing requests with dependencies' do it 'removes requests with all its dependencies' do - remove_specified.remove_repo_requests(repository) - - expect(db_summary_hash).to eql( - all: 628, - logs: 54, - jobs: 94, - builds: 63, - requests: 32, - repositories: 65, - branches: 38, - tags: 38, - commits: 18, - crons: 6, - pull_requests: 6, - ssl_keys: 6, - stages: 32, - stars: 6, - permissions: 6, - messages: 28, - abuses: 28, - annotations: 54, - queueable_jobs: 54 - ) + expect { + remove_specified.remove_repo_requests(repository) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-15) + .and change { Log.all.size }.by(-2) + .and change { Job.all.size }.by(-2) + .and change { Build.all.size }.by(-1) + .and change { Request.all.size }.by(-2) + .and change { Repository.all.size }.by(0) + .and change { Branch.all.size }.by(0) + .and change { Tag.all.size }.by(0) + .and change { Commit.all.size }.by(0) + .and change { Cron.all.size }.by(0) + .and change { PullRequest.all.size }.by(0) + .and change { SslKey.all.size }.by(0) + .and change { Stage.all.size }.by(0) + .and change { Star.all.size }.by(0) + .and change { Permission.all.size }.by(0) + .and change { Message.all.size }.by(-2) + .and change { Abuse.all.size }.by(-2) + .and change { Annotation.all.size }.by(-2) + .and change { QueueableJob.all.size }.by(-2) + .and change { Email.all.size }.by(0) + .and change { Invoice.all.size }.by(0) + .and change { Membership.all.size }.by(0) + .and change { Organization.all.size }.by(0) + .and change { OwnerGroup.all.size }.by(0) + .and change { Broadcast.all.size }.by(0) + .and change { Subscription.all.size }.by(0) + .and change { Token.all.size }.by(0) + .and change { TrialAllowance.all.size }.by(0) + .and change { Trial.all.size }.by(0) + .and change { UserBetaFeature.all.size }.by(0) + .and change { User.all.size }.by(0) end end @@ -295,29 +291,39 @@ def get_expected_files(directory, datetime) shared_context 'removing user with dependencies' do it 'removes user with all his dependencies with proper exceptions' do - remove_specified.remove_user_with_dependencies(user.id) - - expect(db_summary_hash).to eql( - all: 870, - logs: 64, - jobs: 134, - builds: 90, - requests: 40, - repositories: 108, - branches: 62, - tags: 62, - commits: 24, - crons: 8, - pull_requests: 8, - ssl_keys: 8, - stages: 54, - stars: 8, - permissions: 8, - messages: 32, - abuses: 32, - annotations: 64, - queueable_jobs: 64 - ) + expect { + remove_specified.remove_user_with_dependencies(user.id) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-247) + .and change { Log.all.size }.by(-30) + .and change { Job.all.size }.by(-30) + .and change { Build.all.size }.by(-18) + .and change { Request.all.size }.by(-18) + .and change { Repository.all.size }.by(-2) + .and change { Branch.all.size }.by(-2) + .and change { Tag.all.size }.by(-2) + .and change { Commit.all.size }.by(-6) + .and change { Cron.all.size }.by(-2) + .and change { PullRequest.all.size }.by(-2) + .and change { SslKey.all.size }.by(-2) + .and change { Stage.all.size }.by(0) + .and change { Star.all.size }.by(-4) + .and change { Permission.all.size }.by(-4) + .and change { Message.all.size }.by(-18) + .and change { Abuse.all.size }.by(-20) + .and change { Annotation.all.size }.by(-30) + .and change { QueueableJob.all.size }.by(-30) + .and change { Email.all.size }.by(-2) + .and change { Invoice.all.size }.by(-4) + .and change { Membership.all.size }.by(-2) + .and change { Organization.all.size }.by(0) + .and change { OwnerGroup.all.size }.by(-2) + .and change { Broadcast.all.size }.by(-2) + .and change { Subscription.all.size }.by(-2) + .and change { Token.all.size }.by(-2) + .and change { TrialAllowance.all.size }.by(-6) + .and change { Trial.all.size }.by(-2) + .and change { UserBetaFeature.all.size }.by(-2) + .and change { User.all.size }.by(-1) end end @@ -385,29 +391,39 @@ def get_expected_files(directory, datetime) shared_context 'removing organization with dependencies' do it 'removes organization with all its dependencies with proper exceptions' do - remove_specified.remove_org_with_dependencies(organization.id) - - expect(db_summary_hash).to eql( - all: 870, - logs: 64, - jobs: 134, - builds: 90, - requests: 40, - repositories: 108, - branches: 62, - tags: 62, - commits: 24, - crons: 8, - pull_requests: 8, - ssl_keys: 8, - stages: 54, - stars: 8, - permissions: 8, - messages: 32, - abuses: 32, - annotations: 64, - queueable_jobs: 64 - ) + expect { + remove_specified.remove_org_with_dependencies(organization.id) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-237) + .and change { Log.all.size }.by(-30) + .and change { Job.all.size }.by(-30) + .and change { Build.all.size }.by(-18) + .and change { Request.all.size }.by(-18) + .and change { Repository.all.size }.by(-2) + .and change { Branch.all.size }.by(-2) + .and change { Tag.all.size }.by(-2) + .and change { Commit.all.size }.by(-6) + .and change { Cron.all.size }.by(-2) + .and change { PullRequest.all.size }.by(-2) + .and change { SslKey.all.size }.by(-2) + .and change { Stage.all.size }.by(0) + .and change { Star.all.size }.by(-2) + .and change { Permission.all.size }.by(-2) + .and change { Message.all.size }.by(-18) + .and change { Abuse.all.size }.by(-20) + .and change { Annotation.all.size }.by(-30) + .and change { QueueableJob.all.size }.by(-30) + .and change { Email.all.size }.by(0) + .and change { Invoice.all.size }.by(-4) + .and change { Membership.all.size }.by(-2) + .and change { Organization.all.size }.by(-1) + .and change { OwnerGroup.all.size }.by(-2) + .and change { Broadcast.all.size }.by(-2) + .and change { Subscription.all.size }.by(-2) + .and change { Token.all.size }.by(0) + .and change { TrialAllowance.all.size }.by(-6) + .and change { Trial.all.size }.by(-2) + .and change { UserBetaFeature.all.size }.by(0) + .and change { User.all.size }.by(0) end end @@ -474,29 +490,39 @@ def get_expected_files(directory, datetime) shared_context 'removing repository with dependencies' do it 'removes repository with all its dependencies with proper exceptions' do - remove_specified.remove_repo_with_dependencies(repository.id) - - expect(db_summary_hash).to eql( - all: 470, - logs: 32, - jobs: 72, - builds: 50, - requests: 20, - repositories: 64, - branches: 36, - tags: 36, - commits: 12, - crons: 4, - pull_requests: 4, - ssl_keys: 4, - stages: 32, - stars: 4, - permissions: 4, - messages: 16, - abuses: 16, - annotations: 32, - queueable_jobs: 32 - ) + expect { + remove_specified.remove_repo_with_dependencies(repository.id) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-173) + .and change { Log.all.size }.by(-24) + .and change { Job.all.size }.by(-24) + .and change { Build.all.size }.by(-14) + .and change { Request.all.size }.by(-14) + .and change { Repository.all.size }.by(-1) + .and change { Branch.all.size }.by(-2) + .and change { Tag.all.size }.by(-2) + .and change { Commit.all.size }.by(-6) + .and change { Cron.all.size }.by(-2) + .and change { PullRequest.all.size }.by(-2) + .and change { SslKey.all.size }.by(-2) + .and change { Stage.all.size }.by(0) + .and change { Star.all.size }.by(-2) + .and change { Permission.all.size }.by(-2) + .and change { Message.all.size }.by(-14) + .and change { Abuse.all.size }.by(-14) + .and change { Annotation.all.size }.by(-24) + .and change { QueueableJob.all.size }.by(-24) + .and change { Email.all.size }.by(0) + .and change { Invoice.all.size }.by(0) + .and change { Membership.all.size }.by(0) + .and change { Organization.all.size }.by(0) + .and change { OwnerGroup.all.size }.by(0) + .and change { Broadcast.all.size }.by(0) + .and change { Subscription.all.size }.by(0) + .and change { Token.all.size }.by(0) + .and change { TrialAllowance.all.size }.by(0) + .and change { Trial.all.size }.by(0) + .and change { UserBetaFeature.all.size }.by(0) + .and change { User.all.size }.by(0) end end From fea3c3b8669dacba51cf7ed51c7a2be41d9a9978 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 3 Nov 2021 17:28:20 +0100 Subject: [PATCH 56/88] nullifying builds dependencies instead of removing them in remove orphans --- lib/backup/remove_orphans.rb | 81 +++++++++++++------ .../remove_specified/remove_heavy_data.rb | 2 +- lib/id_hash.rb | 11 +++ spec/backup/remove_orphans_spec.rb | 11 +-- spec/backup_spec.rb | 8 +- 5 files changed, 75 insertions(+), 38 deletions(-) diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index c0c5d78..4a527f6 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -7,6 +7,7 @@ class RemoveOrphans def initialize(config, dry_run_reporter=nil) @config = config @dry_run_reporter = dry_run_reporter + @ids_to_remove = IdHash.new end def dry_run_report @@ -14,14 +15,59 @@ def dry_run_report end def run + find_orphans + + if @config.dry_run + @dry_run_reporter.add_to_report(@ids_to_remove.with_table_symbols) + else + nullify_builds_dependencies + @ids_to_remove.remove_entries_from_db + end + end + + def nullify_builds_dependencies + @ids_to_remove[:build].each do |build_id| + build = Build.find(build_id) + + dependencies_to_nullify.each do |symbol_set| + dependencies = build.send(symbol_set[:reverted_symbol]) # e.g. build.tags_for_that_this_build_is_last + + dependencies.each do |entry| + fk = symbol_set[:foreign_key] + entry.update(fk => nil) # e.g. tag.update(last_build_id: nil) + end + end + end + end + + def dependencies_to_nullify + [ + { + reverted_symbol: :repos_for_that_this_build_is_current, + foreign_key: :current_build_id + }, + { + reverted_symbol: :repos_for_that_this_build_is_last, + foreign_key: :last_build_id + }, + { + reverted_symbol: :tags_for_that_this_build_is_last, + foreign_key: :last_build_id + }, + { + reverted_symbol: :branches_for_that_this_build_is_last, + foreign_key: :last_build_id + } + ] + end + + def find_orphans cases.each do |model_block| model_block[:relations].each do |relation| - process_table( + check_model( main_model: model_block[:main_model], related_model: relation[:related_model], fk_name: relation[:fk_name], - method: model_block[:method], - dry_run_complement: model_block[:dry_run_complement] ) end end @@ -44,9 +90,7 @@ def cases {related_model: PullRequest, fk_name: 'pull_request_id'}, {related_model: Branch, fk_name: 'branch_id'}, {related_model: Tag, fk_name: 'tag_id'} - ], - method: :destroy_all, - dry_run_complement: -> (ids) { add_builds_dependencies_to_dry_run_report(ids) } + ] }, { main_model: Job, relations: [ @@ -104,20 +148,11 @@ def cases } ] end - - def add_builds_dependencies_to_dry_run_report(ids_for_delete) - repos_for_delete = Repository.where(current_build_id: ids_for_delete) - jobs_for_delete = Job.where(source_id: ids_for_delete) - @dry_run_reporter.add_to_report(:repositories, *repos_for_delete.map(&:id)) - @dry_run_reporter.add_to_report(:jobs, *jobs_for_delete.map(&:id)) - end - - def process_table(args) + + def check_model(args) main_model = args[:main_model] related_model = args[:related_model] fk_name = args[:fk_name] - method = args[:method] || :delete_all - dry_run_complement = args[:dry_run_complement] main_table = main_model.table_name related_table = related_model.table_name @@ -132,15 +167,9 @@ def process_table(args) and b.id is null; }) - ids_for_delete = for_delete.map(&:id) - - if config.dry_run - key = main_table.to_sym - @dry_run_reporter.add_to_report(key, *ids_for_delete) - dry_run_complement.call(ids_for_delete) if dry_run_complement - else - main_model.where(id: ids_for_delete).send(method) - end + key = main_model.name.underscore.to_sym + ids = for_delete.map(&:id) + @ids_to_remove.add(key, *ids) end end end diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index b031755..f149da5 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -48,7 +48,7 @@ def remove_repo_requests(repository) def process_ids_to_remove(ids_to_remove) if @config.dry_run - @dry_run_reporter.add_to_report(ids_to_remove) + @dry_run_reporter.add_to_report(ids_to_remove.with_table_symbols) else save_id_hash_to_file(ids_to_remove) if @config.if_backup ids_to_remove.remove_entries_from_db diff --git a/lib/id_hash.rb b/lib/id_hash.rb index 3e8cd47..bb8b197 100644 --- a/lib/id_hash.rb +++ b/lib/id_hash.rb @@ -69,6 +69,17 @@ def remove_entries_from_db(as_first: [], as_last: []) remove_from_exceptional(as_last) end + def with_table_symbols + result = HashOfArrays.new + + self.each do |name, ids| + symbol = Model.get_model(name).table_name.to_sym + result[symbol] = ids + end + + result + end + private def remove_from_exceptional(array) diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index cafdb83..426b154 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -9,6 +9,7 @@ require 'support/before_tests' require 'pry' require 'database_cleaner/active_record' +require 'byebug' describe Backup::RemoveOrphans do before(:all) do @@ -89,8 +90,8 @@ FactoryBot.create_list(:stage_with_build_id, 2) end } - it 'removes orphaned repositories (with these dependent on orphaned builds)' do - expect { remove_orphans.run }.to change { Repository.all.size }.by -16 + it 'removes orphaned repositories' do + expect { remove_orphans.run }.to change { Repository.all.size }.by -4 end it 'removes orphaned builds' do @@ -133,14 +134,10 @@ let!(:config) { Config.new(files_location: files_location, limit: 5, dry_run: true) } let!(:remove_orphans) { Backup::RemoveOrphans.new(config, DryRunReporter.new) } - before do - allow_any_instance_of(IO).to receive(:puts) - end - it 'prepares proper dry run report' do remove_orphans.run report = remove_orphans.dry_run_report - expect(report[:repositories].size).to eql 16 + expect(report[:repositories].size).to eql 4 expect(report[:builds].size).to eql 12 expect(report[:jobs].size).to eql 6 expect(report[:branches].size).to eql 4 diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index 1be337f..86d0d68 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -186,10 +186,10 @@ it 'prepares proper dry run report' do backup.run - expect(backup.dry_run_report[:build].size).to eql 24 - expect(backup.dry_run_report[:job].size).to eql 48 - expect(backup.dry_run_report[:log].size).to eql 96 - expect(backup.dry_run_report[:request].size).to eql 6 + expect(backup.dry_run_report[:builds].size).to eql 24 + expect(backup.dry_run_report[:jobs].size).to eql 48 + expect(backup.dry_run_report[:logs].size).to eql 96 + expect(backup.dry_run_report[:requests].size).to eql 6 end it 'prints dry run report' do From c7a9e38b78e8a460b39a019f97e4c063e4af8434 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 3 Nov 2021 20:06:29 +0100 Subject: [PATCH 57/88] nullifying dependencies as a part of model --- lib/backup/remove_orphans.rb | 31 +------------------------------ lib/model.rb | 3 ++- lib/models/build.rb | 9 +++++++++ lib/nullify_dependencies.rb | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 lib/nullify_dependencies.rb diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index 4a527f6..cbdb7a4 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -28,39 +28,10 @@ def run def nullify_builds_dependencies @ids_to_remove[:build].each do |build_id| build = Build.find(build_id) - - dependencies_to_nullify.each do |symbol_set| - dependencies = build.send(symbol_set[:reverted_symbol]) # e.g. build.tags_for_that_this_build_is_last - - dependencies.each do |entry| - fk = symbol_set[:foreign_key] - entry.update(fk => nil) # e.g. tag.update(last_build_id: nil) - end - end + build.nullify_default_dependencies end end - def dependencies_to_nullify - [ - { - reverted_symbol: :repos_for_that_this_build_is_current, - foreign_key: :current_build_id - }, - { - reverted_symbol: :repos_for_that_this_build_is_last, - foreign_key: :last_build_id - }, - { - reverted_symbol: :tags_for_that_this_build_is_last, - foreign_key: :last_build_id - }, - { - reverted_symbol: :branches_for_that_this_build_is_last, - foreign_key: :last_build_id - } - ] - end - def find_orphans cases.each do |model_block| model_block[:relations].each do |relation| diff --git a/lib/model.rb b/lib/model.rb index b8f97af..7fb3e52 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -2,10 +2,11 @@ require 'active_record' require 'ids_of_all_dependencies' +require 'nullify_dependencies' -# Model class class Model < ActiveRecord::Base include IdsOfAllDependencies + include NullifyDependencies self.abstract_class = true diff --git a/lib/models/build.rb b/lib/models/build.rb index 69b9775..005955d 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -22,4 +22,13 @@ class Build < Model has_many :stages self.table_name = 'builds' + + def default_dependencies_to_nullify + [ + :repos_for_that_this_build_is_current, + :repos_for_that_this_build_is_last, + :tags_for_that_this_build_is_last, + :branches_for_that_this_build_is_last + ] + end end diff --git a/lib/nullify_dependencies.rb b/lib/nullify_dependencies.rb new file mode 100644 index 0000000..a954b6f --- /dev/null +++ b/lib/nullify_dependencies.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module NullifyDependencies + def nullify_dependencies(dependencies_to_nullify) + dependencies_to_nullify.each do |symbol| + dependencies = self.send(symbol) # e.g. build.tags_for_that_this_build_is_last + + dependencies.each do |entry| + foreign_key = self.class.reflect_on_association(symbol).foreign_key.to_sym + entry.update(foreign_key => nil) # e.g. tag.update(last_build_id: nil) + end + end + end + + def nullify_default_dependencies + nullify_dependencies(default_dependencies_to_nullify) + end + + def default_dependencies_to_nullify + raise "default_dependencies_to_nullify not implemented in the #{self.class} class" + end +end \ No newline at end of file From 753262f609ac616b9d3e9339df914f1c9dac4638 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 12:31:39 +0100 Subject: [PATCH 58/88] orphans_table option in config --- README.md | 6 ++++-- lib/config.rb | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a9a99a..84180c0 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ All arguments: --move_logs # run in move logs mode - move all logs to database at destination_db_url URL --destination_db_url URL # URL for moving logs to --remove_orphans # run in remove orphans mode + --orphans_table # name of the table we will remove orphans from (if not defined, all tables are considered) --load_from_files # loads files stored in files_location to the database --id_gap # concerns file loading - the gap between the biggest id in database and the lowest one that will be set to loaded data (that's for data inserted by other users during the load being performed; equals 1000 by default) ``` @@ -62,7 +63,7 @@ backup.run(repo_id: 1) Using `--move_logs` flag you can move all logs to database at `destination_db_url` URL (which is required in this case). When you run gem in this mode no files are created and no other tables are being touched. -Using `--remove_orphans` flag you can remove all orphaned data from tables. When you run gem in this mode no files are created. +Using `--remove_orphans` flag you can remove all orphaned data from the tables. You can pick a specific table using `--orphans_table` flag or, by leaving it undefined, let all tables to be processed in the removing orphans procedure. When you run gem in this mode no files are created. Using `--user_id`, `--org_id` or `--repo_id` flag without setting `--threshold` results in removing the specified user/organization/repository with all its dependencies. It can be combined with `--backup` flag in order to save removed data in files. @@ -86,11 +87,12 @@ backup: repo_id: 1 # run only for given repository move_logs: false # run in move logs mode - move all logs to database at destination_db_url URL remove_orphans: false # run in remove orphans mode + orphans_table: 'builds' # name of the table we will remove orphans from (if not defined, all tables are considered) load_from_files: false # loads files stored in files_location to the database id_gap: 1500 # concerns file loading - the gap between the biggest id in database and the lowest one that will be set to loaded data (that's for data inserted by other users during the load being performed; equals 1000 by default) ``` -You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `BACKUP_USER_ID`, `BACKUP_ORG_ID`, `BACKUP_REPO_ID`, `BACKUP_MOVE_LOGS`, `BACKUP_REMOVE_ORPHANS`, `BACKUP_LOAD_FROM_FILES`, `BACKUP_ID_GAP`. +You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `BACKUP_USER_ID`, `BACKUP_ORG_ID`, `BACKUP_REPO_ID`, `BACKUP_MOVE_LOGS`, `BACKUP_REMOVE_ORPHANS`, `BACKUP_ORPHANS_TABLE`, `BACKUP_LOAD_FROM_FILES`, `BACKUP_ID_GAP`. You should also specify your database url. You can do this the standard way in `config/database.yml` file, setting the `database_url` hash argument while creating `Backup` instance or using the `DATABASE_URL` env var. Your database should be consistent with the Travis 2.2 database schema. diff --git a/lib/config.rb b/lib/config.rb index b149317..31b680c 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -13,6 +13,7 @@ class Config :org_id, :move_logs, :remove_orphans, + :orphans_table, :destination_db_url, :load_from_files, :id_gap @@ -98,6 +99,13 @@ def set_values(args) config.dig('backup', 'remove_orphans'), false ) + @orphans_table = first_not_nil( + args[:orphans_table], + argv_opts[:orphans_table], + ENV['BACKUP_ORPHANS_TABLE'], + config.dig('backup', 'orphans_table'), + false + ) @destination_db_url = first_not_nil( args[:destination_db_url], argv_opts[:destination_db_url], @@ -166,6 +174,7 @@ def argv_options opt.on('-o', '--org_id X') { |o| options[:org_id] = o.to_i } opt.on('--move_logs') { |o| options[:move_logs] = o } opt.on('--remove_orphans') { |o| options[:remove_orphans] = o } + opt.on('--orphans_table X') { |o| options[:orphans_table] = o } opt.on('--destination_db_url X') { |o| options[:destination_db_url] = o } opt.on('--load_from_files') { |o| options[:load_from_files] = o } opt.on('--id_gap X') { |o| options[:id_gap] = o.to_i } From 8fe769c81d1f877ee889047cc24b85c57760a72c Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 15:56:36 +0100 Subject: [PATCH 59/88] removing orphans from specified table works --- lib/backup/remove_orphans.rb | 113 ++++++++++++++++----------- lib/model.rb | 6 +- spec/backup/remove_orphans_spec.rb | 13 +++ spec/backup/remove_specified_spec.rb | 20 ++--- 4 files changed, 93 insertions(+), 59 deletions(-) diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index c0c5d78..f9d3d0b 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'byebug' + class Backup class RemoveOrphans attr_reader :config @@ -14,16 +16,71 @@ def dry_run_report end def run + if @config.orphans_table + run_for_specified(@config.orphans_table) + else + run_for_all + end + end + + def run_for_all cases.each do |model_block| - model_block[:relations].each do |relation| - process_table( - main_model: model_block[:main_model], - related_model: relation[:related_model], - fk_name: relation[:fk_name], - method: model_block[:method], - dry_run_complement: model_block[:dry_run_complement] - ) - end + process_model_block(model_block) + end + end + + def run_for_specified(table_name) + model_block = cases.find { |c| c[:main_model] == Model.get_model_by_table_name(table_name) } + process_model_block(model_block) + end + + def add_builds_dependencies_to_dry_run_report(ids_for_delete) + repos_for_delete = Repository.where(current_build_id: ids_for_delete) + jobs_for_delete = Job.where(source_id: ids_for_delete) + @dry_run_reporter.add_to_report(:repositories, *repos_for_delete.map(&:id)) + @dry_run_reporter.add_to_report(:jobs, *jobs_for_delete.map(&:id)) + end + + def process_model_block(model_block) + model_block[:relations].each do |relation| + process_relationship( + main_model: model_block[:main_model], + related_model: relation[:related_model], + fk_name: relation[:fk_name], + method: model_block[:method], + dry_run_complement: model_block[:dry_run_complement] + ) + end + end + + def process_relationship(args) + main_model = args[:main_model] + related_model = args[:related_model] + fk_name = args[:fk_name] + method = args[:method] || :delete_all + dry_run_complement = args[:dry_run_complement] + + main_table = main_model.table_name + related_table = related_model.table_name + + for_delete = main_model.find_by_sql(%{ + select a.* + from #{main_table} a + left join #{related_table} b + on a.#{fk_name} = b.id + where + a.#{fk_name} is not null + and b.id is null; + }) + + ids_for_delete = for_delete.map(&:id) + + if config.dry_run + key = main_table.to_sym + @dry_run_reporter.add_to_report(key, *ids_for_delete) + dry_run_complement.call(ids_for_delete) if dry_run_complement + else + main_model.where(id: ids_for_delete).send(method) end end @@ -104,43 +161,5 @@ def cases } ] end - - def add_builds_dependencies_to_dry_run_report(ids_for_delete) - repos_for_delete = Repository.where(current_build_id: ids_for_delete) - jobs_for_delete = Job.where(source_id: ids_for_delete) - @dry_run_reporter.add_to_report(:repositories, *repos_for_delete.map(&:id)) - @dry_run_reporter.add_to_report(:jobs, *jobs_for_delete.map(&:id)) - end - - def process_table(args) - main_model = args[:main_model] - related_model = args[:related_model] - fk_name = args[:fk_name] - method = args[:method] || :delete_all - dry_run_complement = args[:dry_run_complement] - - main_table = main_model.table_name - related_table = related_model.table_name - - for_delete = main_model.find_by_sql(%{ - select a.* - from #{main_table} a - left join #{related_table} b - on a.#{fk_name} = b.id - where - a.#{fk_name} is not null - and b.id is null; - }) - - ids_for_delete = for_delete.map(&:id) - - if config.dry_run - key = main_table.to_sym - @dry_run_reporter.add_to_report(key, *ids_for_delete) - dry_run_complement.call(ids_for_delete) if dry_run_complement - else - main_model.where(id: ids_for_delete).send(method) - end - end end end diff --git a/lib/model.rb b/lib/model.rb index b8f97af..b152c7e 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -21,14 +21,16 @@ def self.get_model_by_table_name(name) self.subclasses.find{ |m| m.table_name == name.to_s } end - def self.get_ids_of_entries_of_all_subclasses + def self.ids_of_subclasses_entries self.subclasses.map do |subclass| [subclass.name, subclass.all.map(&:id)] if subclass.any? end.compact.to_h end - def self.get_sum_of_rows_of_all_subclasses + def self.sum_of_subclasses_rows(except: []) self.subclasses.map do |subclass| + next 0 if except.include?(subclass.table_name) || except.include?(subclass.name) + subclass.all.size end.reduce(:+) end diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index cafdb83..82a3b4f 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -152,5 +152,18 @@ expect(report[:stages].size).to eql 2 end end + + context 'when orphans table is defined' do + let!(:config) { Config.new(files_location: files_location, limit: 5, orphans_table: 'jobs') } + let!(:remove_orphans) { Backup::RemoveOrphans.new(config, DryRunReporter.new) } + + it 'removes orphans from that defined table' do + expect { remove_orphans.run }.to change { Job.all.size }.by -6 + end + + it 'does not remove orphans from other tables' do + expect { remove_orphans.run }.to change { Model.sum_of_subclasses_rows(except: 'jobs') }.by 0 + end + end end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 30dc032..752505c 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -64,7 +64,7 @@ def get_expected_files(directory, datetime) it 'removes builds with all its dependencies' do expect { remove_specified.remove_repo_builds(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-16) + }.to change { Model.sum_of_subclasses_rows }.by(-16) .and change { Log.all.size }.by(-2) .and change { Job.all.size }.by(-6) .and change { Build.all.size }.by(-2) @@ -149,7 +149,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_builds(repository) - }.not_to change { Model.get_sum_of_rows_of_all_subclasses } + }.not_to change { Model.sum_of_subclasses_rows } end end end @@ -175,7 +175,7 @@ def get_expected_files(directory, datetime) it 'removes requests with all its dependencies' do expect { remove_specified.remove_repo_requests(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-15) + }.to change { Model.sum_of_subclasses_rows }.by(-15) .and change { Log.all.size }.by(-2) .and change { Job.all.size }.by(-2) .and change { Build.all.size }.by(-1) @@ -260,7 +260,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_requests(repository) - }.not_to change { Model.get_sum_of_rows_of_all_subclasses } + }.not_to change { Model.sum_of_subclasses_rows } end end end @@ -293,7 +293,7 @@ def get_expected_files(directory, datetime) it 'removes user with all his dependencies with proper exceptions' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-247) + }.to change { Model.sum_of_subclasses_rows }.by(-247) .and change { Log.all.size }.by(-30) .and change { Job.all.size }.by(-30) .and change { Build.all.size }.by(-18) @@ -360,7 +360,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.not_to change { Model.get_sum_of_rows_of_all_subclasses } + }.not_to change { Model.sum_of_subclasses_rows } end end end @@ -393,7 +393,7 @@ def get_expected_files(directory, datetime) it 'removes organization with all its dependencies with proper exceptions' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-237) + }.to change { Model.sum_of_subclasses_rows }.by(-237) .and change { Log.all.size }.by(-30) .and change { Job.all.size }.by(-30) .and change { Build.all.size }.by(-18) @@ -459,7 +459,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.not_to change { Model.get_sum_of_rows_of_all_subclasses } + }.not_to change { Model.sum_of_subclasses_rows } end end end @@ -492,7 +492,7 @@ def get_expected_files(directory, datetime) it 'removes repository with all its dependencies with proper exceptions' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-173) + }.to change { Model.sum_of_subclasses_rows }.by(-173) .and change { Log.all.size }.by(-24) .and change { Job.all.size }.by(-24) .and change { Build.all.size }.by(-14) @@ -558,7 +558,7 @@ def get_expected_files(directory, datetime) it 'does not remove entries from db' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.not_to change { Model.get_sum_of_rows_of_all_subclasses } + }.not_to change { Model.sum_of_subclasses_rows } end end end From 7b55aca0883209bc99a83af5a680cff5da0f1d4a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 20:24:32 +0100 Subject: [PATCH 60/88] wip --- .../remove_specified/remove_heavy_data.rb | 19 ++++++++------ .../remove_with_all_dependencies.rb | 19 +++++++------- lib/model.rb | 26 +++++++++++++++++++ lib/models/build.rb | 6 ++++- spec/backup/remove_specified_spec.rb | 4 +-- 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index f149da5..fffab60 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -33,13 +33,20 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me def remove_repo_requests(repository) threshold = @config.threshold.to_i.months.ago.to_datetime + requests_dependencies = repository.requests.where('created_at < ?', threshold).map do |request| - result = request.ids_of_all_dependencies(dependencies_to_filter) - result.add(:request, request.id) - result + hash_with_filtered = request.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + hash_with_filtered[:main].add(:request, request.id) + hash_with_filtered[:main].join(hash_with_filtered[:filtered_out]) + hash_with_filtered + end + + requests_dependencies.each do |hash| + filtered_builds = hash[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + filtered_builds&.each(&:nullify_default_dependencies) unless @config.dry_run end - ids_to_remove = IdHash.join(*requests_dependencies) + ids_to_remove = IdHash.join(*(requests_dependencies.map { |h| h[:main] })) @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" process_ids_to_remove(ids_to_remove) end @@ -76,10 +83,6 @@ def dependencies_to_filter } end - def has_filtered_dependencies(build) - build.ids_of_all_dependencies_with_filtered(dependencies_to_filter)[:filtered_out].any? - end - def save_and_destroy_requests_batch(requests_batch, repository) requests_export = requests_batch.map(&:attributes) file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 0f6a7a8..69f794c 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -22,17 +22,23 @@ def remove_repo_with_dependencies(repo_id) private def remove_entry_with_dependencies(model_name, id) + byebug @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" entry = Model.get_model(model_name).find(id) - ids_to_remove = entry.ids_of_all_dependencies(dependencies_to_filter) - ids_to_remove[model_name] = [id] + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + ids_to_remove = hash_with_filtered[:main] + ids_to_remove.add(model_name, id) + ids_to_remove.join(hash_with_filtered[:filtered_out]) + filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + # ids_to_remove.join(*filtered_builds.map(&:ids_of_all_dependencies)) <- problem here if @config.dry_run @dry_run_reporter.add_to_report(ids_to_remove) else + filtered_builds&.each(&:nullify_default_dependencies) save_id_hash_to_file(ids_to_remove) if @config.if_backup ids_to_remove.remove_entries_from_db(as_last: [:build]) - # order important because of foreign key constraint between builds and repos + # order important because of foreign key constraint between builds and repos end end @@ -42,12 +48,7 @@ def time_for_subfolder def dependencies_to_filter { - build: [ - :repos_for_that_this_build_is_current, - :repos_for_that_this_build_is_last, - :tags_for_that_this_build_is_last, - :branches_for_that_this_build_is_last - ] + build: Build.default_dependencies_to_nullify } end end diff --git a/lib/model.rb b/lib/model.rb index 7fb3e52..847be3e 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -4,6 +4,15 @@ require 'ids_of_all_dependencies' require 'nullify_dependencies' +class AssociationWithValue + delegate_missing_to :@association + + def initialize(association, value) + @association = association + @value = value + end +end + class Model < ActiveRecord::Base include IdsOfAllDependencies include NullifyDependencies @@ -14,6 +23,23 @@ def attributes_without_id self.attributes.reject{|k, v| k == "id"} end + def associations_hash + self.associations.map do |association| + [association.name, association] + end.to_h + end + + def associations + self.class.reflect_on_all_associations.map do |association| + value = self.send(association.name) + AssociationWithValue.new(association, value) + end + end + + def associations_without_belongs_to + self.associations.select { |a| a.macro != :belongs_to } + end + def self.get_model(name) self.subclasses.find{ |m| m.name == name.to_s.camelcase } end diff --git a/lib/models/build.rb b/lib/models/build.rb index 005955d..df59f0b 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -23,7 +23,7 @@ class Build < Model self.table_name = 'builds' - def default_dependencies_to_nullify + def self.default_dependencies_to_nullify [ :repos_for_that_this_build_is_current, :repos_for_that_this_build_is_last, @@ -31,4 +31,8 @@ def default_dependencies_to_nullify :branches_for_that_this_build_is_last ] end + + def default_dependencies_to_nullify + self.class.default_dependencies_to_nullify + end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 30dc032..fec71c5 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -175,10 +175,10 @@ def get_expected_files(directory, datetime) it 'removes requests with all its dependencies' do expect { remove_specified.remove_repo_requests(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-15) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-16) .and change { Log.all.size }.by(-2) .and change { Job.all.size }.by(-2) - .and change { Build.all.size }.by(-1) + .and change { Build.all.size }.by(-2) .and change { Request.all.size }.by(-2) .and change { Repository.all.size }.by(0) .and change { Branch.all.size }.by(0) From 149e5355b9bc9e87a28ef022aa2088f5fd784d54 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 20:57:41 +0100 Subject: [PATCH 61/88] spec for second filtering strategy --- lib/ids_of_all_dependencies.rb | 2 +- spec/model_spec.rb | 37 ++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 10d8462..f46057d 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -52,7 +52,7 @@ def ids_of_all_dependencies(to_filter=nil) ids_of_all_dependencies_with_filtered(to_filter)[:main] end - def ids_of_all_dependencies_with_filtered(to_filter=nil) + def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter id_hash[:main].sort_arrays! diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 6c4bb75..51f659b 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -22,7 +22,7 @@ updated_at: datetime ) } - context 'when no filters are given' do + context 'when the filter is not given' do it 'returns all dependencies ids in hash' do expect(commit.ids_of_all_dependencies_with_filtered).to eql({ filtered_out: {}, @@ -44,12 +44,12 @@ end end - context 'when the except filter is given' do + context 'when the filter is given' do + let!(:to_filter) { + { request: [ :jobs, :builds ] } + } it 'returns all dependencies ids in hash' do - filter = { - request: [ :jobs, :builds ] - } - expect(commit.ids_of_all_dependencies_with_filtered(filter)).to eql({ + expect(commit.ids_of_all_dependencies_with_filtered(to_filter)).to eql({ main: { annotation: [1, 2], branch: [73], @@ -67,6 +67,31 @@ } }) end + + context 'when filtered_children_only filtering strategy is set' do + it 'returns all dependencies ids in hash' do + expect(commit.ids_of_all_dependencies_with_filtered(to_filter, :filtered_children_only)).to eql({ + main: { + abuse: [1, 2], + annotation: [1, 2], + branch: [73], + build: [1, 3], + job: [2, 4, 5], + log: [1, 2], + message: [1, 2], + queueable_job: [1, 2], + repository: [2, 1], + request: [1, 2], + stage: [20], + tag: [1] + }, + filtered_out: { + build: [6, 8], + job: [9, 10] + } + }) + end + end end end end From 16ad3cc3448b4a2498854d41dc5e7cf3096a1ece Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 23:29:07 +0100 Subject: [PATCH 62/88] wip --- lib/ids_of_all_dependencies.rb | 71 +++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index f46057d..fe07ec4 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -1,5 +1,71 @@ require 'id_hash' +module IdsOfAllDependenciesOld + def ids_of_all_dependencies_old(to_filter={}) + result = { main: IdHash.new, filtered_out: IdHash.new } + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + context = { to_filter: to_filter, association: association } + + self.send(association.name).map do |associated_object| + hash_to_use = get_hash_to_use_old(result, **context, object: associated_object) + hash_to_use[symbol] = [] if hash_to_use[symbol].nil? + hash_to_use[symbol] << associated_object.id + end + result = get_result_with_grandchildren_hashes_old(result, context) + end + + result + end + + private + + def get_result_with_grandchildren_hashes_old(result, context) + hashes = get_grandchildren_hashes_old(context) + main = hashes.map { |hash| hash[:main] } + filtered_out = hashes.map { |hash| hash[:filtered_out] } + + result[:main] = result[:main].join(*main) + result[:filtered_out] = result[:filtered_out].join(*filtered_out) + result + end + + def get_grandchildren_hashes_old(context) + association = context[:association] + to_filter = context[:to_filter] + + self.send(association.name).map do |associated_object| + next if should_be_filtered_old?(**context, object: associated_object) + associated_object.ids_of_all_dependencies_old(to_filter) + end.compact + end + + def get_hash_to_use_old(result, context) + symbol = should_be_filtered_old?(**context) ? :filtered_out : :main + result[symbol] + end + + def should_be_filtered_old?(to_filter:, association:, object:) + symbol = association.klass.name.underscore.to_sym + + association.klass.reflect_on_all_associations.each do |association2| + next if association2.macro == :belongs_to + + context = { to_filter: to_filter, symbol: symbol, association: association2 } + return true if object.send(association2.name).any? && is_this_association_filtered_old(context) + end + + false + end + + def is_this_association_filtered_old(to_filter:, symbol:, association:) + arr = to_filter[symbol] + arr.present? && arr.any? { |a| a == association.name } + end +end + module IdsOfAllDirectDependencies def ids_of_all_direct_dependencies result = IdHash.new @@ -47,12 +113,15 @@ def get_associations(depth) module IdsOfAllDependencies include IdsOfAllDependenciesNested include IdsOfAllDirectDependencies + include IdsOfAllDependenciesOld def ids_of_all_dependencies(to_filter=nil) ids_of_all_dependencies_with_filtered(to_filter)[:main] end def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) + return ids_of_all_dependencies_old(to_filter) if filtering_strategy == :filtered_children_only + id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter id_hash[:main].sort_arrays! @@ -151,4 +220,4 @@ def is_this_association_filtered(to_filter:, symbol:, association:) arr = to_filter[symbol] arr.present? && arr.any? { |a| a == association.name } end -end \ No newline at end of file +end From 433bcea4dfcf18ec5fcf0683d518016eb1aedb31 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 9 Nov 2021 23:50:55 +0100 Subject: [PATCH 63/88] wip --- lib/ids_of_all_dependencies.rb | 93 +++++++++++++++------------------- spec/model_spec.rb | 4 +- 2 files changed, 43 insertions(+), 54 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index fe07ec4..2cb37ee 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -1,18 +1,20 @@ require 'id_hash' + module IdsOfAllDependenciesOld def ids_of_all_dependencies_old(to_filter={}) result = { main: IdHash.new, filtered_out: IdHash.new } + self_symbol = self.class.name.underscore.to_sym self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, association: association } + context = { to_filter: to_filter, self_symbol: self_symbol, association: association } - self.send(association.name).map do |associated_object| - hash_to_use = get_hash_to_use_old(result, **context, object: associated_object) + self.send(association.name).map(&:id).map do |id| + hash_to_use = get_hash_to_use_old(result, context) hash_to_use[symbol] = [] if hash_to_use[symbol].nil? - hash_to_use[symbol] << associated_object.id + hash_to_use[symbol] << id end result = get_result_with_grandchildren_hashes_old(result, context) end @@ -36,9 +38,9 @@ def get_grandchildren_hashes_old(context) association = context[:association] to_filter = context[:to_filter] - self.send(association.name).map do |associated_object| - next if should_be_filtered_old?(**context, object: associated_object) - associated_object.ids_of_all_dependencies_old(to_filter) + self.send(association.name).map do |model| + next if should_be_filtered_old?(**context) + model.ids_of_all_dependencies_old(to_filter) end.compact end @@ -47,21 +49,8 @@ def get_hash_to_use_old(result, context) result[symbol] end - def should_be_filtered_old?(to_filter:, association:, object:) - symbol = association.klass.name.underscore.to_sym - - association.klass.reflect_on_all_associations.each do |association2| - next if association2.macro == :belongs_to - - context = { to_filter: to_filter, symbol: symbol, association: association2 } - return true if object.send(association2.name).any? && is_this_association_filtered_old(context) - end - - false - end - - def is_this_association_filtered_old(to_filter:, symbol:, association:) - arr = to_filter[symbol] + def should_be_filtered_old?(to_filter:, self_symbol:, association:) + arr = to_filter[self_symbol] arr.present? && arr.any? { |a| a == association.name } end end @@ -120,7 +109,7 @@ def ids_of_all_dependencies(to_filter=nil) end def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) - return ids_of_all_dependencies_old(to_filter) if filtering_strategy == :filtered_children_only + return ids_of_all_dependencies_old(to_filter) if filtering_strategy == :without_parents id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter @@ -149,35 +138,6 @@ def ids_of_all_dependencies_without_reflection(to_filter) private - def move_wrongly_assigned_to_main(to_filter, id_hash) - id_hash[:filtered_out].each do |model_symbol, array| - array.clone.each do |id| - object = Model.get_model(model_symbol).find(id) - move_object_to_main_if_necessary(to_filter[model_symbol], id_hash, object) - end - end - id_hash - end - - def move_object_to_main_if_necessary(associations_to_filter, id_hash, object) - if should_object_be_moved?(associations_to_filter, id_hash, object) - symbol = object.class.name.underscore.to_sym - id_hash[:filtered_out][symbol].delete(object.id) - id_hash[:main].add(symbol, object.id) - end - end - - def should_object_be_moved?(associations_to_filter, id_hash, object) - associations_to_filter.map do |association| - associated = object.send(association) - - associated.to_a.empty? || associated.map do |associated_object| - class_symbol = associated_object.class.name.underscore.to_sym - id_hash[:main][class_symbol]&.include?(associated_object.id) - end.reduce(:&) - end.reduce(:&) - end - def get_result_with_grandchildren_hashes(result, context) hashes = get_grandchildren_hashes(context) main = hashes.map { |hash| hash[:main] } @@ -220,4 +180,33 @@ def is_this_association_filtered(to_filter:, symbol:, association:) arr = to_filter[symbol] arr.present? && arr.any? { |a| a == association.name } end + + def move_wrongly_assigned_to_main(to_filter, id_hash) + id_hash[:filtered_out].each do |model_symbol, array| + array.clone.each do |id| + object = Model.get_model(model_symbol).find(id) + move_object_to_main_if_necessary(to_filter[model_symbol], id_hash, object) + end + end + id_hash + end + + def move_object_to_main_if_necessary(associations_to_filter, id_hash, object) + if should_object_be_moved?(associations_to_filter, id_hash, object) + symbol = object.class.name.underscore.to_sym + id_hash[:filtered_out][symbol].delete(object.id) + id_hash[:main].add(symbol, object.id) + end + end + + def should_object_be_moved?(associations_to_filter, id_hash, object) + associations_to_filter.map do |association| + associated = object.send(association) + + associated.to_a.empty? || associated.map do |associated_object| + class_symbol = associated_object.class.name.underscore.to_sym + id_hash[:main][class_symbol]&.include?(associated_object.id) + end.reduce(:&) + end.reduce(:&) + end end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 51f659b..32ff8f5 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -68,9 +68,9 @@ }) end - context 'when filtered_children_only filtering strategy is set' do + context 'when without_parents filtering strategy is set' do it 'returns all dependencies ids in hash' do - expect(commit.ids_of_all_dependencies_with_filtered(to_filter, :filtered_children_only)).to eql({ + expect(commit.ids_of_all_dependencies_with_filtered(to_filter, :without_parents)).to eql({ main: { abuse: [1, 2], annotation: [1, 2], From c0516f6e2cc964ccc0ef8fa8f7dfe5b7e1dbdddf Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 00:25:32 +0100 Subject: [PATCH 64/88] two filtering strategies together wip --- lib/ids_of_all_dependencies.rb | 108 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 2cb37ee..634c19b 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -1,60 +1,5 @@ require 'id_hash' - -module IdsOfAllDependenciesOld - def ids_of_all_dependencies_old(to_filter={}) - result = { main: IdHash.new, filtered_out: IdHash.new } - self_symbol = self.class.name.underscore.to_sym - - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, self_symbol: self_symbol, association: association } - - self.send(association.name).map(&:id).map do |id| - hash_to_use = get_hash_to_use_old(result, context) - hash_to_use[symbol] = [] if hash_to_use[symbol].nil? - hash_to_use[symbol] << id - end - result = get_result_with_grandchildren_hashes_old(result, context) - end - - result - end - - private - - def get_result_with_grandchildren_hashes_old(result, context) - hashes = get_grandchildren_hashes_old(context) - main = hashes.map { |hash| hash[:main] } - filtered_out = hashes.map { |hash| hash[:filtered_out] } - - result[:main] = result[:main].join(*main) - result[:filtered_out] = result[:filtered_out].join(*filtered_out) - result - end - - def get_grandchildren_hashes_old(context) - association = context[:association] - to_filter = context[:to_filter] - - self.send(association.name).map do |model| - next if should_be_filtered_old?(**context) - model.ids_of_all_dependencies_old(to_filter) - end.compact - end - - def get_hash_to_use_old(result, context) - symbol = should_be_filtered_old?(**context) ? :filtered_out : :main - result[symbol] - end - - def should_be_filtered_old?(to_filter:, self_symbol:, association:) - arr = to_filter[self_symbol] - arr.present? && arr.any? { |a| a == association.name } - end -end - module IdsOfAllDirectDependencies def ids_of_all_direct_dependencies result = IdHash.new @@ -102,14 +47,13 @@ def get_associations(depth) module IdsOfAllDependencies include IdsOfAllDependenciesNested include IdsOfAllDirectDependencies - include IdsOfAllDependenciesOld def ids_of_all_dependencies(to_filter=nil) ids_of_all_dependencies_with_filtered(to_filter)[:main] end def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) - return ids_of_all_dependencies_old(to_filter) if filtering_strategy == :without_parents + return ids_of_all_dependencies_filtered_without_parents(to_filter) if filtering_strategy == :without_parents id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter @@ -136,8 +80,58 @@ def ids_of_all_dependencies_without_reflection(to_filter) result end + def ids_of_all_dependencies_filtered_without_parents(to_filter={}) + result = { main: IdHash.new, filtered_out: IdHash.new } + self_symbol = self.class.name.underscore.to_sym + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + symbol = association.klass.name.underscore.to_sym + context = { to_filter: to_filter, self_symbol: self_symbol, association: association } + + self.send(association.name).map(&:id).map do |id| + hash_to_use = get_hash_to_use_old(result, context) + hash_to_use[symbol] = [] if hash_to_use[symbol].nil? + hash_to_use[symbol] << id + end + result = get_result_with_grandchildren_hashes_old(result, context) + end + + result + end + private + def get_result_with_grandchildren_hashes_old(result, context) + hashes = get_grandchildren_hashes_old(context) + main = hashes.map { |hash| hash[:main] } + filtered_out = hashes.map { |hash| hash[:filtered_out] } + + result[:main] = result[:main].join(*main) + result[:filtered_out] = result[:filtered_out].join(*filtered_out) + result + end + + def get_grandchildren_hashes_old(context) + association = context[:association] + to_filter = context[:to_filter] + + self.send(association.name).map do |model| + next if should_be_filtered_old?(**context) + model.ids_of_all_dependencies_filtered_without_parents(to_filter) + end.compact + end + + def get_hash_to_use_old(result, context) + symbol = should_be_filtered_old?(**context) ? :filtered_out : :main + result[symbol] + end + + def should_be_filtered_old?(to_filter:, self_symbol:, association:) + arr = to_filter[self_symbol] + arr.present? && arr.any? { |a| a == association.name } + end + def get_result_with_grandchildren_hashes(result, context) hashes = get_grandchildren_hashes(context) main = hashes.map { |hash| hash[:main] } From 07e26e5c9b6e147e06031c257c30e022b193cebb Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 00:46:19 +0100 Subject: [PATCH 65/88] two filtering strategies together --- lib/ids_of_all_dependencies.rb | 66 ++++++++++++++++------------------ 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 634c19b..2a64ab0 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -68,7 +68,7 @@ def ids_of_all_dependencies_without_reflection(to_filter) self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, association: association } + context = { to_filter: to_filter, association: association, strategy: :with_parents } self.send(association.name).map do |associated_object| hash_to_use = get_hash_to_use(result, **context, object: associated_object) @@ -87,14 +87,14 @@ def ids_of_all_dependencies_filtered_without_parents(to_filter={}) self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, self_symbol: self_symbol, association: association } + context = { to_filter: to_filter, self_symbol: self_symbol, association: association, strategy: :without_parents } self.send(association.name).map(&:id).map do |id| - hash_to_use = get_hash_to_use_old(result, context) + hash_to_use = get_hash_to_use(result, context) hash_to_use[symbol] = [] if hash_to_use[symbol].nil? hash_to_use[symbol] << id end - result = get_result_with_grandchildren_hashes_old(result, context) + result = get_result_with_grandchildren_hashes(result, context) end result @@ -102,36 +102,6 @@ def ids_of_all_dependencies_filtered_without_parents(to_filter={}) private - def get_result_with_grandchildren_hashes_old(result, context) - hashes = get_grandchildren_hashes_old(context) - main = hashes.map { |hash| hash[:main] } - filtered_out = hashes.map { |hash| hash[:filtered_out] } - - result[:main] = result[:main].join(*main) - result[:filtered_out] = result[:filtered_out].join(*filtered_out) - result - end - - def get_grandchildren_hashes_old(context) - association = context[:association] - to_filter = context[:to_filter] - - self.send(association.name).map do |model| - next if should_be_filtered_old?(**context) - model.ids_of_all_dependencies_filtered_without_parents(to_filter) - end.compact - end - - def get_hash_to_use_old(result, context) - symbol = should_be_filtered_old?(**context) ? :filtered_out : :main - result[symbol] - end - - def should_be_filtered_old?(to_filter:, self_symbol:, association:) - arr = to_filter[self_symbol] - arr.present? && arr.any? { |a| a == association.name } - end - def get_result_with_grandchildren_hashes(result, context) hashes = get_grandchildren_hashes(context) main = hashes.map { |hash| hash[:main] } @@ -148,7 +118,12 @@ def get_grandchildren_hashes(context) self.send(association.name).map do |associated_object| next if should_be_filtered?(**context, object: associated_object) - associated_object.ids_of_all_dependencies_without_reflection(to_filter) + case context[:strategy] + when :with_parents + associated_object.ids_of_all_dependencies_without_reflection(to_filter) + when :without_parents + associated_object.ids_of_all_dependencies_filtered_without_parents(to_filter) + end end.compact end @@ -157,7 +132,19 @@ def get_hash_to_use(result, context) result[symbol] end - def should_be_filtered?(to_filter:, association:, object:) + def should_be_filtered?(context) + case context[:strategy] + when :with_parents + should_be_filtered_according_to_with_parents_strategy?(context) + when :without_parents + should_be_filtered_according_to_without_parents_strategy?(context) + end + end + + def should_be_filtered_according_to_with_parents_strategy?(context) + to_filter = context[:to_filter] + object = context[:object] + association = context[:association] symbol = association.klass.name.underscore.to_sym association.klass.reflect_on_all_associations.each do |association2| @@ -175,6 +162,13 @@ def is_this_association_filtered(to_filter:, symbol:, association:) arr.present? && arr.any? { |a| a == association.name } end + def should_be_filtered_according_to_without_parents_strategy?(context) + to_filter = context[:to_filter] + self_symbol = context[:self_symbol] + association = context[:association] + is_this_association_filtered(to_filter: to_filter, symbol: self_symbol, association: association) + end + def move_wrongly_assigned_to_main(to_filter, id_hash) id_hash[:filtered_out].each do |model_symbol, array| array.clone.each do |id| From 4e18121ec829b48fa6c2cf57d4927a58d2b6e196 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 00:56:37 +0100 Subject: [PATCH 66/88] refactoring --- lib/ids_of_all_dependencies.rb | 24 +++++++++++++----------- spec/model_spec.rb | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 2a64ab0..956a893 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -53,16 +53,23 @@ def ids_of_all_dependencies(to_filter=nil) end def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) - return ids_of_all_dependencies_filtered_without_parents(to_filter) if filtering_strategy == :without_parents - - id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}) - move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter + id_hash = ids_of_all_dependencies_without_reflection(to_filter || {}, filtering_strategy) + move_wrongly_assigned_to_main(to_filter, id_hash) if to_filter && filtering_strategy == :with_parents id_hash[:main].sort_arrays! id_hash[:filtered_out].sort_arrays! id_hash end - def ids_of_all_dependencies_without_reflection(to_filter) + def ids_of_all_dependencies_without_reflection(to_filter, filtering_strategy=:with_parents) + case filtering_strategy + when :without_parents + ids_of_all_dependencies_filtered_without_parents(to_filter) + when :with_parents + ids_of_all_dependencies_filtered_with_parents(to_filter) + end + end + + def ids_of_all_dependencies_filtered_with_parents(to_filter={}) result = { main: IdHash.new, filtered_out: IdHash.new } self.class.reflect_on_all_associations.map do |association| @@ -118,12 +125,7 @@ def get_grandchildren_hashes(context) self.send(association.name).map do |associated_object| next if should_be_filtered?(**context, object: associated_object) - case context[:strategy] - when :with_parents - associated_object.ids_of_all_dependencies_without_reflection(to_filter) - when :without_parents - associated_object.ids_of_all_dependencies_filtered_without_parents(to_filter) - end + associated_object.ids_of_all_dependencies_without_reflection(to_filter, context[:strategy]) end.compact end diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 32ff8f5..423600a 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -80,7 +80,7 @@ log: [1, 2], message: [1, 2], queueable_job: [1, 2], - repository: [2, 1], + repository: [1, 2], request: [1, 2], stage: [20], tag: [1] From 68c9271cbecd003c9cdc4bc5bcc9df6163937164 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 01:02:43 +0100 Subject: [PATCH 67/88] refactoring --- lib/ids_of_all_dependencies.rb | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 956a893..81a397e 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -61,21 +61,13 @@ def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:wit end def ids_of_all_dependencies_without_reflection(to_filter, filtering_strategy=:with_parents) - case filtering_strategy - when :without_parents - ids_of_all_dependencies_filtered_without_parents(to_filter) - when :with_parents - ids_of_all_dependencies_filtered_with_parents(to_filter) - end - end - - def ids_of_all_dependencies_filtered_with_parents(to_filter={}) result = { main: IdHash.new, filtered_out: IdHash.new } + self_symbol = self.class.name.underscore.to_sym self.class.reflect_on_all_associations.map do |association| next if association.macro == :belongs_to symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, association: association, strategy: :with_parents } + context = { to_filter: to_filter, self_symbol: self_symbol, association: association, strategy: filtering_strategy } self.send(association.name).map do |associated_object| hash_to_use = get_hash_to_use(result, **context, object: associated_object) @@ -87,26 +79,6 @@ def ids_of_all_dependencies_filtered_with_parents(to_filter={}) result end - def ids_of_all_dependencies_filtered_without_parents(to_filter={}) - result = { main: IdHash.new, filtered_out: IdHash.new } - self_symbol = self.class.name.underscore.to_sym - - self.class.reflect_on_all_associations.map do |association| - next if association.macro == :belongs_to - symbol = association.klass.name.underscore.to_sym - context = { to_filter: to_filter, self_symbol: self_symbol, association: association, strategy: :without_parents } - - self.send(association.name).map(&:id).map do |id| - hash_to_use = get_hash_to_use(result, context) - hash_to_use[symbol] = [] if hash_to_use[symbol].nil? - hash_to_use[symbol] << id - end - result = get_result_with_grandchildren_hashes(result, context) - end - - result - end - private def get_result_with_grandchildren_hashes(result, context) From 470701c8343039373e7830ceef7e086679cf5e8e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 01:05:31 +0100 Subject: [PATCH 68/88] refactoring --- lib/ids_of_all_dependencies.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 81a397e..813419a 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -73,6 +73,7 @@ def ids_of_all_dependencies_without_reflection(to_filter, filtering_strategy=:wi hash_to_use = get_hash_to_use(result, **context, object: associated_object) hash_to_use.add(symbol, associated_object.id) end + result = get_result_with_grandchildren_hashes(result, context) end @@ -125,22 +126,23 @@ def should_be_filtered_according_to_with_parents_strategy?(context) next if association2.macro == :belongs_to context = { to_filter: to_filter, symbol: symbol, association: association2 } - return true if object.send(association2.name).any? && is_this_association_filtered(**context) + return true if object.send(association2.name).any? && is_this_association_filtered?(**context) end false end - def is_this_association_filtered(to_filter:, symbol:, association:) + def is_this_association_filtered?(to_filter:, symbol:, association:) arr = to_filter[symbol] arr.present? && arr.any? { |a| a == association.name } end def should_be_filtered_according_to_without_parents_strategy?(context) - to_filter = context[:to_filter] - self_symbol = context[:self_symbol] - association = context[:association] - is_this_association_filtered(to_filter: to_filter, symbol: self_symbol, association: association) + is_this_association_filtered?( + to_filter: context[:to_filter], + symbol: context[:self_symbol], + association: context[:association] + ) end def move_wrongly_assigned_to_main(to_filter, id_hash) From 8d7cb18a190cad2d90bc87ed8e352decf3734750 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 14:56:52 +0100 Subject: [PATCH 69/88] remove_entry_with_dependencies fixed --- .../remove_with_all_dependencies.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index 69f794c..de4f3eb 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -22,26 +22,28 @@ def remove_repo_with_dependencies(repo_id) private def remove_entry_with_dependencies(model_name, id) - byebug @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" entry = Model.get_model(model_name).find(id) - hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter, :without_parents) ids_to_remove = hash_with_filtered[:main] ids_to_remove.add(model_name, id) - ids_to_remove.join(hash_with_filtered[:filtered_out]) - filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } - # ids_to_remove.join(*filtered_builds.map(&:ids_of_all_dependencies)) <- problem here if @config.dry_run @dry_run_reporter.add_to_report(ids_to_remove) else - filtered_builds&.each(&:nullify_default_dependencies) + nullify_filtered_dependencies(entry) save_id_hash_to_file(ids_to_remove) if @config.if_backup ids_to_remove.remove_entries_from_db(as_last: [:build]) # order important because of foreign key constraint between builds and repos end end + def nullify_filtered_dependencies(entry) + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + filtered_builds&.each(&:nullify_default_dependencies) + end + def time_for_subfolder Time.now.to_s.parameterize.underscore end From 30b08a9b6d1c9e55192b6978c19296aa84f73caf Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 10 Nov 2021 14:57:23 +0100 Subject: [PATCH 70/88] dependency tree --- lib/ids_of_all_dependencies.rb | 100 +++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 813419a..a0a6813 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -44,9 +44,109 @@ def get_associations(depth) end end +module DependencyTree + class Tree < Hash + def initialize(hash={}) + hash.each do |key, value| + self[key] = value + end + end + + def ids_tree + self_cloned = self.deep_tree_clone + self_cloned.delete_key_recursive(:instance) + end + + def status_tree + self_cloned = self.deep_tree_clone + + self_cloned.do_recursive do |tree| + begin + tree[:instance].reload + tree[:status] = 'present' + rescue ActiveRecord::RecordNotFound => e + tree[:status] = 'removed' + end + + tree.delete(:instance) + end + end + + def deep_tree_clone + result = self.clone + + hash = result.map do |key, array| + next [key, array] unless array.class == Array + + new_array = array.map do |subtree| + if subtree.class == Tree + subtree.deep_tree_clone + else + subtree + end + end + + [key, new_array] + end + + Tree.new(hash) + end + + def delete_key_recursive(key) + call_method_recursive(:delete, key) + end + + def call_method_recursive(method, *args, &block) + do_recursive do |tree| + tree.send(method, *args, &block) + end + end + + def do_recursive(&block) + block.call(self) + + self.each do |key, array| + next unless array.is_a? Array + + array.each do |subtree| + subtree.do_recursive(&block) if subtree.is_a? Tree + end + end + + self + end + end + + def dependency_tree(depth = Float::INFINITY) + result = depth > 0 ? get_associations_for_tree(depth) : Tree.new + result[:id] = id + result[:instance] = self + result + end + + private + + def get_associations_for_tree(depth) + result = Tree.new + + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + + symbol = association.klass.name.underscore.to_sym + self.send(association.name).sort_by(&:id).map do |associated_object| + result[symbol] = [] if result[symbol].nil? + result[symbol] << associated_object.dependency_tree(depth - 1) + end + end + + result + end +end + module IdsOfAllDependencies include IdsOfAllDependenciesNested include IdsOfAllDirectDependencies + include DependencyTree def ids_of_all_dependencies(to_filter=nil) ids_of_all_dependencies_with_filtered(to_filter)[:main] From 6eae48869e3fe65296981e6c0fd7759a5b37f741 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 11 Nov 2021 18:45:01 +0100 Subject: [PATCH 71/88] remove_repo_with_dependencies tested using dependency tree and with nullification check --- .../remove_with_all_dependencies.rb | 2 +- lib/ids_of_all_dependencies.rb | 31 +- lib/model.rb | 9 + lib/models/build.rb | 6 +- lib/nullify_dependencies.rb | 14 +- spec/backup/remove_specified_spec.rb | 47 +- .../remove_repo_with_dependencies.rb | 1629 +++++++++++++++++ spec/support/utils.rb | 18 + 8 files changed, 1714 insertions(+), 42 deletions(-) create mode 100644 spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index de4f3eb..acd03a8 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -50,7 +50,7 @@ def time_for_subfolder def dependencies_to_filter { - build: Build.default_dependencies_to_nullify + build: Build.default_dependencies_symbols_to_nullify } end end diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index a0a6813..9eb1f9a 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -72,10 +72,35 @@ def status_tree end end - def deep_tree_clone - result = self.clone + def status_tree_condensed + result = status_tree.do_recursive do |tree| + tree.each do |key, array| + next unless array.class == Array + + new_array = array.map do |subtree| + next subtree if subtree.class != Tree || subtree.size > 2 + + subtree.root_summary + end + + array.clear + array.concat(new_array) + end + end - hash = result.map do |key, array| + result.do_recursive do |tree| + tree[:_] = tree.root_summary + tree.delete(:id) + tree.delete(:status) + end + end + + def root_summary + "id #{self[:id]}, #{self[:status]}" + end + + def deep_tree_clone + hash = self.clone.map do |key, array| next [key, array] unless array.class == Array new_array = array.map do |subtree| diff --git a/lib/model.rb b/lib/model.rb index 847be3e..5793d57 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -59,6 +59,15 @@ def self.get_sum_of_rows_of_all_subclasses subclass.all.size end.reduce(:+) end + + def removed? + begin + reload + false + rescue ActiveRecord::RecordNotFound => e + true + end + end end ActiveSupport::Inflector.inflections(:en) do |inflect| diff --git a/lib/models/build.rb b/lib/models/build.rb index df59f0b..129a2f1 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -23,7 +23,7 @@ class Build < Model self.table_name = 'builds' - def self.default_dependencies_to_nullify + def self.default_dependencies_symbols_to_nullify [ :repos_for_that_this_build_is_current, :repos_for_that_this_build_is_last, @@ -31,8 +31,4 @@ def self.default_dependencies_to_nullify :branches_for_that_this_build_is_last ] end - - def default_dependencies_to_nullify - self.class.default_dependencies_to_nullify - end end diff --git a/lib/nullify_dependencies.rb b/lib/nullify_dependencies.rb index a954b6f..7add18b 100644 --- a/lib/nullify_dependencies.rb +++ b/lib/nullify_dependencies.rb @@ -13,10 +13,20 @@ def nullify_dependencies(dependencies_to_nullify) end def nullify_default_dependencies - nullify_dependencies(default_dependencies_to_nullify) + nullify_dependencies(default_dependencies_symbols_to_nullify) + end + + def default_dependencies_symbols_to_nullify + self.class.default_dependencies_symbols_to_nullify + end + + def self.default_dependencies_symbols_to_nullify + raise "self.default_dependencies_symbols_to_nullify not implemented in the #{self.class} class" end def default_dependencies_to_nullify - raise "default_dependencies_to_nullify not implemented in the #{self.class} class" + default_dependencies_symbols_to_nullify.map do |symbol| + self.send(symbol).to_a + end.flatten(1) end end \ No newline at end of file diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index fec71c5..76d63d7 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -8,6 +8,7 @@ require 'support/factories' require 'support/before_tests' require 'support/utils' +require 'support/expected_dependency_trees/remove_repo_with_dependencies' require 'pry' require 'byebug' @@ -490,39 +491,23 @@ def get_expected_files(directory, datetime) shared_context 'removing repository with dependencies' do it 'removes repository with all its dependencies with proper exceptions' do + dependency_tree = repository.dependency_tree + remove_specified.remove_repo_with_dependencies(repository.id) + expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_repo_with_dependencies) + end + + it 'removes intended number of rows from database' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-173) - .and change { Log.all.size }.by(-24) - .and change { Job.all.size }.by(-24) - .and change { Build.all.size }.by(-14) - .and change { Request.all.size }.by(-14) - .and change { Repository.all.size }.by(-1) - .and change { Branch.all.size }.by(-2) - .and change { Tag.all.size }.by(-2) - .and change { Commit.all.size }.by(-6) - .and change { Cron.all.size }.by(-2) - .and change { PullRequest.all.size }.by(-2) - .and change { SslKey.all.size }.by(-2) - .and change { Stage.all.size }.by(0) - .and change { Star.all.size }.by(-2) - .and change { Permission.all.size }.by(-2) - .and change { Message.all.size }.by(-14) - .and change { Abuse.all.size }.by(-14) - .and change { Annotation.all.size }.by(-24) - .and change { QueueableJob.all.size }.by(-24) - .and change { Email.all.size }.by(0) - .and change { Invoice.all.size }.by(0) - .and change { Membership.all.size }.by(0) - .and change { Organization.all.size }.by(0) - .and change { OwnerGroup.all.size }.by(0) - .and change { Broadcast.all.size }.by(0) - .and change { Subscription.all.size }.by(0) - .and change { Token.all.size }.by(0) - .and change { TrialAllowance.all.size }.by(0) - .and change { Trial.all.size }.by(0) - .and change { UserBetaFeature.all.size }.by(0) - .and change { User.all.size }.by(0) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-239) + end + + it 'nullifies orphaned builds dependencies' do + expect( + nullifies_all_orphaned_builds_dependencies? do + remove_specified.remove_repo_with_dependencies(repository.id) + end + ).to eql(true) end end diff --git a/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb new file mode 100644 index 0000000..38a6434 --- /dev/null +++ b/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb @@ -0,0 +1,1629 @@ +class ExpectedDependencyTrees + def self.remove_repo_with_dependencies + { + build: [ + { + job: [ + { + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ], + _: "id 6, removed" + }, + "id 7, removed" + ], + repository: [ + { + build: [ + "id 48, present" + ], + request: [ + "id 10, present" + ], + job: [ + "id 49, present" + ], + branch: [ + "id 84, present" + ], + ssl_key: [ + "id 32, present" + ], + commit: [ + "id 216, present" + ], + permission: [ + "id 2, present" + ], + star: [ + "id 2, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" + ], + _: "id 20, present" + }, + "id 21, present", + { + build: [ + "id 46, present" + ], + request: [ + "id 9, present" + ], + job: [ + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 1, present" + ], + star: [ + "id 1, present" + ], + pull_request: [ + "id 1, present" + ], + tag: [ + "id 11, present" + ], + _: "id 18, present" + }, + "id 19, present" + ], + tag: [ + { + build: [ + { + job: [ + "id 9, present" + ], + repository: [ + "id 3, present", + "id 2, present" + ], + tag: [ + "id 2, present" + ], + branch: [ + "id 73, present" + ], + stage: [ + "id 22, present" + ], + _: "id 8, present" + }, + "id 10, present" + ], + commit: [ + { + build: [ + { + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ], + _: "id 11, present" + }, + "id 13, present" + ], + job: [ + { + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ], + _: "id 14, present" + }, + "id 15, present" + ], + request: [ + { + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ], + _: "id 19, present" + }, + "id 20, present" + ], + build: [ + { + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ], + _: "id 16, present" + }, + "id 18, present" + ], + _: "id 1, present" + }, + "id 2, present" + ], + _: "id 211, present" + }, + "id 212, present" + ], + request: [ + { + abuse: [ + "id 3, present", + "id 4, present" + ], + message: [ + "id 3, present", + "id 4, present" + ], + job: [ + { + log: [ + "id 7, present", + "id 8, present" + ], + annotation: [ + "id 7, present", + "id 8, present" + ], + queueable_job: [ + "id 7, present", + "id 8, present" + ], + _: "id 24, present" + }, + "id 25, present" + ], + build: [ + { + job: [ + "id 22, present" + ], + repository: [ + "id 9, present", + "id 8, present" + ], + tag: [ + "id 5, present" + ], + branch: [ + "id 76, present" + ], + stage: [ + "id 25, present" + ], + _: "id 21, present" + }, + "id 23, present" + ], + _: "id 3, present" + }, + "id 4, present" + ], + _: "id 1, present" + }, + "id 6, present" + ], + branch: [ + { + build: [ + { + job: [ + "id 27, present" + ], + repository: [ + "id 11, present", + "id 10, present" + ], + tag: [ + "id 7, present" + ], + branch: [ + "id 78, present" + ], + stage: [ + "id 26, present" + ], + _: "id 26, present" + }, + "id 28, present" + ], + commit: [ + { + build: [ + { + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ], + _: "id 31, present" + }, + "id 33, present" + ], + job: [ + { + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ], + _: "id 34, present" + }, + "id 35, present" + ], + request: [ + { + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ], + _: "id 39, present" + }, + "id 40, present" + ], + build: [ + { + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ], + _: "id 36, present" + }, + "id 38, present" + ], + _: "id 5, present" + }, + "id 6, present" + ], + _: "id 213, present" + }, + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + log: [ + "id 9, present", + "id 10, present" + ], + annotation: [ + "id 9, present", + "id 10, present" + ], + queueable_job: [ + "id 9, present", + "id 10, present" + ], + _: "id 29, present" + }, + "id 30, present" + ], + request: [ + { + abuse: [ + "id 7, present", + "id 8, present" + ], + message: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + log: [ + "id 15, present", + "id 16, present" + ], + annotation: [ + "id 15, present", + "id 16, present" + ], + queueable_job: [ + "id 15, present", + "id 16, present" + ], + _: "id 44, present" + }, + "id 45, present" + ], + build: [ + { + job: [ + "id 42, present" + ], + repository: [ + "id 17, present", + "id 16, present" + ], + tag: [ + "id 10, present" + ], + branch: [ + "id 81, present" + ], + stage: [ + "id 29, present" + ], + _: "id 41, present" + }, + "id 43, present" + ], + _: "id 7, present" + }, + "id 8, present" + ], + _: "id 77, present" + }, + "id 82, present" + ], + stage: [ + { + job: [ + "id 2, removed", + "id 3, removed" + ], + _: "id 20, removed" + }, + { + job: [ + "id 4, removed", + "id 5, removed" + ], + _: "id 21, removed" + } + ], + _: "id 1, removed" + }, + "id 50, removed" + ], + request: [ + { + abuse: [ + "id 9, removed", + "id 10, removed" + ], + message: [ + "id 9, removed", + "id 10, removed" + ], + job: [ + { + log: [ + "id 17, removed", + "id 18, removed" + ], + annotation: [ + "id 17, removed", + "id 18, removed" + ], + queueable_job: [ + "id 17, removed", + "id 18, removed" + ], + _: "id 54, removed" + }, + "id 55, removed" + ], + build: [ + { + job: [ + "id 52, removed" + ], + repository: [ + "id 23, present", + "id 22, present" + ], + tag: [ + "id 13, present" + ], + branch: [ + "id 85, present" + ], + stage: [ + "id 30, removed" + ], + _: "id 51, removed" + }, + "id 53, removed" + ], + _: "id 11, removed" + }, + "id 12, removed" + ], + job: [ + { + log: [ + "id 19, removed", + "id 20, removed" + ], + annotation: [ + "id 19, removed", + "id 20, removed" + ], + queueable_job: [ + "id 19, removed", + "id 20, removed" + ], + _: "id 56, removed" + }, + "id 57, removed" + ], + branch: [ + { + build: [ + { + job: [ + "id 59, removed" + ], + repository: [ + "id 25, present", + "id 24, present" + ], + tag: [ + "id 14, present" + ], + branch: [ + "id 87, present" + ], + stage: [ + "id 31, removed" + ], + _: "id 58, removed" + }, + "id 60, removed" + ], + commit: [ + { + build: [ + { + job: [ + "id 64, removed" + ], + repository: [ + "id 27, present", + "id 26, present" + ], + tag: [ + "id 15, present" + ], + branch: [ + "id 88, present" + ], + stage: [ + "id 32, removed" + ], + _: "id 63, removed" + }, + "id 65, removed" + ], + job: [ + { + log: [ + "id 23, removed", + "id 24, removed" + ], + annotation: [ + "id 23, removed", + "id 24, removed" + ], + queueable_job: [ + "id 23, removed", + "id 24, removed" + ], + _: "id 66, removed" + }, + "id 67, removed" + ], + request: [ + { + abuse: [ + "id 11, removed", + "id 12, removed" + ], + message: [ + "id 11, removed", + "id 12, removed" + ], + job: [ + { + log: [ + "id 25, removed", + "id 26, removed" + ], + annotation: [ + "id 25, removed", + "id 26, removed" + ], + queueable_job: [ + "id 25, removed", + "id 26, removed" + ], + _: "id 71, removed" + }, + "id 72, removed" + ], + build: [ + { + job: [ + "id 69, removed" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, removed" + ], + _: "id 68, removed" + }, + "id 70, removed" + ], + _: "id 13, removed" + }, + "id 14, removed" + ], + _: "id 217, removed" + }, + "id 218, removed" + ], + cron: [ + "id 3, removed", + "id 4, removed" + ], + job: [ + { + log: [ + "id 21, removed", + "id 22, removed" + ], + annotation: [ + "id 21, removed", + "id 22, removed" + ], + queueable_job: [ + "id 21, removed", + "id 22, removed" + ], + _: "id 61, removed" + }, + "id 62, removed" + ], + request: [ + { + abuse: [ + "id 13, removed", + "id 14, removed" + ], + message: [ + "id 13, removed", + "id 14, removed" + ], + job: [ + { + log: [ + "id 27, removed", + "id 28, removed" + ], + annotation: [ + "id 27, removed", + "id 28, removed" + ], + queueable_job: [ + "id 27, removed", + "id 28, removed" + ], + _: "id 76, removed" + }, + "id 77, removed" + ], + build: [ + { + job: [ + "id 74, removed" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, removed" + ], + _: "id 73, removed" + }, + "id 75, removed" + ], + _: "id 15, removed" + }, + "id 16, removed" + ], + _: "id 86, removed" + }, + "id 91, removed" + ], + ssl_key: [ + "id 33, removed", + "id 34, removed" + ], + commit: [ + { + build: [ + { + job: [ + "id 79, removed" + ], + repository: [ + "id 33, present", + "id 32, present" + ], + tag: [ + "id 18, present" + ], + branch: [ + "id 92, present" + ], + stage: [ + "id 35, removed" + ], + _: "id 78, removed" + }, + "id 80, removed" + ], + job: [ + { + log: [ + "id 29, removed", + "id 30, removed" + ], + annotation: [ + "id 29, removed", + "id 30, removed" + ], + queueable_job: [ + "id 29, removed", + "id 30, removed" + ], + _: "id 81, removed" + }, + "id 82, removed" + ], + request: [ + { + abuse: [ + "id 15, removed", + "id 16, removed" + ], + message: [ + "id 15, removed", + "id 16, removed" + ], + job: [ + { + log: [ + "id 31, removed", + "id 32, removed" + ], + annotation: [ + "id 31, removed", + "id 32, removed" + ], + queueable_job: [ + "id 31, removed", + "id 32, removed" + ], + _: "id 86, removed" + }, + "id 87, removed" + ], + build: [ + { + job: [ + "id 84, removed" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, removed" + ], + _: "id 83, removed" + }, + "id 85, removed" + ], + _: "id 17, removed" + }, + "id 18, removed" + ], + _: "id 219, removed" + }, + "id 220, removed" + ], + permission: [ + "id 3, removed", + "id 4, removed" + ], + star: [ + "id 3, removed", + "id 4, removed" + ], + pull_request: [ + { + request: [ + { + abuse: [ + "id 25, removed", + "id 26, removed" + ], + message: [ + "id 25, removed", + "id 26, removed" + ], + job: [ + { + log: [ + "id 49, removed", + "id 50, removed" + ], + annotation: [ + "id 49, removed", + "id 50, removed" + ], + queueable_job: [ + "id 49, removed", + "id 50, removed" + ], + _: "id 141, removed" + }, + "id 142, removed" + ], + build: [ + { + job: [ + "id 139, removed" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, removed" + ], + _: "id 138, removed" + }, + "id 140, removed" + ], + _: "id 29, removed" + }, + "id 30, removed" + ], + build: [ + { + job: [ + { + log: [ + "id 33, removed", + "id 34, removed" + ], + annotation: [ + "id 33, removed", + "id 34, removed" + ], + queueable_job: [ + "id 33, removed", + "id 34, removed" + ], + _: "id 93, removed" + }, + "id 94, removed" + ], + repository: [ + { + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 6, present" + ], + star: [ + "id 6, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ], + _: "id 54, present" + }, + "id 55, present", + { + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], + job: [ + "id 134, present" + ], + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 5, present" + ], + star: [ + "id 5, present" + ], + pull_request: [ + "id 4, present" + ], + tag: [ + "id 30, present" + ], + _: "id 52, present" + }, + "id 53, present" + ], + tag: [ + { + build: [ + { + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ], + _: "id 95, present" + }, + "id 97, present" + ], + commit: [ + { + build: [ + { + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ], + _: "id 98, present" + }, + "id 100, present" + ], + job: [ + { + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ], + _: "id 101, present" + }, + "id 102, present" + ], + request: [ + { + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ], + _: "id 106, present" + }, + "id 107, present" + ], + build: [ + { + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ], + _: "id 103, present" + }, + "id 105, present" + ], + _: "id 19, present" + }, + "id 20, present" + ], + _: "id 221, present" + }, + "id 222, present" + ], + request: [ + { + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ], + _: "id 111, present" + }, + "id 112, present" + ], + build: [ + { + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ], + _: "id 108, present" + }, + "id 110, present" + ], + _: "id 21, present" + }, + "id 22, present" + ], + _: "id 20, present" + }, + "id 25, present" + ], + branch: [ + { + build: [ + { + job: [ + "id 114, present" + ], + repository: [ + "id 45, present", + "id 44, present" + ], + tag: [ + "id 26, present" + ], + branch: [ + "id 99, present" + ], + stage: [ + "id 43, present" + ], + _: "id 113, present" + }, + "id 115, present" + ], + commit: [ + { + build: [ + { + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ], + _: "id 118, present" + }, + "id 120, present" + ], + job: [ + { + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ], + _: "id 121, present" + }, + "id 122, present" + ], + request: [ + { + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ], + _: "id 126, present" + }, + "id 127, present" + ], + build: [ + { + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ], + _: "id 123, present" + }, + "id 125, present" + ], + _: "id 23, present" + }, + "id 24, present" + ], + _: "id 223, present" + }, + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + log: [ + "id 41, present", + "id 42, present" + ], + annotation: [ + "id 41, present", + "id 42, present" + ], + queueable_job: [ + "id 41, present", + "id 42, present" + ], + _: "id 116, present" + }, + "id 117, present" + ], + request: [ + { + abuse: [ + "id 23, present", + "id 24, present" + ], + message: [ + "id 23, present", + "id 24, present" + ], + job: [ + { + log: [ + "id 47, present", + "id 48, present" + ], + annotation: [ + "id 47, present", + "id 48, present" + ], + queueable_job: [ + "id 47, present", + "id 48, present" + ], + _: "id 131, present" + }, + "id 132, present" + ], + build: [ + { + job: [ + "id 129, present" + ], + repository: [ + "id 51, present", + "id 50, present" + ], + tag: [ + "id 29, present" + ], + branch: [ + "id 102, present" + ], + stage: [ + "id 46, present" + ], + _: "id 128, present" + }, + "id 130, present" + ], + _: "id 25, present" + }, + "id 26, present" + ], + _: "id 98, present" + }, + "id 103, present" + ], + stage: [ + { + job: [ + "id 89, removed", + "id 90, removed" + ], + _: "id 37, removed" + }, + { + job: [ + "id 91, removed", + "id 92, removed" + ], + _: "id 38, removed" + } + ], + _: "id 88, removed" + }, + "id 137, removed" + ], + _: "id 3, removed" + }, + "id 6, removed" + ], + tag: [ + { + build: [ + { + job: [ + "id 144, removed" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, removed" + ], + _: "id 143, removed" + }, + "id 145, removed" + ], + commit: [ + { + build: [ + { + job: [ + "id 147, removed" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, removed" + ], + _: "id 146, removed" + }, + "id 148, removed" + ], + job: [ + { + log: [ + "id 51, removed", + "id 52, removed" + ], + annotation: [ + "id 51, removed", + "id 52, removed" + ], + queueable_job: [ + "id 51, removed", + "id 52, removed" + ], + _: "id 149, removed" + }, + "id 150, removed" + ], + request: [ + { + abuse: [ + "id 27, removed", + "id 28, removed" + ], + message: [ + "id 27, removed", + "id 28, removed" + ], + job: [ + { + log: [ + "id 53, removed", + "id 54, removed" + ], + annotation: [ + "id 53, removed", + "id 54, removed" + ], + queueable_job: [ + "id 53, removed", + "id 54, removed" + ], + _: "id 154, removed" + }, + "id 155, removed" + ], + build: [ + { + job: [ + "id 152, removed" + ], + repository: [ + "id 63, present", + "id 62, present" + ], + tag: [ + "id 36, present" + ], + branch: [ + "id 109, present" + ], + stage: [ + "id 50, removed" + ], + _: "id 151, removed" + }, + "id 153, removed" + ], + _: "id 31, removed" + }, + "id 32, removed" + ], + _: "id 227, removed" + }, + "id 228, removed" + ], + request: [ + { + abuse: [ + "id 29, removed", + "id 30, removed" + ], + message: [ + "id 29, removed", + "id 30, removed" + ], + job: [ + { + log: [ + "id 55, removed", + "id 56, removed" + ], + annotation: [ + "id 55, removed", + "id 56, removed" + ], + queueable_job: [ + "id 55, removed", + "id 56, removed" + ], + _: "id 159, removed" + }, + "id 160, removed" + ], + build: [ + { + job: [ + "id 157, removed" + ], + repository: [ + "id 65, present", + "id 64, present" + ], + tag: [ + "id 37, present" + ], + branch: [ + "id 110, present" + ], + stage: [ + "id 51, removed" + ], + _: "id 156, removed" + }, + "id 158, removed" + ], + _: "id 33, removed" + }, + "id 34, removed" + ], + _: "id 33, removed" + }, + "id 38, removed" + ], + _: "id 1, removed" + } + end +end \ No newline at end of file diff --git a/spec/support/utils.rb b/spec/support/utils.rb index 2c15ad6..9276c65 100644 --- a/spec/support/utils.rb +++ b/spec/support/utils.rb @@ -27,3 +27,21 @@ def expect_method_calls_on(cl, method, call_with, options) expect(call_with).to match_array(calls_args) end end + +def nullifies_all_orphaned_builds_dependencies? + dependencies_to_check = Build.all.map do |build| + build.default_dependencies_to_nullify + end.flatten(1) + + yield + + dependencies_to_check.reject! { |d| d.removed? } + + build_ids_to_check = dependencies_to_check.map do |d| + [d.try(:current_build_id), d.try(:last_build_id)] + end.flatten(1) + + build_ids_to_check.compact! + referenced_builds = build_ids_to_check.map { |id| Build.find_by(id: id) } + !referenced_builds.include?(nil) +end \ No newline at end of file From d33bd5cacf338d4cdff6de52d8c4994ce935d61e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Thu, 11 Nov 2021 23:50:09 +0100 Subject: [PATCH 72/88] removing users and orgs with new way of testing --- lib/ids_of_all_dependencies.rb | 25 +- spec/backup/remove_specified_spec.rb | 98 +- .../remove_org_with_dependencies.rb | 2811 ++++++++++++++++ .../remove_repo_with_dependencies.rb | 384 +-- .../remove_user_with_dependencies.rb | 2831 +++++++++++++++++ 5 files changed, 5892 insertions(+), 257 deletions(-) create mode 100644 spec/support/expected_dependency_trees/remove_org_with_dependencies.rb create mode 100644 spec/support/expected_dependency_trees/remove_user_with_dependencies.rb diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 9eb1f9a..fdd17c3 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -73,11 +73,13 @@ def status_tree end def status_tree_condensed + @hash_for_duplication_check = IdHash.new result = status_tree.do_recursive do |tree| - tree.each do |key, array| + tree.each do |name, array| next unless array.class == Array new_array = array.map do |subtree| + next subtree.root_duplicate_summary if is_duplicate?(name, subtree) next subtree if subtree.class != Tree || subtree.size > 2 subtree.root_summary @@ -92,13 +94,34 @@ def status_tree_condensed tree[:_] = tree.root_summary tree.delete(:id) tree.delete(:status) + tree.last_to_beginning! end end + def is_duplicate?(name, tree) + if @hash_for_duplication_check[name]&.include?(tree[:id]) + true + else + @hash_for_duplication_check.add(name, tree[:id]) + false + end + end + + def last_to_beginning! + arr = self.to_a + arr.unshift(arr.pop) + self.clear + self.merge!(arr.to_h) + end + def root_summary "id #{self[:id]}, #{self[:status]}" end + def root_duplicate_summary + root_summary + ", duplicate" + end + def deep_tree_clone hash = self.clone.map do |key, array| next [key, array] unless array.class == Array diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 76d63d7..077c341 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -9,6 +9,8 @@ require 'support/before_tests' require 'support/utils' require 'support/expected_dependency_trees/remove_repo_with_dependencies' +require 'support/expected_dependency_trees/remove_org_with_dependencies' +require 'support/expected_dependency_trees/remove_user_with_dependencies' require 'pry' require 'byebug' @@ -291,40 +293,24 @@ def get_expected_files(directory, datetime) end shared_context 'removing user with dependencies' do - it 'removes user with all his dependencies with proper exceptions' do + it 'removes user with all its dependencies with proper exceptions' do + dependency_tree = user.dependency_tree + remove_specified.remove_user_with_dependencies(user.id) + expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_user_with_dependencies) + end + + it 'removes intended number of rows from the database' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-247) - .and change { Log.all.size }.by(-30) - .and change { Job.all.size }.by(-30) - .and change { Build.all.size }.by(-18) - .and change { Request.all.size }.by(-18) - .and change { Repository.all.size }.by(-2) - .and change { Branch.all.size }.by(-2) - .and change { Tag.all.size }.by(-2) - .and change { Commit.all.size }.by(-6) - .and change { Cron.all.size }.by(-2) - .and change { PullRequest.all.size }.by(-2) - .and change { SslKey.all.size }.by(-2) - .and change { Stage.all.size }.by(0) - .and change { Star.all.size }.by(-4) - .and change { Permission.all.size }.by(-4) - .and change { Message.all.size }.by(-18) - .and change { Abuse.all.size }.by(-20) - .and change { Annotation.all.size }.by(-30) - .and change { QueueableJob.all.size }.by(-30) - .and change { Email.all.size }.by(-2) - .and change { Invoice.all.size }.by(-4) - .and change { Membership.all.size }.by(-2) - .and change { Organization.all.size }.by(0) - .and change { OwnerGroup.all.size }.by(-2) - .and change { Broadcast.all.size }.by(-2) - .and change { Subscription.all.size }.by(-2) - .and change { Token.all.size }.by(-2) - .and change { TrialAllowance.all.size }.by(-6) - .and change { Trial.all.size }.by(-2) - .and change { UserBetaFeature.all.size }.by(-2) - .and change { User.all.size }.by(-1) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-349) + end + + it 'nullifies orphaned builds dependencies' do + expect( + nullifies_all_orphaned_builds_dependencies? do + remove_specified.remove_user_with_dependencies(user.id) + end + ).to eql(true) end end @@ -392,39 +378,23 @@ def get_expected_files(directory, datetime) shared_context 'removing organization with dependencies' do it 'removes organization with all its dependencies with proper exceptions' do + dependency_tree = organization.dependency_tree + remove_specified.remove_org_with_dependencies(organization.id) + expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_org_with_dependencies) + end + + it 'removes intended number of rows from the database' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-237) - .and change { Log.all.size }.by(-30) - .and change { Job.all.size }.by(-30) - .and change { Build.all.size }.by(-18) - .and change { Request.all.size }.by(-18) - .and change { Repository.all.size }.by(-2) - .and change { Branch.all.size }.by(-2) - .and change { Tag.all.size }.by(-2) - .and change { Commit.all.size }.by(-6) - .and change { Cron.all.size }.by(-2) - .and change { PullRequest.all.size }.by(-2) - .and change { SslKey.all.size }.by(-2) - .and change { Stage.all.size }.by(0) - .and change { Star.all.size }.by(-2) - .and change { Permission.all.size }.by(-2) - .and change { Message.all.size }.by(-18) - .and change { Abuse.all.size }.by(-20) - .and change { Annotation.all.size }.by(-30) - .and change { QueueableJob.all.size }.by(-30) - .and change { Email.all.size }.by(0) - .and change { Invoice.all.size }.by(-4) - .and change { Membership.all.size }.by(-2) - .and change { Organization.all.size }.by(-1) - .and change { OwnerGroup.all.size }.by(-2) - .and change { Broadcast.all.size }.by(-2) - .and change { Subscription.all.size }.by(-2) - .and change { Token.all.size }.by(0) - .and change { TrialAllowance.all.size }.by(-6) - .and change { Trial.all.size }.by(-2) - .and change { UserBetaFeature.all.size }.by(0) - .and change { User.all.size }.by(0) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-339) + end + + it 'nullifies orphaned builds dependencies' do + expect( + nullifies_all_orphaned_builds_dependencies? do + remove_specified.remove_org_with_dependencies(organization.id) + end + ).to eql(true) end end @@ -496,7 +466,7 @@ def get_expected_files(directory, datetime) expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_repo_with_dependencies) end - it 'removes intended number of rows from database' do + it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_with_dependencies(repository.id) }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-239) diff --git a/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb new file mode 100644 index 0000000..ccb956e --- /dev/null +++ b/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb @@ -0,0 +1,2811 @@ +class ExpectedDependencyTrees + def self.remove_org_with_dependencies + { + _: "id 1, removed", + build: [ + { + _: "id 161, removed", + job: [ + { + _: "id 166, removed", + log: [ + "id 57, removed", + "id 58, removed" + ], + annotation: [ + "id 57, removed", + "id 58, removed" + ], + queueable_job: [ + "id 57, removed", + "id 58, removed" + ] + }, + "id 167, removed" + ], + repository: [ + { + _: "id 85, present", + build: [ + "id 208, present" + ], + request: [ + "id 44, present" + ], + job: [ + "id 209, present" + ], + branch: [ + "id 122, present" + ], + ssl_key: [ + "id 38, present" + ], + commit: [ + "id 234, present" + ], + permission: [ + "id 8, present" + ], + star: [ + "id 8, present" + ], + pull_request: [ + "id 8, present" + ], + tag: [ + "id 50, present" + ] + }, + "id 86, present", + { + _: "id 83, present", + build: [ + "id 206, present" + ], + request: [ + "id 43, present" + ], + job: [ + "id 207, present" + ], + branch: [ + "id 121, present" + ], + ssl_key: [ + "id 37, present" + ], + commit: [ + "id 233, present" + ], + permission: [ + "id 7, present" + ], + star: [ + "id 7, present" + ], + pull_request: [ + "id 7, present" + ], + tag: [ + "id 49, present" + ] + }, + "id 84, present" + ], + tag: [ + { + _: "id 39, present", + build: [ + { + _: "id 168, present", + job: [ + "id 169, present" + ], + repository: [ + "id 68, present", + "id 67, present" + ], + tag: [ + "id 40, present" + ], + branch: [ + "id 111, present" + ], + stage: [ + "id 54, present" + ] + }, + "id 170, present" + ], + commit: [ + { + _: "id 229, present", + build: [ + { + _: "id 171, present", + job: [ + "id 172, present" + ], + repository: [ + "id 70, present", + "id 69, present" + ], + tag: [ + "id 41, present" + ], + branch: [ + "id 112, present" + ], + stage: [ + "id 55, present" + ] + }, + "id 173, present" + ], + job: [ + { + _: "id 174, present", + log: [ + "id 59, present", + "id 60, present" + ], + annotation: [ + "id 59, present", + "id 60, present" + ], + queueable_job: [ + "id 59, present", + "id 60, present" + ] + }, + "id 175, present" + ], + request: [ + { + _: "id 35, present", + abuse: [ + "id 31, present", + "id 32, present" + ], + message: [ + "id 31, present", + "id 32, present" + ], + job: [ + { + _: "id 179, present", + log: [ + "id 61, present", + "id 62, present" + ], + annotation: [ + "id 61, present", + "id 62, present" + ], + queueable_job: [ + "id 61, present", + "id 62, present" + ] + }, + "id 180, present" + ], + build: [ + { + _: "id 176, present", + job: [ + "id 177, present" + ], + repository: [ + "id 72, present", + "id 71, present" + ], + tag: [ + "id 42, present" + ], + branch: [ + "id 113, present" + ], + stage: [ + "id 56, present" + ] + }, + "id 178, present" + ] + }, + "id 36, present" + ] + }, + "id 230, present" + ], + request: [ + { + _: "id 37, present", + abuse: [ + "id 33, present", + "id 34, present" + ], + message: [ + "id 33, present", + "id 34, present" + ], + job: [ + { + _: "id 184, present", + log: [ + "id 63, present", + "id 64, present" + ], + annotation: [ + "id 63, present", + "id 64, present" + ], + queueable_job: [ + "id 63, present", + "id 64, present" + ] + }, + "id 185, present" + ], + build: [ + { + _: "id 181, present", + job: [ + "id 182, present" + ], + repository: [ + "id 74, present", + "id 73, present" + ], + tag: [ + "id 43, present" + ], + branch: [ + "id 114, present" + ], + stage: [ + "id 57, present" + ] + }, + "id 183, present" + ] + }, + "id 38, present" + ] + }, + "id 44, present" + ], + branch: [ + { + _: "id 115, present", + build: [ + { + _: "id 186, present", + job: [ + "id 187, present" + ], + repository: [ + "id 76, present", + "id 75, present" + ], + tag: [ + "id 45, present" + ], + branch: [ + "id 116, present" + ], + stage: [ + "id 58, present" + ] + }, + "id 188, present" + ], + commit: [ + { + _: "id 231, present", + build: [ + { + _: "id 191, present", + job: [ + "id 192, present" + ], + repository: [ + "id 78, present", + "id 77, present" + ], + tag: [ + "id 46, present" + ], + branch: [ + "id 117, present" + ], + stage: [ + "id 59, present" + ] + }, + "id 193, present" + ], + job: [ + { + _: "id 194, present", + log: [ + "id 67, present", + "id 68, present" + ], + annotation: [ + "id 67, present", + "id 68, present" + ], + queueable_job: [ + "id 67, present", + "id 68, present" + ] + }, + "id 195, present" + ], + request: [ + { + _: "id 39, present", + abuse: [ + "id 35, present", + "id 36, present" + ], + message: [ + "id 35, present", + "id 36, present" + ], + job: [ + { + _: "id 199, present", + log: [ + "id 69, present", + "id 70, present" + ], + annotation: [ + "id 69, present", + "id 70, present" + ], + queueable_job: [ + "id 69, present", + "id 70, present" + ] + }, + "id 200, present" + ], + build: [ + { + _: "id 196, present", + job: [ + "id 197, present" + ], + repository: [ + "id 80, present", + "id 79, present" + ], + tag: [ + "id 47, present" + ], + branch: [ + "id 118, present" + ], + stage: [ + "id 60, present" + ] + }, + "id 198, present" + ] + }, + "id 40, present" + ] + }, + "id 232, present" + ], + cron: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + _: "id 189, present", + log: [ + "id 65, present", + "id 66, present" + ], + annotation: [ + "id 65, present", + "id 66, present" + ], + queueable_job: [ + "id 65, present", + "id 66, present" + ] + }, + "id 190, present" + ], + request: [ + { + _: "id 41, present", + abuse: [ + "id 37, present", + "id 38, present" + ], + message: [ + "id 37, present", + "id 38, present" + ], + job: [ + { + _: "id 204, present", + log: [ + "id 71, present", + "id 72, present" + ], + annotation: [ + "id 71, present", + "id 72, present" + ], + queueable_job: [ + "id 71, present", + "id 72, present" + ] + }, + "id 205, present" + ], + build: [ + { + _: "id 201, present", + job: [ + "id 202, present" + ], + repository: [ + "id 82, present", + "id 81, present" + ], + tag: [ + "id 48, present" + ], + branch: [ + "id 119, present" + ], + stage: [ + "id 61, present" + ] + }, + "id 203, present" + ] + }, + "id 42, present" + ] + }, + "id 120, present" + ], + stage: [ + { + _: "id 52, removed", + job: [ + "id 162, removed", + "id 163, removed" + ] + }, + { + _: "id 53, removed", + job: [ + "id 164, removed", + "id 165, removed" + ] + } + ] + }, + { + _: "id 210, removed", + repository: [ + "id 1, removed, duplicate" + ] + }, + { + _: "id 211, removed", + job: [ + { + _: "id 216, removed", + log: [ + "id 73, removed", + "id 74, removed" + ], + annotation: [ + "id 73, removed", + "id 74, removed" + ], + queueable_job: [ + "id 73, removed", + "id 74, removed" + ] + }, + "id 217, removed" + ], + repository: [ + { + _: "id 105, present", + build: [ + "id 258, present" + ], + request: [ + "id 54, present" + ], + job: [ + "id 259, present" + ], + branch: [ + "id 134, present" + ], + ssl_key: [ + "id 40, present" + ], + commit: [ + "id 240, present" + ], + permission: [ + "id 10, present" + ], + star: [ + "id 10, present" + ], + pull_request: [ + "id 10, present" + ], + tag: [ + "id 62, present" + ] + }, + "id 106, present", + { + _: "id 103, present", + build: [ + "id 256, present" + ], + request: [ + "id 53, present" + ], + job: [ + "id 257, present" + ], + branch: [ + "id 133, present" + ], + ssl_key: [ + "id 39, present" + ], + commit: [ + "id 239, present" + ], + permission: [ + "id 9, present" + ], + star: [ + "id 9, present" + ], + pull_request: [ + "id 9, present" + ], + tag: [ + "id 61, present" + ] + }, + "id 104, present" + ], + tag: [ + { + _: "id 51, present", + build: [ + { + _: "id 218, present", + job: [ + "id 219, present" + ], + repository: [ + "id 88, present", + "id 87, present" + ], + tag: [ + "id 52, present" + ], + branch: [ + "id 123, present" + ], + stage: [ + "id 64, present" + ] + }, + "id 220, present" + ], + commit: [ + { + _: "id 235, present", + build: [ + { + _: "id 221, present", + job: [ + "id 222, present" + ], + repository: [ + "id 90, present", + "id 89, present" + ], + tag: [ + "id 53, present" + ], + branch: [ + "id 124, present" + ], + stage: [ + "id 65, present" + ] + }, + "id 223, present" + ], + job: [ + { + _: "id 224, present", + log: [ + "id 75, present", + "id 76, present" + ], + annotation: [ + "id 75, present", + "id 76, present" + ], + queueable_job: [ + "id 75, present", + "id 76, present" + ] + }, + "id 225, present" + ], + request: [ + { + _: "id 45, present", + abuse: [ + "id 39, present", + "id 40, present" + ], + message: [ + "id 39, present", + "id 40, present" + ], + job: [ + { + _: "id 229, present", + log: [ + "id 77, present", + "id 78, present" + ], + annotation: [ + "id 77, present", + "id 78, present" + ], + queueable_job: [ + "id 77, present", + "id 78, present" + ] + }, + "id 230, present" + ], + build: [ + { + _: "id 226, present", + job: [ + "id 227, present" + ], + repository: [ + "id 92, present", + "id 91, present" + ], + tag: [ + "id 54, present" + ], + branch: [ + "id 125, present" + ], + stage: [ + "id 66, present" + ] + }, + "id 228, present" + ] + }, + "id 46, present" + ] + }, + "id 236, present" + ], + request: [ + { + _: "id 47, present", + abuse: [ + "id 41, present", + "id 42, present" + ], + message: [ + "id 41, present", + "id 42, present" + ], + job: [ + { + _: "id 234, present", + log: [ + "id 79, present", + "id 80, present" + ], + annotation: [ + "id 79, present", + "id 80, present" + ], + queueable_job: [ + "id 79, present", + "id 80, present" + ] + }, + "id 235, present" + ], + build: [ + { + _: "id 231, present", + job: [ + "id 232, present" + ], + repository: [ + "id 94, present", + "id 93, present" + ], + tag: [ + "id 55, present" + ], + branch: [ + "id 126, present" + ], + stage: [ + "id 67, present" + ] + }, + "id 233, present" + ] + }, + "id 48, present" + ] + }, + "id 56, present" + ], + branch: [ + { + _: "id 127, present", + build: [ + { + _: "id 236, present", + job: [ + "id 237, present" + ], + repository: [ + "id 96, present", + "id 95, present" + ], + tag: [ + "id 57, present" + ], + branch: [ + "id 128, present" + ], + stage: [ + "id 68, present" + ] + }, + "id 238, present" + ], + commit: [ + { + _: "id 237, present", + build: [ + { + _: "id 241, present", + job: [ + "id 242, present" + ], + repository: [ + "id 98, present", + "id 97, present" + ], + tag: [ + "id 58, present" + ], + branch: [ + "id 129, present" + ], + stage: [ + "id 69, present" + ] + }, + "id 243, present" + ], + job: [ + { + _: "id 244, present", + log: [ + "id 83, present", + "id 84, present" + ], + annotation: [ + "id 83, present", + "id 84, present" + ], + queueable_job: [ + "id 83, present", + "id 84, present" + ] + }, + "id 245, present" + ], + request: [ + { + _: "id 49, present", + abuse: [ + "id 43, present", + "id 44, present" + ], + message: [ + "id 43, present", + "id 44, present" + ], + job: [ + { + _: "id 249, present", + log: [ + "id 85, present", + "id 86, present" + ], + annotation: [ + "id 85, present", + "id 86, present" + ], + queueable_job: [ + "id 85, present", + "id 86, present" + ] + }, + "id 250, present" + ], + build: [ + { + _: "id 246, present", + job: [ + "id 247, present" + ], + repository: [ + "id 100, present", + "id 99, present" + ], + tag: [ + "id 59, present" + ], + branch: [ + "id 130, present" + ], + stage: [ + "id 70, present" + ] + }, + "id 248, present" + ] + }, + "id 50, present" + ] + }, + "id 238, present" + ], + cron: [ + "id 9, present", + "id 10, present" + ], + job: [ + { + _: "id 239, present", + log: [ + "id 81, present", + "id 82, present" + ], + annotation: [ + "id 81, present", + "id 82, present" + ], + queueable_job: [ + "id 81, present", + "id 82, present" + ] + }, + "id 240, present" + ], + request: [ + { + _: "id 51, present", + abuse: [ + "id 45, present", + "id 46, present" + ], + message: [ + "id 45, present", + "id 46, present" + ], + job: [ + { + _: "id 254, present", + log: [ + "id 87, present", + "id 88, present" + ], + annotation: [ + "id 87, present", + "id 88, present" + ], + queueable_job: [ + "id 87, present", + "id 88, present" + ] + }, + "id 255, present" + ], + build: [ + { + _: "id 251, present", + job: [ + "id 252, present" + ], + repository: [ + "id 102, present", + "id 101, present" + ], + tag: [ + "id 60, present" + ], + branch: [ + "id 131, present" + ], + stage: [ + "id 71, present" + ] + }, + "id 253, present" + ] + }, + "id 52, present" + ] + }, + "id 132, present" + ], + stage: [ + { + _: "id 62, removed", + job: [ + "id 212, removed", + "id 213, removed" + ] + }, + { + _: "id 63, removed", + job: [ + "id 214, removed", + "id 215, removed" + ] + } + ] + }, + { + _: "id 260, removed", + repository: [ + "id 1, removed, duplicate" + ] + } + ], + repository: [ + { + _: "id 1, removed", + build: [ + { + _: "id 1, removed", + job: [ + { + _: "id 6, removed", + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ] + }, + "id 7, removed" + ], + repository: [ + { + _: "id 20, present", + build: [ + "id 48, present" + ], + request: [ + "id 10, present" + ], + job: [ + "id 49, present" + ], + branch: [ + "id 84, present" + ], + ssl_key: [ + "id 32, present" + ], + commit: [ + "id 216, present" + ], + permission: [ + "id 2, present" + ], + star: [ + "id 2, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" + ] + }, + "id 21, present", + { + _: "id 18, present", + build: [ + "id 46, present" + ], + request: [ + "id 9, present" + ], + job: [ + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 1, present" + ], + star: [ + "id 1, present" + ], + pull_request: [ + "id 1, present" + ], + tag: [ + "id 11, present" + ] + }, + "id 19, present" + ], + tag: [ + { + _: "id 1, present", + build: [ + { + _: "id 8, present", + job: [ + "id 9, present" + ], + repository: [ + "id 3, present", + "id 2, present" + ], + tag: [ + "id 2, present" + ], + branch: [ + "id 73, present" + ], + stage: [ + "id 22, present" + ] + }, + "id 10, present" + ], + commit: [ + { + _: "id 211, present", + build: [ + { + _: "id 11, present", + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ] + }, + "id 13, present" + ], + job: [ + { + _: "id 14, present", + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" + ], + request: [ + { + _: "id 1, present", + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 19, present", + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + build: [ + { + _: "id 16, present", + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" + ] + }, + "id 212, present" + ], + request: [ + { + _: "id 3, present", + abuse: [ + "id 3, present", + "id 4, present" + ], + message: [ + "id 3, present", + "id 4, present" + ], + job: [ + { + _: "id 24, present", + log: [ + "id 7, present", + "id 8, present" + ], + annotation: [ + "id 7, present", + "id 8, present" + ], + queueable_job: [ + "id 7, present", + "id 8, present" + ] + }, + "id 25, present" + ], + build: [ + { + _: "id 21, present", + job: [ + "id 22, present" + ], + repository: [ + "id 9, present", + "id 8, present" + ], + tag: [ + "id 5, present" + ], + branch: [ + "id 76, present" + ], + stage: [ + "id 25, present" + ] + }, + "id 23, present" + ] + }, + "id 4, present" + ] + }, + "id 6, present" + ], + branch: [ + { + _: "id 77, present", + build: [ + { + _: "id 26, present", + job: [ + "id 27, present" + ], + repository: [ + "id 11, present", + "id 10, present" + ], + tag: [ + "id 7, present" + ], + branch: [ + "id 78, present" + ], + stage: [ + "id 26, present" + ] + }, + "id 28, present" + ], + commit: [ + { + _: "id 213, present", + build: [ + { + _: "id 31, present", + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ] + }, + "id 33, present" + ], + job: [ + { + _: "id 34, present", + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" + ], + request: [ + { + _: "id 5, present", + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 39, present", + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + build: [ + { + _: "id 36, present", + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" + ] + }, + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 29, present", + log: [ + "id 9, present", + "id 10, present" + ], + annotation: [ + "id 9, present", + "id 10, present" + ], + queueable_job: [ + "id 9, present", + "id 10, present" + ] + }, + "id 30, present" + ], + request: [ + { + _: "id 7, present", + abuse: [ + "id 7, present", + "id 8, present" + ], + message: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + _: "id 44, present", + log: [ + "id 15, present", + "id 16, present" + ], + annotation: [ + "id 15, present", + "id 16, present" + ], + queueable_job: [ + "id 15, present", + "id 16, present" + ] + }, + "id 45, present" + ], + build: [ + { + _: "id 41, present", + job: [ + "id 42, present" + ], + repository: [ + "id 17, present", + "id 16, present" + ], + tag: [ + "id 10, present" + ], + branch: [ + "id 81, present" + ], + stage: [ + "id 29, present" + ] + }, + "id 43, present" + ] + }, + "id 8, present" + ] + }, + "id 82, present" + ], + stage: [ + { + _: "id 20, removed", + job: [ + "id 2, removed", + "id 3, removed" + ] + }, + { + _: "id 21, removed", + job: [ + "id 4, removed", + "id 5, removed" + ] + } + ] + }, + "id 50, removed" + ], + request: [ + { + _: "id 11, removed", + abuse: [ + "id 9, removed", + "id 10, removed" + ], + message: [ + "id 9, removed", + "id 10, removed" + ], + job: [ + { + _: "id 54, removed", + log: [ + "id 17, removed", + "id 18, removed" + ], + annotation: [ + "id 17, removed", + "id 18, removed" + ], + queueable_job: [ + "id 17, removed", + "id 18, removed" + ] + }, + "id 55, removed" + ], + build: [ + { + _: "id 51, removed", + job: [ + "id 52, removed" + ], + repository: [ + "id 23, present", + "id 22, present" + ], + tag: [ + "id 13, present" + ], + branch: [ + "id 85, present" + ], + stage: [ + "id 30, removed" + ] + }, + "id 53, removed" + ] + }, + "id 12, removed" + ], + job: [ + { + _: "id 56, removed", + log: [ + "id 19, removed", + "id 20, removed" + ], + annotation: [ + "id 19, removed", + "id 20, removed" + ], + queueable_job: [ + "id 19, removed", + "id 20, removed" + ] + }, + "id 57, removed" + ], + branch: [ + { + _: "id 86, removed", + build: [ + { + _: "id 58, removed", + job: [ + "id 59, removed" + ], + repository: [ + "id 25, present", + "id 24, present" + ], + tag: [ + "id 14, present" + ], + branch: [ + "id 87, present" + ], + stage: [ + "id 31, removed" + ] + }, + "id 60, removed" + ], + commit: [ + { + _: "id 217, removed", + build: [ + { + _: "id 63, removed", + job: [ + "id 64, removed" + ], + repository: [ + "id 27, present", + "id 26, present" + ], + tag: [ + "id 15, present" + ], + branch: [ + "id 88, present" + ], + stage: [ + "id 32, removed" + ] + }, + "id 65, removed" + ], + job: [ + { + _: "id 66, removed", + log: [ + "id 23, removed", + "id 24, removed" + ], + annotation: [ + "id 23, removed", + "id 24, removed" + ], + queueable_job: [ + "id 23, removed", + "id 24, removed" + ] + }, + "id 67, removed" + ], + request: [ + { + _: "id 13, removed", + abuse: [ + "id 11, removed", + "id 12, removed" + ], + message: [ + "id 11, removed", + "id 12, removed" + ], + job: [ + { + _: "id 71, removed", + log: [ + "id 25, removed", + "id 26, removed" + ], + annotation: [ + "id 25, removed", + "id 26, removed" + ], + queueable_job: [ + "id 25, removed", + "id 26, removed" + ] + }, + "id 72, removed" + ], + build: [ + { + _: "id 68, removed", + job: [ + "id 69, removed" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, removed" + ] + }, + "id 70, removed" + ] + }, + "id 14, removed" + ] + }, + "id 218, removed" + ], + cron: [ + "id 3, removed", + "id 4, removed" + ], + job: [ + { + _: "id 61, removed", + log: [ + "id 21, removed", + "id 22, removed" + ], + annotation: [ + "id 21, removed", + "id 22, removed" + ], + queueable_job: [ + "id 21, removed", + "id 22, removed" + ] + }, + "id 62, removed" + ], + request: [ + { + _: "id 15, removed", + abuse: [ + "id 13, removed", + "id 14, removed" + ], + message: [ + "id 13, removed", + "id 14, removed" + ], + job: [ + { + _: "id 76, removed", + log: [ + "id 27, removed", + "id 28, removed" + ], + annotation: [ + "id 27, removed", + "id 28, removed" + ], + queueable_job: [ + "id 27, removed", + "id 28, removed" + ] + }, + "id 77, removed" + ], + build: [ + { + _: "id 73, removed", + job: [ + "id 74, removed" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, removed" + ] + }, + "id 75, removed" + ] + }, + "id 16, removed" + ] + }, + "id 91, removed" + ], + ssl_key: [ + "id 33, removed", + "id 34, removed" + ], + commit: [ + { + _: "id 219, removed", + build: [ + { + _: "id 78, removed", + job: [ + "id 79, removed" + ], + repository: [ + "id 33, present", + "id 32, present" + ], + tag: [ + "id 18, present" + ], + branch: [ + "id 92, present" + ], + stage: [ + "id 35, removed" + ] + }, + "id 80, removed" + ], + job: [ + { + _: "id 81, removed", + log: [ + "id 29, removed", + "id 30, removed" + ], + annotation: [ + "id 29, removed", + "id 30, removed" + ], + queueable_job: [ + "id 29, removed", + "id 30, removed" + ] + }, + "id 82, removed" + ], + request: [ + { + _: "id 17, removed", + abuse: [ + "id 15, removed", + "id 16, removed" + ], + message: [ + "id 15, removed", + "id 16, removed" + ], + job: [ + { + _: "id 86, removed", + log: [ + "id 31, removed", + "id 32, removed" + ], + annotation: [ + "id 31, removed", + "id 32, removed" + ], + queueable_job: [ + "id 31, removed", + "id 32, removed" + ] + }, + "id 87, removed" + ], + build: [ + { + _: "id 83, removed", + job: [ + "id 84, removed" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, removed" + ] + }, + "id 85, removed" + ] + }, + "id 18, removed" + ] + }, + "id 220, removed" + ], + permission: [ + "id 3, removed", + "id 4, removed" + ], + star: [ + "id 3, removed", + "id 4, removed" + ], + pull_request: [ + { + _: "id 3, removed", + request: [ + { + _: "id 29, removed", + abuse: [ + "id 25, removed", + "id 26, removed" + ], + message: [ + "id 25, removed", + "id 26, removed" + ], + job: [ + { + _: "id 141, removed", + log: [ + "id 49, removed", + "id 50, removed" + ], + annotation: [ + "id 49, removed", + "id 50, removed" + ], + queueable_job: [ + "id 49, removed", + "id 50, removed" + ] + }, + "id 142, removed" + ], + build: [ + { + _: "id 138, removed", + job: [ + "id 139, removed" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, removed" + ] + }, + "id 140, removed" + ] + }, + "id 30, removed" + ], + build: [ + { + _: "id 88, removed", + job: [ + { + _: "id 93, removed", + log: [ + "id 33, removed", + "id 34, removed" + ], + annotation: [ + "id 33, removed", + "id 34, removed" + ], + queueable_job: [ + "id 33, removed", + "id 34, removed" + ] + }, + "id 94, removed" + ], + repository: [ + { + _: "id 54, present", + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 6, present" + ], + star: [ + "id 6, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ] + }, + "id 55, present", + { + _: "id 52, present", + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], + job: [ + "id 134, present" + ], + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 5, present" + ], + star: [ + "id 5, present" + ], + pull_request: [ + "id 4, present" + ], + tag: [ + "id 30, present" + ] + }, + "id 53, present" + ], + tag: [ + { + _: "id 20, present", + build: [ + { + _: "id 95, present", + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ] + }, + "id 97, present" + ], + commit: [ + { + _: "id 221, present", + build: [ + { + _: "id 98, present", + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ] + }, + "id 100, present" + ], + job: [ + { + _: "id 101, present", + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + request: [ + { + _: "id 19, present", + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + _: "id 106, present", + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + build: [ + { + _: "id 103, present", + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" + ], + request: [ + { + _: "id 21, present", + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + _: "id 111, present", + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + build: [ + { + _: "id 108, present", + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" + ] + }, + "id 25, present" + ], + branch: [ + { + _: "id 98, present", + build: [ + { + _: "id 113, present", + job: [ + "id 114, present" + ], + repository: [ + "id 45, present", + "id 44, present" + ], + tag: [ + "id 26, present" + ], + branch: [ + "id 99, present" + ], + stage: [ + "id 43, present" + ] + }, + "id 115, present" + ], + commit: [ + { + _: "id 223, present", + build: [ + { + _: "id 118, present", + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ] + }, + "id 120, present" + ], + job: [ + { + _: "id 121, present", + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + request: [ + { + _: "id 23, present", + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + _: "id 126, present", + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + build: [ + { + _: "id 123, present", + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" + ] + }, + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 116, present", + log: [ + "id 41, present", + "id 42, present" + ], + annotation: [ + "id 41, present", + "id 42, present" + ], + queueable_job: [ + "id 41, present", + "id 42, present" + ] + }, + "id 117, present" + ], + request: [ + { + _: "id 25, present", + abuse: [ + "id 23, present", + "id 24, present" + ], + message: [ + "id 23, present", + "id 24, present" + ], + job: [ + { + _: "id 131, present", + log: [ + "id 47, present", + "id 48, present" + ], + annotation: [ + "id 47, present", + "id 48, present" + ], + queueable_job: [ + "id 47, present", + "id 48, present" + ] + }, + "id 132, present" + ], + build: [ + { + _: "id 128, present", + job: [ + "id 129, present" + ], + repository: [ + "id 51, present", + "id 50, present" + ], + tag: [ + "id 29, present" + ], + branch: [ + "id 102, present" + ], + stage: [ + "id 46, present" + ] + }, + "id 130, present" + ] + }, + "id 26, present" + ] + }, + "id 103, present" + ], + stage: [ + { + _: "id 37, removed", + job: [ + "id 89, removed", + "id 90, removed" + ] + }, + { + _: "id 38, removed", + job: [ + "id 91, removed", + "id 92, removed" + ] + } + ] + }, + "id 137, removed" + ] + }, + "id 6, removed" + ], + tag: [ + { + _: "id 33, removed", + build: [ + { + _: "id 143, removed", + job: [ + "id 144, removed" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, removed" + ] + }, + "id 145, removed" + ], + commit: [ + { + _: "id 227, removed", + build: [ + { + _: "id 146, removed", + job: [ + "id 147, removed" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, removed" + ] + }, + "id 148, removed" + ], + job: [ + { + _: "id 149, removed", + log: [ + "id 51, removed", + "id 52, removed" + ], + annotation: [ + "id 51, removed", + "id 52, removed" + ], + queueable_job: [ + "id 51, removed", + "id 52, removed" + ] + }, + "id 150, removed" + ], + request: [ + { + _: "id 31, removed", + abuse: [ + "id 27, removed", + "id 28, removed" + ], + message: [ + "id 27, removed", + "id 28, removed" + ], + job: [ + { + _: "id 154, removed", + log: [ + "id 53, removed", + "id 54, removed" + ], + annotation: [ + "id 53, removed", + "id 54, removed" + ], + queueable_job: [ + "id 53, removed", + "id 54, removed" + ] + }, + "id 155, removed" + ], + build: [ + { + _: "id 151, removed", + job: [ + "id 152, removed" + ], + repository: [ + "id 63, present", + "id 62, present" + ], + tag: [ + "id 36, present" + ], + branch: [ + "id 109, present" + ], + stage: [ + "id 50, removed" + ] + }, + "id 153, removed" + ] + }, + "id 32, removed" + ] + }, + "id 228, removed" + ], + request: [ + { + _: "id 33, removed", + abuse: [ + "id 29, removed", + "id 30, removed" + ], + message: [ + "id 29, removed", + "id 30, removed" + ], + job: [ + { + _: "id 159, removed", + log: [ + "id 55, removed", + "id 56, removed" + ], + annotation: [ + "id 55, removed", + "id 56, removed" + ], + queueable_job: [ + "id 55, removed", + "id 56, removed" + ] + }, + "id 160, removed" + ], + build: [ + { + _: "id 156, removed", + job: [ + "id 157, removed" + ], + repository: [ + "id 65, present", + "id 64, present" + ], + tag: [ + "id 37, present" + ], + branch: [ + "id 110, present" + ], + stage: [ + "id 51, removed" + ] + }, + "id 158, removed" + ] + }, + "id 34, removed" + ] + }, + "id 38, removed" + ] + }, + "id 66, removed" + ], + job: [ + { + _: "id 271, removed", + log: [ + "id 93, removed", + "id 94, removed" + ], + annotation: [ + "id 93, removed", + "id 94, removed" + ], + queueable_job: [ + "id 93, removed", + "id 94, removed" + ] + }, + "id 272, removed" + ], + request: [ + { + _: "id 57, removed", + abuse: [ + "id 49, removed", + "id 50, removed" + ], + message: [ + "id 49, removed", + "id 50, removed" + ], + job: [ + { + _: "id 269, removed", + log: [ + "id 91, removed", + "id 92, removed" + ], + annotation: [ + "id 91, removed", + "id 92, removed" + ], + queueable_job: [ + "id 91, removed", + "id 92, removed" + ] + }, + "id 270, removed" + ], + build: [ + { + _: "id 266, removed", + job: [ + "id 267, removed" + ], + repository: [ + "id 110, present", + "id 109, present" + ], + tag: [ + "id 64, present" + ], + branch: [ + "id 136, present" + ], + stage: [ + "id 73, removed" + ] + }, + "id 268, removed" + ] + }, + "id 58, removed", + { + _: "id 55, removed", + abuse: [ + "id 47, removed", + "id 48, removed" + ], + message: [ + "id 47, removed", + "id 48, removed" + ], + job: [ + { + _: "id 264, removed", + log: [ + "id 89, removed", + "id 90, removed" + ], + annotation: [ + "id 89, removed", + "id 90, removed" + ], + queueable_job: [ + "id 89, removed", + "id 90, removed" + ] + }, + "id 265, removed" + ], + build: [ + { + _: "id 261, removed", + job: [ + "id 262, removed" + ], + repository: [ + "id 108, present", + "id 107, present" + ], + tag: [ + "id 63, present" + ], + branch: [ + "id 135, present" + ], + stage: [ + "id 72, removed" + ] + }, + "id 263, removed" + ] + }, + "id 56, removed" + ], + abuse: [ + "id 51, removed", + "id 52, removed" + ], + subscription: [ + { + _: "id 1, removed", + invoice: [ + "id 1, removed", + "id 2, removed" + ] + }, + { + _: "id 2, removed", + invoice: [ + "id 3, removed", + "id 4, removed" + ] + } + ], + owner_group: [ + "id 1, removed", + "id 2, removed" + ], + trial: [ + { + _: "id 1, removed", + trial_allowance: [ + "id 1, removed", + "id 2, removed" + ] + }, + { + _: "id 2, removed", + trial_allowance: [ + "id 3, removed", + "id 4, removed" + ] + } + ], + trial_allowance: [ + "id 5, removed", + "id 6, removed" + ], + broadcast: [ + "id 1, removed", + "id 2, removed" + ], + membership: [ + "id 1, removed", + "id 2, removed" + ] + } + end +end \ No newline at end of file diff --git a/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb index 38a6434..f14fe0e 100644 --- a/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb +++ b/spec/support/expected_dependency_trees/remove_repo_with_dependencies.rb @@ -1,10 +1,13 @@ class ExpectedDependencyTrees def self.remove_repo_with_dependencies { + _: "id 1, removed", build: [ { + _: "id 1, removed", job: [ { + _: "id 6, removed", log: [ "id 1, removed", "id 2, removed" @@ -16,13 +19,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 1, removed", "id 2, removed" - ], - _: "id 6, removed" + ] }, "id 7, removed" ], repository: [ { + _: "id 20, present", build: [ "id 48, present" ], @@ -52,11 +55,11 @@ def self.remove_repo_with_dependencies ], tag: [ "id 12, present" - ], - _: "id 20, present" + ] }, "id 21, present", { + _: "id 18, present", build: [ "id 46, present" ], @@ -86,15 +89,16 @@ def self.remove_repo_with_dependencies ], tag: [ "id 11, present" - ], - _: "id 18, present" + ] }, "id 19, present" ], tag: [ { + _: "id 1, present", build: [ { + _: "id 8, present", job: [ "id 9, present" ], @@ -110,15 +114,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 22, present" - ], - _: "id 8, present" + ] }, "id 10, present" ], commit: [ { + _: "id 211, present", build: [ { + _: "id 11, present", job: [ "id 12, present" ], @@ -134,13 +139,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 23, present" - ], - _: "id 11, present" + ] }, "id 13, present" ], job: [ { + _: "id 14, present", log: [ "id 3, present", "id 4, present" @@ -152,13 +157,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 3, present", "id 4, present" - ], - _: "id 14, present" + ] }, "id 15, present" ], request: [ { + _: "id 1, present", abuse: [ "id 1, present", "id 2, present" @@ -169,6 +174,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 19, present", log: [ "id 5, present", "id 6, present" @@ -180,13 +186,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 5, present", "id 6, present" - ], - _: "id 19, present" + ] }, "id 20, present" ], build: [ { + _: "id 16, present", job: [ "id 17, present" ], @@ -202,21 +208,19 @@ def self.remove_repo_with_dependencies ], stage: [ "id 24, present" - ], - _: "id 16, present" + ] }, "id 18, present" - ], - _: "id 1, present" + ] }, "id 2, present" - ], - _: "id 211, present" + ] }, "id 212, present" ], request: [ { + _: "id 3, present", abuse: [ "id 3, present", "id 4, present" @@ -227,6 +231,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 24, present", log: [ "id 7, present", "id 8, present" @@ -238,13 +243,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 7, present", "id 8, present" - ], - _: "id 24, present" + ] }, "id 25, present" ], build: [ { + _: "id 21, present", job: [ "id 22, present" ], @@ -260,23 +265,22 @@ def self.remove_repo_with_dependencies ], stage: [ "id 25, present" - ], - _: "id 21, present" + ] }, "id 23, present" - ], - _: "id 3, present" + ] }, "id 4, present" - ], - _: "id 1, present" + ] }, "id 6, present" ], branch: [ { + _: "id 77, present", build: [ { + _: "id 26, present", job: [ "id 27, present" ], @@ -292,15 +296,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 26, present" - ], - _: "id 26, present" + ] }, "id 28, present" ], commit: [ { + _: "id 213, present", build: [ { + _: "id 31, present", job: [ "id 32, present" ], @@ -316,13 +321,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 27, present" - ], - _: "id 31, present" + ] }, "id 33, present" ], job: [ { + _: "id 34, present", log: [ "id 11, present", "id 12, present" @@ -334,13 +339,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 11, present", "id 12, present" - ], - _: "id 34, present" + ] }, "id 35, present" ], request: [ { + _: "id 5, present", abuse: [ "id 5, present", "id 6, present" @@ -351,6 +356,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 39, present", log: [ "id 13, present", "id 14, present" @@ -362,13 +368,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 13, present", "id 14, present" - ], - _: "id 39, present" + ] }, "id 40, present" ], build: [ { + _: "id 36, present", job: [ "id 37, present" ], @@ -384,16 +390,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 28, present" - ], - _: "id 36, present" + ] }, "id 38, present" - ], - _: "id 5, present" + ] }, "id 6, present" - ], - _: "id 213, present" + ] }, "id 214, present" ], @@ -403,6 +406,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 29, present", log: [ "id 9, present", "id 10, present" @@ -414,13 +418,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 9, present", "id 10, present" - ], - _: "id 29, present" + ] }, "id 30, present" ], request: [ { + _: "id 7, present", abuse: [ "id 7, present", "id 8, present" @@ -431,6 +435,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 44, present", log: [ "id 15, present", "id 16, present" @@ -442,13 +447,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 15, present", "id 16, present" - ], - _: "id 44, present" + ] }, "id 45, present" ], build: [ { + _: "id 41, present", job: [ "id 42, present" ], @@ -464,41 +469,38 @@ def self.remove_repo_with_dependencies ], stage: [ "id 29, present" - ], - _: "id 41, present" + ] }, "id 43, present" - ], - _: "id 7, present" + ] }, "id 8, present" - ], - _: "id 77, present" + ] }, "id 82, present" ], stage: [ { + _: "id 20, removed", job: [ "id 2, removed", "id 3, removed" - ], - _: "id 20, removed" + ] }, { + _: "id 21, removed", job: [ "id 4, removed", "id 5, removed" - ], - _: "id 21, removed" + ] } - ], - _: "id 1, removed" + ] }, "id 50, removed" ], request: [ { + _: "id 11, removed", abuse: [ "id 9, removed", "id 10, removed" @@ -509,6 +511,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 54, removed", log: [ "id 17, removed", "id 18, removed" @@ -520,13 +523,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 17, removed", "id 18, removed" - ], - _: "id 54, removed" + ] }, "id 55, removed" ], build: [ { + _: "id 51, removed", job: [ "id 52, removed" ], @@ -542,17 +545,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 30, removed" - ], - _: "id 51, removed" + ] }, "id 53, removed" - ], - _: "id 11, removed" + ] }, "id 12, removed" ], job: [ { + _: "id 56, removed", log: [ "id 19, removed", "id 20, removed" @@ -564,15 +566,16 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 19, removed", "id 20, removed" - ], - _: "id 56, removed" + ] }, "id 57, removed" ], branch: [ { + _: "id 86, removed", build: [ { + _: "id 58, removed", job: [ "id 59, removed" ], @@ -588,15 +591,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 31, removed" - ], - _: "id 58, removed" + ] }, "id 60, removed" ], commit: [ { + _: "id 217, removed", build: [ { + _: "id 63, removed", job: [ "id 64, removed" ], @@ -612,13 +616,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 32, removed" - ], - _: "id 63, removed" + ] }, "id 65, removed" ], job: [ { + _: "id 66, removed", log: [ "id 23, removed", "id 24, removed" @@ -630,13 +634,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 23, removed", "id 24, removed" - ], - _: "id 66, removed" + ] }, "id 67, removed" ], request: [ { + _: "id 13, removed", abuse: [ "id 11, removed", "id 12, removed" @@ -647,6 +651,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 71, removed", log: [ "id 25, removed", "id 26, removed" @@ -658,13 +663,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 25, removed", "id 26, removed" - ], - _: "id 71, removed" + ] }, "id 72, removed" ], build: [ { + _: "id 68, removed", job: [ "id 69, removed" ], @@ -680,16 +685,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 33, removed" - ], - _: "id 68, removed" + ] }, "id 70, removed" - ], - _: "id 13, removed" + ] }, "id 14, removed" - ], - _: "id 217, removed" + ] }, "id 218, removed" ], @@ -699,6 +701,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 61, removed", log: [ "id 21, removed", "id 22, removed" @@ -710,13 +713,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 21, removed", "id 22, removed" - ], - _: "id 61, removed" + ] }, "id 62, removed" ], request: [ { + _: "id 15, removed", abuse: [ "id 13, removed", "id 14, removed" @@ -727,6 +730,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 76, removed", log: [ "id 27, removed", "id 28, removed" @@ -738,13 +742,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 27, removed", "id 28, removed" - ], - _: "id 76, removed" + ] }, "id 77, removed" ], build: [ { + _: "id 73, removed", job: [ "id 74, removed" ], @@ -760,16 +764,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 34, removed" - ], - _: "id 73, removed" + ] }, "id 75, removed" - ], - _: "id 15, removed" + ] }, "id 16, removed" - ], - _: "id 86, removed" + ] }, "id 91, removed" ], @@ -779,8 +780,10 @@ def self.remove_repo_with_dependencies ], commit: [ { + _: "id 219, removed", build: [ { + _: "id 78, removed", job: [ "id 79, removed" ], @@ -796,13 +799,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 35, removed" - ], - _: "id 78, removed" + ] }, "id 80, removed" ], job: [ { + _: "id 81, removed", log: [ "id 29, removed", "id 30, removed" @@ -814,13 +817,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 29, removed", "id 30, removed" - ], - _: "id 81, removed" + ] }, "id 82, removed" ], request: [ { + _: "id 17, removed", abuse: [ "id 15, removed", "id 16, removed" @@ -831,6 +834,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 86, removed", log: [ "id 31, removed", "id 32, removed" @@ -842,13 +846,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 31, removed", "id 32, removed" - ], - _: "id 86, removed" + ] }, "id 87, removed" ], build: [ { + _: "id 83, removed", job: [ "id 84, removed" ], @@ -864,16 +868,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 36, removed" - ], - _: "id 83, removed" + ] }, "id 85, removed" - ], - _: "id 17, removed" + ] }, "id 18, removed" - ], - _: "id 219, removed" + ] }, "id 220, removed" ], @@ -887,8 +888,10 @@ def self.remove_repo_with_dependencies ], pull_request: [ { + _: "id 3, removed", request: [ { + _: "id 29, removed", abuse: [ "id 25, removed", "id 26, removed" @@ -899,6 +902,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 141, removed", log: [ "id 49, removed", "id 50, removed" @@ -910,13 +914,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 49, removed", "id 50, removed" - ], - _: "id 141, removed" + ] }, "id 142, removed" ], build: [ { + _: "id 138, removed", job: [ "id 139, removed" ], @@ -932,19 +936,19 @@ def self.remove_repo_with_dependencies ], stage: [ "id 47, removed" - ], - _: "id 138, removed" + ] }, "id 140, removed" - ], - _: "id 29, removed" + ] }, "id 30, removed" ], build: [ { + _: "id 88, removed", job: [ { + _: "id 93, removed", log: [ "id 33, removed", "id 34, removed" @@ -956,13 +960,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 33, removed", "id 34, removed" - ], - _: "id 93, removed" + ] }, "id 94, removed" ], repository: [ { + _: "id 54, present", build: [ "id 135, present" ], @@ -992,11 +996,11 @@ def self.remove_repo_with_dependencies ], tag: [ "id 31, present" - ], - _: "id 54, present" + ] }, "id 55, present", { + _: "id 52, present", build: [ "id 133, present" ], @@ -1026,15 +1030,16 @@ def self.remove_repo_with_dependencies ], tag: [ "id 30, present" - ], - _: "id 52, present" + ] }, "id 53, present" ], tag: [ { + _: "id 20, present", build: [ { + _: "id 95, present", job: [ "id 96, present" ], @@ -1050,15 +1055,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 39, present" - ], - _: "id 95, present" + ] }, "id 97, present" ], commit: [ { + _: "id 221, present", build: [ { + _: "id 98, present", job: [ "id 99, present" ], @@ -1074,13 +1080,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 40, present" - ], - _: "id 98, present" + ] }, "id 100, present" ], job: [ { + _: "id 101, present", log: [ "id 35, present", "id 36, present" @@ -1092,13 +1098,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 35, present", "id 36, present" - ], - _: "id 101, present" + ] }, "id 102, present" ], request: [ { + _: "id 19, present", abuse: [ "id 17, present", "id 18, present" @@ -1109,6 +1115,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 106, present", log: [ "id 37, present", "id 38, present" @@ -1120,13 +1127,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 37, present", "id 38, present" - ], - _: "id 106, present" + ] }, "id 107, present" ], build: [ { + _: "id 103, present", job: [ "id 104, present" ], @@ -1142,21 +1149,19 @@ def self.remove_repo_with_dependencies ], stage: [ "id 41, present" - ], - _: "id 103, present" + ] }, "id 105, present" - ], - _: "id 19, present" + ] }, "id 20, present" - ], - _: "id 221, present" + ] }, "id 222, present" ], request: [ { + _: "id 21, present", abuse: [ "id 19, present", "id 20, present" @@ -1167,6 +1172,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 111, present", log: [ "id 39, present", "id 40, present" @@ -1178,13 +1184,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 39, present", "id 40, present" - ], - _: "id 111, present" + ] }, "id 112, present" ], build: [ { + _: "id 108, present", job: [ "id 109, present" ], @@ -1200,23 +1206,22 @@ def self.remove_repo_with_dependencies ], stage: [ "id 42, present" - ], - _: "id 108, present" + ] }, "id 110, present" - ], - _: "id 21, present" + ] }, "id 22, present" - ], - _: "id 20, present" + ] }, "id 25, present" ], branch: [ { + _: "id 98, present", build: [ { + _: "id 113, present", job: [ "id 114, present" ], @@ -1232,15 +1237,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 43, present" - ], - _: "id 113, present" + ] }, "id 115, present" ], commit: [ { + _: "id 223, present", build: [ { + _: "id 118, present", job: [ "id 119, present" ], @@ -1256,13 +1262,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 44, present" - ], - _: "id 118, present" + ] }, "id 120, present" ], job: [ { + _: "id 121, present", log: [ "id 43, present", "id 44, present" @@ -1274,13 +1280,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 43, present", "id 44, present" - ], - _: "id 121, present" + ] }, "id 122, present" ], request: [ { + _: "id 23, present", abuse: [ "id 21, present", "id 22, present" @@ -1291,6 +1297,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 126, present", log: [ "id 45, present", "id 46, present" @@ -1302,13 +1309,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 45, present", "id 46, present" - ], - _: "id 126, present" + ] }, "id 127, present" ], build: [ { + _: "id 123, present", job: [ "id 124, present" ], @@ -1324,16 +1331,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 45, present" - ], - _: "id 123, present" + ] }, "id 125, present" - ], - _: "id 23, present" + ] }, "id 24, present" - ], - _: "id 223, present" + ] }, "id 224, present" ], @@ -1343,6 +1347,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 116, present", log: [ "id 41, present", "id 42, present" @@ -1354,13 +1359,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 41, present", "id 42, present" - ], - _: "id 116, present" + ] }, "id 117, present" ], request: [ { + _: "id 25, present", abuse: [ "id 23, present", "id 24, present" @@ -1371,6 +1376,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 131, present", log: [ "id 47, present", "id 48, present" @@ -1382,13 +1388,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 47, present", "id 48, present" - ], - _: "id 131, present" + ] }, "id 132, present" ], build: [ { + _: "id 128, present", job: [ "id 129, present" ], @@ -1404,47 +1410,44 @@ def self.remove_repo_with_dependencies ], stage: [ "id 46, present" - ], - _: "id 128, present" + ] }, "id 130, present" - ], - _: "id 25, present" + ] }, "id 26, present" - ], - _: "id 98, present" + ] }, "id 103, present" ], stage: [ { + _: "id 37, removed", job: [ "id 89, removed", "id 90, removed" - ], - _: "id 37, removed" + ] }, { + _: "id 38, removed", job: [ "id 91, removed", "id 92, removed" - ], - _: "id 38, removed" + ] } - ], - _: "id 88, removed" + ] }, "id 137, removed" - ], - _: "id 3, removed" + ] }, "id 6, removed" ], tag: [ { + _: "id 33, removed", build: [ { + _: "id 143, removed", job: [ "id 144, removed" ], @@ -1460,15 +1463,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 48, removed" - ], - _: "id 143, removed" + ] }, "id 145, removed" ], commit: [ { + _: "id 227, removed", build: [ { + _: "id 146, removed", job: [ "id 147, removed" ], @@ -1484,13 +1488,13 @@ def self.remove_repo_with_dependencies ], stage: [ "id 49, removed" - ], - _: "id 146, removed" + ] }, "id 148, removed" ], job: [ { + _: "id 149, removed", log: [ "id 51, removed", "id 52, removed" @@ -1502,13 +1506,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 51, removed", "id 52, removed" - ], - _: "id 149, removed" + ] }, "id 150, removed" ], request: [ { + _: "id 31, removed", abuse: [ "id 27, removed", "id 28, removed" @@ -1519,6 +1523,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 154, removed", log: [ "id 53, removed", "id 54, removed" @@ -1530,13 +1535,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 53, removed", "id 54, removed" - ], - _: "id 154, removed" + ] }, "id 155, removed" ], build: [ { + _: "id 151, removed", job: [ "id 152, removed" ], @@ -1552,21 +1557,19 @@ def self.remove_repo_with_dependencies ], stage: [ "id 50, removed" - ], - _: "id 151, removed" + ] }, "id 153, removed" - ], - _: "id 31, removed" + ] }, "id 32, removed" - ], - _: "id 227, removed" + ] }, "id 228, removed" ], request: [ { + _: "id 33, removed", abuse: [ "id 29, removed", "id 30, removed" @@ -1577,6 +1580,7 @@ def self.remove_repo_with_dependencies ], job: [ { + _: "id 159, removed", log: [ "id 55, removed", "id 56, removed" @@ -1588,13 +1592,13 @@ def self.remove_repo_with_dependencies queueable_job: [ "id 55, removed", "id 56, removed" - ], - _: "id 159, removed" + ] }, "id 160, removed" ], build: [ { + _: "id 156, removed", job: [ "id 157, removed" ], @@ -1610,20 +1614,16 @@ def self.remove_repo_with_dependencies ], stage: [ "id 51, removed" - ], - _: "id 156, removed" + ] }, "id 158, removed" - ], - _: "id 33, removed" + ] }, "id 34, removed" - ], - _: "id 33, removed" + ] }, "id 38, removed" - ], - _: "id 1, removed" + ] } end end \ No newline at end of file diff --git a/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb new file mode 100644 index 0000000..b92675b --- /dev/null +++ b/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb @@ -0,0 +1,2831 @@ +class ExpectedDependencyTrees + def self.remove_user_with_dependencies + { + _: "id 9, removed", + build: [ + { + _: "id 161, removed", + job: [ + { + _: "id 166, removed", + log: [ + "id 57, removed", + "id 58, removed" + ], + annotation: [ + "id 57, removed", + "id 58, removed" + ], + queueable_job: [ + "id 57, removed", + "id 58, removed" + ] + }, + "id 167, removed" + ], + repository: [ + { + _: "id 85, present", + build: [ + "id 208, present" + ], + request: [ + "id 44, present" + ], + job: [ + "id 209, present" + ], + branch: [ + "id 122, present" + ], + ssl_key: [ + "id 38, present" + ], + commit: [ + "id 234, present" + ], + permission: [ + "id 10, present" + ], + star: [ + "id 10, present" + ], + pull_request: [ + "id 8, present" + ], + tag: [ + "id 50, present" + ] + }, + "id 86, present", + { + _: "id 83, present", + build: [ + "id 206, present" + ], + request: [ + "id 43, present" + ], + job: [ + "id 207, present" + ], + branch: [ + "id 121, present" + ], + ssl_key: [ + "id 37, present" + ], + commit: [ + "id 233, present" + ], + permission: [ + "id 9, present" + ], + star: [ + "id 9, present" + ], + pull_request: [ + "id 7, present" + ], + tag: [ + "id 49, present" + ] + }, + "id 84, present" + ], + tag: [ + { + _: "id 39, present", + build: [ + { + _: "id 168, present", + job: [ + "id 169, present" + ], + repository: [ + "id 68, present", + "id 67, present" + ], + tag: [ + "id 40, present" + ], + branch: [ + "id 111, present" + ], + stage: [ + "id 54, present" + ] + }, + "id 170, present" + ], + commit: [ + { + _: "id 229, present", + build: [ + { + _: "id 171, present", + job: [ + "id 172, present" + ], + repository: [ + "id 70, present", + "id 69, present" + ], + tag: [ + "id 41, present" + ], + branch: [ + "id 112, present" + ], + stage: [ + "id 55, present" + ] + }, + "id 173, present" + ], + job: [ + { + _: "id 174, present", + log: [ + "id 59, present", + "id 60, present" + ], + annotation: [ + "id 59, present", + "id 60, present" + ], + queueable_job: [ + "id 59, present", + "id 60, present" + ] + }, + "id 175, present" + ], + request: [ + { + _: "id 35, present", + abuse: [ + "id 31, present", + "id 32, present" + ], + message: [ + "id 31, present", + "id 32, present" + ], + job: [ + { + _: "id 179, present", + log: [ + "id 61, present", + "id 62, present" + ], + annotation: [ + "id 61, present", + "id 62, present" + ], + queueable_job: [ + "id 61, present", + "id 62, present" + ] + }, + "id 180, present" + ], + build: [ + { + _: "id 176, present", + job: [ + "id 177, present" + ], + repository: [ + "id 72, present", + "id 71, present" + ], + tag: [ + "id 42, present" + ], + branch: [ + "id 113, present" + ], + stage: [ + "id 56, present" + ] + }, + "id 178, present" + ] + }, + "id 36, present" + ] + }, + "id 230, present" + ], + request: [ + { + _: "id 37, present", + abuse: [ + "id 33, present", + "id 34, present" + ], + message: [ + "id 33, present", + "id 34, present" + ], + job: [ + { + _: "id 184, present", + log: [ + "id 63, present", + "id 64, present" + ], + annotation: [ + "id 63, present", + "id 64, present" + ], + queueable_job: [ + "id 63, present", + "id 64, present" + ] + }, + "id 185, present" + ], + build: [ + { + _: "id 181, present", + job: [ + "id 182, present" + ], + repository: [ + "id 74, present", + "id 73, present" + ], + tag: [ + "id 43, present" + ], + branch: [ + "id 114, present" + ], + stage: [ + "id 57, present" + ] + }, + "id 183, present" + ] + }, + "id 38, present" + ] + }, + "id 44, present" + ], + branch: [ + { + _: "id 115, present", + build: [ + { + _: "id 186, present", + job: [ + "id 187, present" + ], + repository: [ + "id 76, present", + "id 75, present" + ], + tag: [ + "id 45, present" + ], + branch: [ + "id 116, present" + ], + stage: [ + "id 58, present" + ] + }, + "id 188, present" + ], + commit: [ + { + _: "id 231, present", + build: [ + { + _: "id 191, present", + job: [ + "id 192, present" + ], + repository: [ + "id 78, present", + "id 77, present" + ], + tag: [ + "id 46, present" + ], + branch: [ + "id 117, present" + ], + stage: [ + "id 59, present" + ] + }, + "id 193, present" + ], + job: [ + { + _: "id 194, present", + log: [ + "id 67, present", + "id 68, present" + ], + annotation: [ + "id 67, present", + "id 68, present" + ], + queueable_job: [ + "id 67, present", + "id 68, present" + ] + }, + "id 195, present" + ], + request: [ + { + _: "id 39, present", + abuse: [ + "id 35, present", + "id 36, present" + ], + message: [ + "id 35, present", + "id 36, present" + ], + job: [ + { + _: "id 199, present", + log: [ + "id 69, present", + "id 70, present" + ], + annotation: [ + "id 69, present", + "id 70, present" + ], + queueable_job: [ + "id 69, present", + "id 70, present" + ] + }, + "id 200, present" + ], + build: [ + { + _: "id 196, present", + job: [ + "id 197, present" + ], + repository: [ + "id 80, present", + "id 79, present" + ], + tag: [ + "id 47, present" + ], + branch: [ + "id 118, present" + ], + stage: [ + "id 60, present" + ] + }, + "id 198, present" + ] + }, + "id 40, present" + ] + }, + "id 232, present" + ], + cron: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + _: "id 189, present", + log: [ + "id 65, present", + "id 66, present" + ], + annotation: [ + "id 65, present", + "id 66, present" + ], + queueable_job: [ + "id 65, present", + "id 66, present" + ] + }, + "id 190, present" + ], + request: [ + { + _: "id 41, present", + abuse: [ + "id 37, present", + "id 38, present" + ], + message: [ + "id 37, present", + "id 38, present" + ], + job: [ + { + _: "id 204, present", + log: [ + "id 71, present", + "id 72, present" + ], + annotation: [ + "id 71, present", + "id 72, present" + ], + queueable_job: [ + "id 71, present", + "id 72, present" + ] + }, + "id 205, present" + ], + build: [ + { + _: "id 201, present", + job: [ + "id 202, present" + ], + repository: [ + "id 82, present", + "id 81, present" + ], + tag: [ + "id 48, present" + ], + branch: [ + "id 119, present" + ], + stage: [ + "id 61, present" + ] + }, + "id 203, present" + ] + }, + "id 42, present" + ] + }, + "id 120, present" + ], + stage: [ + { + _: "id 52, removed", + job: [ + "id 162, removed", + "id 163, removed" + ] + }, + { + _: "id 53, removed", + job: [ + "id 164, removed", + "id 165, removed" + ] + } + ] + }, + { + _: "id 210, removed", + repository: [ + "id 1, removed, duplicate" + ] + }, + { + _: "id 211, removed", + job: [ + { + _: "id 216, removed", + log: [ + "id 73, removed", + "id 74, removed" + ], + annotation: [ + "id 73, removed", + "id 74, removed" + ], + queueable_job: [ + "id 73, removed", + "id 74, removed" + ] + }, + "id 217, removed" + ], + repository: [ + { + _: "id 105, present", + build: [ + "id 258, present" + ], + request: [ + "id 54, present" + ], + job: [ + "id 259, present" + ], + branch: [ + "id 134, present" + ], + ssl_key: [ + "id 40, present" + ], + commit: [ + "id 240, present" + ], + permission: [ + "id 12, present" + ], + star: [ + "id 12, present" + ], + pull_request: [ + "id 10, present" + ], + tag: [ + "id 62, present" + ] + }, + "id 106, present", + { + _: "id 103, present", + build: [ + "id 256, present" + ], + request: [ + "id 53, present" + ], + job: [ + "id 257, present" + ], + branch: [ + "id 133, present" + ], + ssl_key: [ + "id 39, present" + ], + commit: [ + "id 239, present" + ], + permission: [ + "id 11, present" + ], + star: [ + "id 11, present" + ], + pull_request: [ + "id 9, present" + ], + tag: [ + "id 61, present" + ] + }, + "id 104, present" + ], + tag: [ + { + _: "id 51, present", + build: [ + { + _: "id 218, present", + job: [ + "id 219, present" + ], + repository: [ + "id 88, present", + "id 87, present" + ], + tag: [ + "id 52, present" + ], + branch: [ + "id 123, present" + ], + stage: [ + "id 64, present" + ] + }, + "id 220, present" + ], + commit: [ + { + _: "id 235, present", + build: [ + { + _: "id 221, present", + job: [ + "id 222, present" + ], + repository: [ + "id 90, present", + "id 89, present" + ], + tag: [ + "id 53, present" + ], + branch: [ + "id 124, present" + ], + stage: [ + "id 65, present" + ] + }, + "id 223, present" + ], + job: [ + { + _: "id 224, present", + log: [ + "id 75, present", + "id 76, present" + ], + annotation: [ + "id 75, present", + "id 76, present" + ], + queueable_job: [ + "id 75, present", + "id 76, present" + ] + }, + "id 225, present" + ], + request: [ + { + _: "id 45, present", + abuse: [ + "id 39, present", + "id 40, present" + ], + message: [ + "id 39, present", + "id 40, present" + ], + job: [ + { + _: "id 229, present", + log: [ + "id 77, present", + "id 78, present" + ], + annotation: [ + "id 77, present", + "id 78, present" + ], + queueable_job: [ + "id 77, present", + "id 78, present" + ] + }, + "id 230, present" + ], + build: [ + { + _: "id 226, present", + job: [ + "id 227, present" + ], + repository: [ + "id 92, present", + "id 91, present" + ], + tag: [ + "id 54, present" + ], + branch: [ + "id 125, present" + ], + stage: [ + "id 66, present" + ] + }, + "id 228, present" + ] + }, + "id 46, present" + ] + }, + "id 236, present" + ], + request: [ + { + _: "id 47, present", + abuse: [ + "id 41, present", + "id 42, present" + ], + message: [ + "id 41, present", + "id 42, present" + ], + job: [ + { + _: "id 234, present", + log: [ + "id 79, present", + "id 80, present" + ], + annotation: [ + "id 79, present", + "id 80, present" + ], + queueable_job: [ + "id 79, present", + "id 80, present" + ] + }, + "id 235, present" + ], + build: [ + { + _: "id 231, present", + job: [ + "id 232, present" + ], + repository: [ + "id 94, present", + "id 93, present" + ], + tag: [ + "id 55, present" + ], + branch: [ + "id 126, present" + ], + stage: [ + "id 67, present" + ] + }, + "id 233, present" + ] + }, + "id 48, present" + ] + }, + "id 56, present" + ], + branch: [ + { + _: "id 127, present", + build: [ + { + _: "id 236, present", + job: [ + "id 237, present" + ], + repository: [ + "id 96, present", + "id 95, present" + ], + tag: [ + "id 57, present" + ], + branch: [ + "id 128, present" + ], + stage: [ + "id 68, present" + ] + }, + "id 238, present" + ], + commit: [ + { + _: "id 237, present", + build: [ + { + _: "id 241, present", + job: [ + "id 242, present" + ], + repository: [ + "id 98, present", + "id 97, present" + ], + tag: [ + "id 58, present" + ], + branch: [ + "id 129, present" + ], + stage: [ + "id 69, present" + ] + }, + "id 243, present" + ], + job: [ + { + _: "id 244, present", + log: [ + "id 83, present", + "id 84, present" + ], + annotation: [ + "id 83, present", + "id 84, present" + ], + queueable_job: [ + "id 83, present", + "id 84, present" + ] + }, + "id 245, present" + ], + request: [ + { + _: "id 49, present", + abuse: [ + "id 43, present", + "id 44, present" + ], + message: [ + "id 43, present", + "id 44, present" + ], + job: [ + { + _: "id 249, present", + log: [ + "id 85, present", + "id 86, present" + ], + annotation: [ + "id 85, present", + "id 86, present" + ], + queueable_job: [ + "id 85, present", + "id 86, present" + ] + }, + "id 250, present" + ], + build: [ + { + _: "id 246, present", + job: [ + "id 247, present" + ], + repository: [ + "id 100, present", + "id 99, present" + ], + tag: [ + "id 59, present" + ], + branch: [ + "id 130, present" + ], + stage: [ + "id 70, present" + ] + }, + "id 248, present" + ] + }, + "id 50, present" + ] + }, + "id 238, present" + ], + cron: [ + "id 9, present", + "id 10, present" + ], + job: [ + { + _: "id 239, present", + log: [ + "id 81, present", + "id 82, present" + ], + annotation: [ + "id 81, present", + "id 82, present" + ], + queueable_job: [ + "id 81, present", + "id 82, present" + ] + }, + "id 240, present" + ], + request: [ + { + _: "id 51, present", + abuse: [ + "id 45, present", + "id 46, present" + ], + message: [ + "id 45, present", + "id 46, present" + ], + job: [ + { + _: "id 254, present", + log: [ + "id 87, present", + "id 88, present" + ], + annotation: [ + "id 87, present", + "id 88, present" + ], + queueable_job: [ + "id 87, present", + "id 88, present" + ] + }, + "id 255, present" + ], + build: [ + { + _: "id 251, present", + job: [ + "id 252, present" + ], + repository: [ + "id 102, present", + "id 101, present" + ], + tag: [ + "id 60, present" + ], + branch: [ + "id 131, present" + ], + stage: [ + "id 71, present" + ] + }, + "id 253, present" + ] + }, + "id 52, present" + ] + }, + "id 132, present" + ], + stage: [ + { + _: "id 62, removed", + job: [ + "id 212, removed", + "id 213, removed" + ] + }, + { + _: "id 63, removed", + job: [ + "id 214, removed", + "id 215, removed" + ] + } + ] + }, + { + _: "id 260, removed", + repository: [ + "id 1, removed, duplicate" + ] + } + ], + repository: [ + { + _: "id 1, removed", + build: [ + { + _: "id 1, removed", + job: [ + { + _: "id 6, removed", + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ] + }, + "id 7, removed" + ], + repository: [ + { + _: "id 20, present", + build: [ + "id 48, present" + ], + request: [ + "id 10, present" + ], + job: [ + "id 49, present" + ], + branch: [ + "id 84, present" + ], + ssl_key: [ + "id 32, present" + ], + commit: [ + "id 216, present" + ], + permission: [ + "id 4, present" + ], + star: [ + "id 4, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" + ] + }, + "id 21, present", + { + _: "id 18, present", + build: [ + "id 46, present" + ], + request: [ + "id 9, present" + ], + job: [ + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 3, present" + ], + star: [ + "id 3, present" + ], + pull_request: [ + "id 1, present" + ], + tag: [ + "id 11, present" + ] + }, + "id 19, present" + ], + tag: [ + { + _: "id 1, present", + build: [ + { + _: "id 8, present", + job: [ + "id 9, present" + ], + repository: [ + "id 3, present", + "id 2, present" + ], + tag: [ + "id 2, present" + ], + branch: [ + "id 73, present" + ], + stage: [ + "id 22, present" + ] + }, + "id 10, present" + ], + commit: [ + { + _: "id 211, present", + build: [ + { + _: "id 11, present", + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ] + }, + "id 13, present" + ], + job: [ + { + _: "id 14, present", + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" + ], + request: [ + { + _: "id 1, present", + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 19, present", + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + build: [ + { + _: "id 16, present", + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" + ] + }, + "id 212, present" + ], + request: [ + { + _: "id 3, present", + abuse: [ + "id 3, present", + "id 4, present" + ], + message: [ + "id 3, present", + "id 4, present" + ], + job: [ + { + _: "id 24, present", + log: [ + "id 7, present", + "id 8, present" + ], + annotation: [ + "id 7, present", + "id 8, present" + ], + queueable_job: [ + "id 7, present", + "id 8, present" + ] + }, + "id 25, present" + ], + build: [ + { + _: "id 21, present", + job: [ + "id 22, present" + ], + repository: [ + "id 9, present", + "id 8, present" + ], + tag: [ + "id 5, present" + ], + branch: [ + "id 76, present" + ], + stage: [ + "id 25, present" + ] + }, + "id 23, present" + ] + }, + "id 4, present" + ] + }, + "id 6, present" + ], + branch: [ + { + _: "id 77, present", + build: [ + { + _: "id 26, present", + job: [ + "id 27, present" + ], + repository: [ + "id 11, present", + "id 10, present" + ], + tag: [ + "id 7, present" + ], + branch: [ + "id 78, present" + ], + stage: [ + "id 26, present" + ] + }, + "id 28, present" + ], + commit: [ + { + _: "id 213, present", + build: [ + { + _: "id 31, present", + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ] + }, + "id 33, present" + ], + job: [ + { + _: "id 34, present", + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" + ], + request: [ + { + _: "id 5, present", + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 39, present", + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + build: [ + { + _: "id 36, present", + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" + ] + }, + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 29, present", + log: [ + "id 9, present", + "id 10, present" + ], + annotation: [ + "id 9, present", + "id 10, present" + ], + queueable_job: [ + "id 9, present", + "id 10, present" + ] + }, + "id 30, present" + ], + request: [ + { + _: "id 7, present", + abuse: [ + "id 7, present", + "id 8, present" + ], + message: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + _: "id 44, present", + log: [ + "id 15, present", + "id 16, present" + ], + annotation: [ + "id 15, present", + "id 16, present" + ], + queueable_job: [ + "id 15, present", + "id 16, present" + ] + }, + "id 45, present" + ], + build: [ + { + _: "id 41, present", + job: [ + "id 42, present" + ], + repository: [ + "id 17, present", + "id 16, present" + ], + tag: [ + "id 10, present" + ], + branch: [ + "id 81, present" + ], + stage: [ + "id 29, present" + ] + }, + "id 43, present" + ] + }, + "id 8, present" + ] + }, + "id 82, present" + ], + stage: [ + { + _: "id 20, removed", + job: [ + "id 2, removed", + "id 3, removed" + ] + }, + { + _: "id 21, removed", + job: [ + "id 4, removed", + "id 5, removed" + ] + } + ] + }, + "id 50, removed" + ], + request: [ + { + _: "id 11, removed", + abuse: [ + "id 9, removed", + "id 10, removed" + ], + message: [ + "id 9, removed", + "id 10, removed" + ], + job: [ + { + _: "id 54, removed", + log: [ + "id 17, removed", + "id 18, removed" + ], + annotation: [ + "id 17, removed", + "id 18, removed" + ], + queueable_job: [ + "id 17, removed", + "id 18, removed" + ] + }, + "id 55, removed" + ], + build: [ + { + _: "id 51, removed", + job: [ + "id 52, removed" + ], + repository: [ + "id 23, present", + "id 22, present" + ], + tag: [ + "id 13, present" + ], + branch: [ + "id 85, present" + ], + stage: [ + "id 30, removed" + ] + }, + "id 53, removed" + ] + }, + "id 12, removed" + ], + job: [ + { + _: "id 56, removed", + log: [ + "id 19, removed", + "id 20, removed" + ], + annotation: [ + "id 19, removed", + "id 20, removed" + ], + queueable_job: [ + "id 19, removed", + "id 20, removed" + ] + }, + "id 57, removed" + ], + branch: [ + { + _: "id 86, removed", + build: [ + { + _: "id 58, removed", + job: [ + "id 59, removed" + ], + repository: [ + "id 25, present", + "id 24, present" + ], + tag: [ + "id 14, present" + ], + branch: [ + "id 87, present" + ], + stage: [ + "id 31, removed" + ] + }, + "id 60, removed" + ], + commit: [ + { + _: "id 217, removed", + build: [ + { + _: "id 63, removed", + job: [ + "id 64, removed" + ], + repository: [ + "id 27, present", + "id 26, present" + ], + tag: [ + "id 15, present" + ], + branch: [ + "id 88, present" + ], + stage: [ + "id 32, removed" + ] + }, + "id 65, removed" + ], + job: [ + { + _: "id 66, removed", + log: [ + "id 23, removed", + "id 24, removed" + ], + annotation: [ + "id 23, removed", + "id 24, removed" + ], + queueable_job: [ + "id 23, removed", + "id 24, removed" + ] + }, + "id 67, removed" + ], + request: [ + { + _: "id 13, removed", + abuse: [ + "id 11, removed", + "id 12, removed" + ], + message: [ + "id 11, removed", + "id 12, removed" + ], + job: [ + { + _: "id 71, removed", + log: [ + "id 25, removed", + "id 26, removed" + ], + annotation: [ + "id 25, removed", + "id 26, removed" + ], + queueable_job: [ + "id 25, removed", + "id 26, removed" + ] + }, + "id 72, removed" + ], + build: [ + { + _: "id 68, removed", + job: [ + "id 69, removed" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, removed" + ] + }, + "id 70, removed" + ] + }, + "id 14, removed" + ] + }, + "id 218, removed" + ], + cron: [ + "id 3, removed", + "id 4, removed" + ], + job: [ + { + _: "id 61, removed", + log: [ + "id 21, removed", + "id 22, removed" + ], + annotation: [ + "id 21, removed", + "id 22, removed" + ], + queueable_job: [ + "id 21, removed", + "id 22, removed" + ] + }, + "id 62, removed" + ], + request: [ + { + _: "id 15, removed", + abuse: [ + "id 13, removed", + "id 14, removed" + ], + message: [ + "id 13, removed", + "id 14, removed" + ], + job: [ + { + _: "id 76, removed", + log: [ + "id 27, removed", + "id 28, removed" + ], + annotation: [ + "id 27, removed", + "id 28, removed" + ], + queueable_job: [ + "id 27, removed", + "id 28, removed" + ] + }, + "id 77, removed" + ], + build: [ + { + _: "id 73, removed", + job: [ + "id 74, removed" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, removed" + ] + }, + "id 75, removed" + ] + }, + "id 16, removed" + ] + }, + "id 91, removed" + ], + ssl_key: [ + "id 33, removed", + "id 34, removed" + ], + commit: [ + { + _: "id 219, removed", + build: [ + { + _: "id 78, removed", + job: [ + "id 79, removed" + ], + repository: [ + "id 33, present", + "id 32, present" + ], + tag: [ + "id 18, present" + ], + branch: [ + "id 92, present" + ], + stage: [ + "id 35, removed" + ] + }, + "id 80, removed" + ], + job: [ + { + _: "id 81, removed", + log: [ + "id 29, removed", + "id 30, removed" + ], + annotation: [ + "id 29, removed", + "id 30, removed" + ], + queueable_job: [ + "id 29, removed", + "id 30, removed" + ] + }, + "id 82, removed" + ], + request: [ + { + _: "id 17, removed", + abuse: [ + "id 15, removed", + "id 16, removed" + ], + message: [ + "id 15, removed", + "id 16, removed" + ], + job: [ + { + _: "id 86, removed", + log: [ + "id 31, removed", + "id 32, removed" + ], + annotation: [ + "id 31, removed", + "id 32, removed" + ], + queueable_job: [ + "id 31, removed", + "id 32, removed" + ] + }, + "id 87, removed" + ], + build: [ + { + _: "id 83, removed", + job: [ + "id 84, removed" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, removed" + ] + }, + "id 85, removed" + ] + }, + "id 18, removed" + ] + }, + "id 220, removed" + ], + permission: [ + "id 5, removed", + "id 6, removed" + ], + star: [ + "id 5, removed", + "id 6, removed" + ], + pull_request: [ + { + _: "id 3, removed", + request: [ + { + _: "id 29, removed", + abuse: [ + "id 25, removed", + "id 26, removed" + ], + message: [ + "id 25, removed", + "id 26, removed" + ], + job: [ + { + _: "id 141, removed", + log: [ + "id 49, removed", + "id 50, removed" + ], + annotation: [ + "id 49, removed", + "id 50, removed" + ], + queueable_job: [ + "id 49, removed", + "id 50, removed" + ] + }, + "id 142, removed" + ], + build: [ + { + _: "id 138, removed", + job: [ + "id 139, removed" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, removed" + ] + }, + "id 140, removed" + ] + }, + "id 30, removed" + ], + build: [ + { + _: "id 88, removed", + job: [ + { + _: "id 93, removed", + log: [ + "id 33, removed", + "id 34, removed" + ], + annotation: [ + "id 33, removed", + "id 34, removed" + ], + queueable_job: [ + "id 33, removed", + "id 34, removed" + ] + }, + "id 94, removed" + ], + repository: [ + { + _: "id 54, present", + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 8, present" + ], + star: [ + "id 8, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ] + }, + "id 55, present", + { + _: "id 52, present", + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], + job: [ + "id 134, present" + ], + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 7, present" + ], + star: [ + "id 7, present" + ], + pull_request: [ + "id 4, present" + ], + tag: [ + "id 30, present" + ] + }, + "id 53, present" + ], + tag: [ + { + _: "id 20, present", + build: [ + { + _: "id 95, present", + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ] + }, + "id 97, present" + ], + commit: [ + { + _: "id 221, present", + build: [ + { + _: "id 98, present", + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ] + }, + "id 100, present" + ], + job: [ + { + _: "id 101, present", + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + request: [ + { + _: "id 19, present", + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + _: "id 106, present", + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + build: [ + { + _: "id 103, present", + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" + ], + request: [ + { + _: "id 21, present", + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + _: "id 111, present", + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + build: [ + { + _: "id 108, present", + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" + ] + }, + "id 25, present" + ], + branch: [ + { + _: "id 98, present", + build: [ + { + _: "id 113, present", + job: [ + "id 114, present" + ], + repository: [ + "id 45, present", + "id 44, present" + ], + tag: [ + "id 26, present" + ], + branch: [ + "id 99, present" + ], + stage: [ + "id 43, present" + ] + }, + "id 115, present" + ], + commit: [ + { + _: "id 223, present", + build: [ + { + _: "id 118, present", + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ] + }, + "id 120, present" + ], + job: [ + { + _: "id 121, present", + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + request: [ + { + _: "id 23, present", + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + _: "id 126, present", + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + build: [ + { + _: "id 123, present", + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" + ] + }, + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 116, present", + log: [ + "id 41, present", + "id 42, present" + ], + annotation: [ + "id 41, present", + "id 42, present" + ], + queueable_job: [ + "id 41, present", + "id 42, present" + ] + }, + "id 117, present" + ], + request: [ + { + _: "id 25, present", + abuse: [ + "id 23, present", + "id 24, present" + ], + message: [ + "id 23, present", + "id 24, present" + ], + job: [ + { + _: "id 131, present", + log: [ + "id 47, present", + "id 48, present" + ], + annotation: [ + "id 47, present", + "id 48, present" + ], + queueable_job: [ + "id 47, present", + "id 48, present" + ] + }, + "id 132, present" + ], + build: [ + { + _: "id 128, present", + job: [ + "id 129, present" + ], + repository: [ + "id 51, present", + "id 50, present" + ], + tag: [ + "id 29, present" + ], + branch: [ + "id 102, present" + ], + stage: [ + "id 46, present" + ] + }, + "id 130, present" + ] + }, + "id 26, present" + ] + }, + "id 103, present" + ], + stage: [ + { + _: "id 37, removed", + job: [ + "id 89, removed", + "id 90, removed" + ] + }, + { + _: "id 38, removed", + job: [ + "id 91, removed", + "id 92, removed" + ] + } + ] + }, + "id 137, removed" + ] + }, + "id 6, removed" + ], + tag: [ + { + _: "id 33, removed", + build: [ + { + _: "id 143, removed", + job: [ + "id 144, removed" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, removed" + ] + }, + "id 145, removed" + ], + commit: [ + { + _: "id 227, removed", + build: [ + { + _: "id 146, removed", + job: [ + "id 147, removed" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, removed" + ] + }, + "id 148, removed" + ], + job: [ + { + _: "id 149, removed", + log: [ + "id 51, removed", + "id 52, removed" + ], + annotation: [ + "id 51, removed", + "id 52, removed" + ], + queueable_job: [ + "id 51, removed", + "id 52, removed" + ] + }, + "id 150, removed" + ], + request: [ + { + _: "id 31, removed", + abuse: [ + "id 27, removed", + "id 28, removed" + ], + message: [ + "id 27, removed", + "id 28, removed" + ], + job: [ + { + _: "id 154, removed", + log: [ + "id 53, removed", + "id 54, removed" + ], + annotation: [ + "id 53, removed", + "id 54, removed" + ], + queueable_job: [ + "id 53, removed", + "id 54, removed" + ] + }, + "id 155, removed" + ], + build: [ + { + _: "id 151, removed", + job: [ + "id 152, removed" + ], + repository: [ + "id 63, present", + "id 62, present" + ], + tag: [ + "id 36, present" + ], + branch: [ + "id 109, present" + ], + stage: [ + "id 50, removed" + ] + }, + "id 153, removed" + ] + }, + "id 32, removed" + ] + }, + "id 228, removed" + ], + request: [ + { + _: "id 33, removed", + abuse: [ + "id 29, removed", + "id 30, removed" + ], + message: [ + "id 29, removed", + "id 30, removed" + ], + job: [ + { + _: "id 159, removed", + log: [ + "id 55, removed", + "id 56, removed" + ], + annotation: [ + "id 55, removed", + "id 56, removed" + ], + queueable_job: [ + "id 55, removed", + "id 56, removed" + ] + }, + "id 160, removed" + ], + build: [ + { + _: "id 156, removed", + job: [ + "id 157, removed" + ], + repository: [ + "id 65, present", + "id 64, present" + ], + tag: [ + "id 37, present" + ], + branch: [ + "id 110, present" + ], + stage: [ + "id 51, removed" + ] + }, + "id 158, removed" + ] + }, + "id 34, removed" + ] + }, + "id 38, removed" + ] + }, + "id 66, removed" + ], + job: [ + { + _: "id 271, removed", + log: [ + "id 93, removed", + "id 94, removed" + ], + annotation: [ + "id 93, removed", + "id 94, removed" + ], + queueable_job: [ + "id 93, removed", + "id 94, removed" + ] + }, + "id 272, removed" + ], + request: [ + { + _: "id 57, removed", + abuse: [ + "id 49, removed", + "id 50, removed" + ], + message: [ + "id 49, removed", + "id 50, removed" + ], + job: [ + { + _: "id 269, removed", + log: [ + "id 91, removed", + "id 92, removed" + ], + annotation: [ + "id 91, removed", + "id 92, removed" + ], + queueable_job: [ + "id 91, removed", + "id 92, removed" + ] + }, + "id 270, removed" + ], + build: [ + { + _: "id 266, removed", + job: [ + "id 267, removed" + ], + repository: [ + "id 110, present", + "id 109, present" + ], + tag: [ + "id 64, present" + ], + branch: [ + "id 136, present" + ], + stage: [ + "id 73, removed" + ] + }, + "id 268, removed" + ] + }, + "id 58, removed", + { + _: "id 55, removed", + abuse: [ + "id 47, removed", + "id 48, removed" + ], + message: [ + "id 47, removed", + "id 48, removed" + ], + job: [ + { + _: "id 264, removed", + log: [ + "id 89, removed", + "id 90, removed" + ], + annotation: [ + "id 89, removed", + "id 90, removed" + ], + queueable_job: [ + "id 89, removed", + "id 90, removed" + ] + }, + "id 265, removed" + ], + build: [ + { + _: "id 261, removed", + job: [ + "id 262, removed" + ], + repository: [ + "id 108, present", + "id 107, present" + ], + tag: [ + "id 63, present" + ], + branch: [ + "id 135, present" + ], + stage: [ + "id 72, removed" + ] + }, + "id 263, removed" + ] + }, + "id 56, removed" + ], + abuse: [ + "id 51, removed", + "id 52, removed" + ], + subscription: [ + { + _: "id 1, removed", + invoice: [ + "id 1, removed", + "id 2, removed" + ] + }, + { + _: "id 2, removed", + invoice: [ + "id 3, removed", + "id 4, removed" + ] + } + ], + owner_group: [ + "id 1, removed", + "id 2, removed" + ], + trial: [ + { + _: "id 1, removed", + trial_allowance: [ + "id 1, removed", + "id 2, removed" + ] + }, + { + _: "id 2, removed", + trial_allowance: [ + "id 3, removed", + "id 4, removed" + ] + } + ], + trial_allowance: [ + "id 5, removed", + "id 6, removed" + ], + broadcast: [ + "id 1, removed", + "id 2, removed" + ], + star: [ + "id 1, removed", + "id 2, removed" + ], + permission: [ + "id 1, removed", + "id 2, removed" + ], + token: [ + "id 9, removed", + "id 10, removed" + ], + email: [ + "id 9, removed", + "id 10, removed" + ], + membership: [ + "id 1, removed", + "id 2, removed" + ], + user_beta_feature: [ + "id 1, removed", + "id 2, removed" + ] + } + end +end \ No newline at end of file From 8a4eacc8e9a2e6293c7c1dbc003aca31de86b73c Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 12 Nov 2021 00:09:40 +0100 Subject: [PATCH 73/88] new expected files for removing whole users, orgs and repos --- .../abuse_14-26.json | 20 +-- .../abuse_27-47.json | 20 +-- .../abuse_48-52.json | 20 +-- .../abuse_9-13.json | 20 +-- ...tation_17-21.json => annotation_1-19.json} | 40 ++--- .../annotation_20-24.json} | 40 ++--- .../annotation_25-29.json} | 40 ++--- .../annotation_30-34.json | 55 +++++++ .../annotation_49-53.json} | 36 ++-- ...ation_53-89.json => annotation_54-58.json} | 36 ++-- ...ation_90-94.json => annotation_73-91.json} | 40 ++--- .../annotation_92-94.json | 35 ++++ .../branch_86-91.json | 8 +- .../broadcast_1-2.json | 8 +- .../build_1-58.json | 155 ++++++++++++++++++ .../build_143-151.json | 155 ++++++++++++++++++ ...{build_145-210.json => build_153-210.json} | 44 ++--- .../build_211-266.json | 155 ++++++++++++++++++ .../build_260-268.json | 95 ----------- .../build_268-268.json | 35 ++++ .../build_60-70.json} | 44 ++--- .../build_73-83.json | 155 ++++++++++++++++++ .../build_85-140.json} | 42 ++--- .../commit_217-227.json | 20 +-- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +- .../invoice_1-4.json | 16 +- .../job_139-147.json | 150 +++++++++++++++++ .../job_149-155.json} | 58 +++---- .../job_157-163.json | 150 +++++++++++++++++ .../job_164-212.json | 150 +++++++++++++++++ .../remove_org_with_dependencies/job_2-6.json | 150 +++++++++++++++++ .../job_213-217.json | 150 +++++++++++++++++ .../{job_154-264.json => job_262-269.json} | 44 ++--- .../{job_265-272.json => job_270-272.json} | 70 +------- .../job_57-64.json | 150 +++++++++++++++++ .../job_66-72.json} | 38 ++--- .../job_7-56.json} | 56 +++---- .../{job_76-86.json => job_74-81.json} | 52 +++--- .../job_82-89.json | 150 +++++++++++++++++ .../job_90-94.json | 150 +++++++++++++++++ .../log_1-19.json} | 40 ++--- .../log_20-24.json} | 40 ++--- .../log_25-29.json} | 40 ++--- .../log_30-34.json | 75 +++++++++ .../log_49-53.json} | 36 ++-- .../{log_53-89.json => log_54-58.json} | 36 ++-- .../{log_90-94.json => log_73-91.json} | 40 ++--- .../log_92-94.json | 47 ++++++ .../message_14-26.json | 20 +-- .../message_27-47.json | 20 +-- .../message_48-50.json | 12 +- .../message_9-13.json | 20 +-- .../organization_1-1.json | 4 +- .../owner_group_1-2.json | 8 +- .../pull_request_3-6.json | 8 +- ...job_17-21.json => queueable_job_1-19.json} | 16 +- .../queueable_job_20-24.json} | 16 +- .../queueable_job_25-29.json} | 16 +- .../queueable_job_30-34.json | 25 +++ .../queueable_job_49-53.json} | 8 +- ...ob_53-89.json => queueable_job_54-58.json} | 12 +- .../queueable_job_73-91.json | 25 +++ .../queueable_job_92-94.json} | 8 - .../repository_1-66.json | 8 +- .../request_11-15.json | 20 +-- .../request_16-30.json | 20 +-- .../request_31-55.json | 20 +-- .../request_56-58.json | 12 +- .../ssl_key_33-34.json | 8 +- .../stage_20-32.json | 50 ++++++ .../stage_33-37.json | 50 ++++++ .../stage_38-50.json | 50 ++++++ .../stage_51-63.json | 50 ++++++ .../stage_72-73.json | 23 +++ .../star_3-4.json | 8 +- .../subscription_1-2.json | 8 +- .../tag_33-38.json | 8 +- .../trial_1-2.json | 8 +- .../trial_allowance_1-5.json | 20 +-- .../trial_allowance_6-6.json | 4 +- .../abuse_14-26.json | 20 +-- .../abuse_27-30.json | 16 +- .../abuse_9-13.json | 20 +-- .../annotation_1-19.json} | 40 ++--- .../annotation_20-24.json} | 40 ++--- .../annotation_25-29.json} | 40 ++--- .../annotation_30-34.json | 55 +++++++ .../annotation_49-53.json} | 36 ++-- .../annotation_53-56.json | 45 ----- .../annotation_54-56.json | 35 ++++ .../branch_86-91.json | 8 +- .../build_1-58.json | 155 ++++++++++++++++++ .../build_143-151.json | 155 ++++++++++++++++++ .../build_145-158.json | 125 -------------- .../build_153-158.json} | 28 ++-- .../{build_50-70.json => build_60-70.json} | 44 ++--- .../build_73-83.json | 155 ++++++++++++++++++ .../build_85-140.json} | 42 ++--- .../commit_217-227.json | 20 +-- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +- .../job_139-147.json | 150 +++++++++++++++++ .../job_149-155.json} | 58 +++---- .../{job_154-160.json => job_157-160.json} | 47 +----- .../job_2-6.json | 150 +++++++++++++++++ .../job_57-64.json | 150 +++++++++++++++++ .../{job_62-72.json => job_66-72.json} | 38 ++--- .../{job_54-61.json => job_7-56.json} | 56 +++---- .../{job_76-86.json => job_74-81.json} | 52 +++--- .../job_82-89.json | 150 +++++++++++++++++ .../job_90-94.json | 150 +++++++++++++++++ .../log_1-19.json} | 40 ++--- .../log_20-24.json} | 40 ++--- .../log_25-29.json} | 40 ++--- .../log_30-34.json | 75 +++++++++ .../log_49-53.json} | 36 ++-- .../{log_53-56.json => log_54-56.json} | 26 +-- .../message_14-26.json | 20 +-- .../message_27-30.json | 16 +- .../message_9-13.json | 20 +-- .../pull_request_3-6.json | 8 +- .../queueable_job_1-19.json} | 16 +- .../queueable_job_20-24.json} | 16 +- .../queueable_job_25-29.json} | 16 +- .../queueable_job_30-34.json | 25 +++ .../queueable_job_49-53.json} | 8 +- ...ob_53-56.json => queueable_job_54-56.json} | 4 - .../repository_1-1.json | 4 +- .../request_11-15.json | 20 +-- .../request_16-30.json | 20 +-- .../request_31-34.json | 16 +- .../ssl_key_33-34.json | 8 +- .../stage_20-32.json | 50 ++++++ .../stage_33-37.json | 50 ++++++ .../stage_38-50.json | 50 ++++++ .../stage_51-51.json | 14 ++ .../star_3-4.json | 8 +- .../tag_33-38.json | 8 +- .../abuse_14-26.json | 20 +-- .../abuse_27-47.json | 20 +-- .../abuse_48-52.json | 20 +-- .../abuse_9-13.json | 20 +-- .../annotation_1-19.json} | 40 ++--- .../annotation_20-24.json} | 40 ++--- .../annotation_25-29.json} | 40 ++--- .../annotation_30-34.json | 55 +++++++ .../annotation_49-53.json} | 36 ++-- ...ation_53-89.json => annotation_54-58.json} | 36 ++-- ...ation_90-94.json => annotation_73-91.json} | 40 ++--- .../annotation_92-94.json | 35 ++++ .../branch_86-91.json | 8 +- .../broadcast_1-2.json | 8 +- .../build_1-58.json | 155 ++++++++++++++++++ .../build_143-151.json | 155 ++++++++++++++++++ ...{build_145-210.json => build_153-210.json} | 44 ++--- .../build_211-266.json | 155 ++++++++++++++++++ .../build_268-268.json | 35 ++++ .../build_60-70.json} | 44 ++--- .../build_73-83.json | 155 ++++++++++++++++++ .../build_85-140.json} | 42 ++--- .../commit_217-227.json | 20 +-- .../commit_228-228.json | 4 +- .../cron_3-4.json | 8 +- .../email_9-10.json | 8 +- .../invoice_1-4.json | 16 +- .../job_139-147.json | 150 +++++++++++++++++ .../job_149-155.json} | 58 +++---- .../job_157-163.json | 150 +++++++++++++++++ .../job_164-212.json | 150 +++++++++++++++++ .../job_2-6.json | 150 +++++++++++++++++ .../job_213-217.json | 150 +++++++++++++++++ .../{job_154-264.json => job_262-269.json} | 44 ++--- .../{job_265-272.json => job_270-272.json} | 70 +------- .../job_57-64.json | 150 +++++++++++++++++ .../job_66-72.json} | 38 ++--- .../job_7-56.json} | 56 +++---- .../{job_76-86.json => job_74-81.json} | 52 +++--- .../job_82-89.json | 150 +++++++++++++++++ .../job_90-94.json | 150 +++++++++++++++++ .../{log_17-21.json => log_1-19.json} | 40 ++--- .../log_20-24.json} | 40 ++--- .../log_25-29.json} | 40 ++--- .../log_30-34.json | 75 +++++++++ .../log_49-53.json} | 36 ++-- .../{log_53-89.json => log_54-58.json} | 36 ++-- .../{log_90-94.json => log_73-91.json} | 40 ++--- .../log_92-94.json | 47 ++++++ .../message_14-26.json | 20 +-- .../message_27-47.json | 20 +-- .../message_48-50.json | 12 +- .../message_9-13.json | 20 +-- .../owner_group_1-2.json | 8 +- .../pull_request_3-6.json | 8 +- .../queueable_job_1-19.json} | 16 +- .../queueable_job_20-24.json} | 16 +- .../queueable_job_25-29.json} | 16 +- .../queueable_job_30-34.json | 25 +++ .../queueable_job_49-53.json} | 8 +- ...ob_53-89.json => queueable_job_54-58.json} | 12 +- .../queueable_job_73-91.json | 25 +++ .../queueable_job_92-94.json} | 8 - .../repository_1-66.json | 8 +- .../request_11-15.json | 20 +-- .../request_16-30.json | 20 +-- .../request_31-55.json | 20 +-- .../request_56-58.json | 12 +- .../ssl_key_33-34.json | 8 +- .../stage_20-32.json | 50 ++++++ .../stage_33-37.json | 50 ++++++ .../stage_38-50.json | 50 ++++++ .../stage_51-63.json | 50 ++++++ .../stage_72-73.json | 23 +++ .../star_1-6.json | 16 +- .../subscription_1-2.json | 8 +- .../tag_33-38.json | 8 +- .../token_9-10.json | 8 +- .../trial_1-2.json | 8 +- .../trial_allowance_1-5.json | 20 +-- .../trial_allowance_6-6.json | 4 +- .../user_9-9.json | 4 +- 221 files changed, 8043 insertions(+), 2238 deletions(-) rename spec/support/expected_files/remove_org_with_dependencies/{annotation_17-21.json => annotation_1-19.json} (58%) rename spec/support/expected_files/{remove_user_with_dependencies/annotation_22-26.json => remove_org_with_dependencies/annotation_20-24.json} (58%) rename spec/support/expected_files/{remove_user_with_dependencies/annotation_27-31.json => remove_org_with_dependencies/annotation_25-29.json} (58%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_30-34.json rename spec/support/expected_files/{remove_repo_with_dependencies/annotation_32-52.json => remove_org_with_dependencies/annotation_49-53.json} (61%) rename spec/support/expected_files/remove_org_with_dependencies/{annotation_53-89.json => annotation_54-58.json} (58%) rename spec/support/expected_files/remove_org_with_dependencies/{annotation_90-94.json => annotation_73-91.json} (55%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/annotation_92-94.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_1-58.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_143-151.json rename spec/support/expected_files/remove_org_with_dependencies/{build_145-210.json => build_153-210.json} (84%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_211-266.json delete mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_260-268.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_268-268.json rename spec/support/expected_files/{remove_user_with_dependencies/build_50-70.json => remove_org_with_dependencies/build_60-70.json} (85%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/build_73-83.json rename spec/support/expected_files/{remove_repo_with_dependencies/build_75-140.json => remove_org_with_dependencies/build_85-140.json} (85%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_139-147.json rename spec/support/expected_files/{remove_repo_with_dependencies/job_87-150.json => remove_org_with_dependencies/job_149-155.json} (82%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_157-163.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_164-212.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_2-6.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_213-217.json rename spec/support/expected_files/remove_org_with_dependencies/{job_154-264.json => job_262-269.json} (80%) rename spec/support/expected_files/remove_org_with_dependencies/{job_265-272.json => job_270-272.json} (52%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_57-64.json rename spec/support/expected_files/{remove_user_with_dependencies/job_62-72.json => remove_org_with_dependencies/job_66-72.json} (85%) rename spec/support/expected_files/{remove_user_with_dependencies/job_54-61.json => remove_org_with_dependencies/job_7-56.json} (82%) rename spec/support/expected_files/remove_org_with_dependencies/{job_76-86.json => job_74-81.json} (82%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_82-89.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/job_90-94.json rename spec/support/expected_files/{remove_repo_with_dependencies/log_17-21.json => remove_org_with_dependencies/log_1-19.json} (71%) rename spec/support/expected_files/{remove_repo_with_dependencies/log_22-26.json => remove_org_with_dependencies/log_20-24.json} (71%) rename spec/support/expected_files/{remove_user_with_dependencies/log_27-31.json => remove_org_with_dependencies/log_25-29.json} (71%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_30-34.json rename spec/support/expected_files/{remove_repo_with_dependencies/log_32-52.json => remove_org_with_dependencies/log_49-53.json} (73%) rename spec/support/expected_files/remove_org_with_dependencies/{log_53-89.json => log_54-58.json} (71%) rename spec/support/expected_files/remove_org_with_dependencies/{log_90-94.json => log_73-91.json} (69%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/log_92-94.json rename spec/support/expected_files/remove_org_with_dependencies/{queueable_job_17-21.json => queueable_job_1-19.json} (76%) rename spec/support/expected_files/{remove_user_with_dependencies/queueable_job_22-26.json => remove_org_with_dependencies/queueable_job_20-24.json} (76%) rename spec/support/expected_files/{remove_user_with_dependencies/queueable_job_27-31.json => remove_org_with_dependencies/queueable_job_25-29.json} (76%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_30-34.json rename spec/support/expected_files/{remove_repo_with_dependencies/queueable_job_32-52.json => remove_org_with_dependencies/queueable_job_49-53.json} (87%) rename spec/support/expected_files/remove_org_with_dependencies/{queueable_job_53-89.json => queueable_job_54-58.json} (75%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/queueable_job_73-91.json rename spec/support/expected_files/{remove_user_with_dependencies/queueable_job_90-94.json => remove_org_with_dependencies/queueable_job_92-94.json} (67%) create mode 100644 spec/support/expected_files/remove_org_with_dependencies/stage_20-32.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/stage_33-37.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/stage_38-50.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/stage_51-63.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/stage_72-73.json rename spec/support/expected_files/{remove_user_with_dependencies/annotation_17-21.json => remove_repo_with_dependencies/annotation_1-19.json} (58%) rename spec/support/expected_files/{remove_org_with_dependencies/annotation_22-26.json => remove_repo_with_dependencies/annotation_20-24.json} (58%) rename spec/support/expected_files/{remove_org_with_dependencies/annotation_27-31.json => remove_repo_with_dependencies/annotation_25-29.json} (58%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_30-34.json rename spec/support/expected_files/{remove_user_with_dependencies/annotation_32-52.json => remove_repo_with_dependencies/annotation_49-53.json} (61%) delete mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/annotation_54-56.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_1-58.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_143-151.json delete mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json rename spec/support/expected_files/{remove_user_with_dependencies/build_260-268.json => remove_repo_with_dependencies/build_153-158.json} (80%) rename spec/support/expected_files/remove_repo_with_dependencies/{build_50-70.json => build_60-70.json} (85%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/build_73-83.json rename spec/support/expected_files/{remove_user_with_dependencies/build_75-140.json => remove_repo_with_dependencies/build_85-140.json} (85%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_139-147.json rename spec/support/expected_files/{remove_user_with_dependencies/job_87-150.json => remove_repo_with_dependencies/job_149-155.json} (82%) rename spec/support/expected_files/remove_repo_with_dependencies/{job_154-160.json => job_157-160.json} (63%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_2-6.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_57-64.json rename spec/support/expected_files/remove_repo_with_dependencies/{job_62-72.json => job_66-72.json} (85%) rename spec/support/expected_files/remove_repo_with_dependencies/{job_54-61.json => job_7-56.json} (82%) rename spec/support/expected_files/remove_repo_with_dependencies/{job_76-86.json => job_74-81.json} (82%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_82-89.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/job_90-94.json rename spec/support/expected_files/{remove_org_with_dependencies/log_17-21.json => remove_repo_with_dependencies/log_1-19.json} (71%) rename spec/support/expected_files/{remove_user_with_dependencies/log_22-26.json => remove_repo_with_dependencies/log_20-24.json} (71%) rename spec/support/expected_files/{remove_org_with_dependencies/log_27-31.json => remove_repo_with_dependencies/log_25-29.json} (71%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/log_30-34.json rename spec/support/expected_files/{remove_user_with_dependencies/log_32-52.json => remove_repo_with_dependencies/log_49-53.json} (73%) rename spec/support/expected_files/remove_repo_with_dependencies/{log_53-56.json => log_54-56.json} (57%) rename spec/support/expected_files/{remove_user_with_dependencies/queueable_job_17-21.json => remove_repo_with_dependencies/queueable_job_1-19.json} (76%) rename spec/support/expected_files/{remove_org_with_dependencies/queueable_job_22-26.json => remove_repo_with_dependencies/queueable_job_20-24.json} (76%) rename spec/support/expected_files/{remove_org_with_dependencies/queueable_job_27-31.json => remove_repo_with_dependencies/queueable_job_25-29.json} (76%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/queueable_job_30-34.json rename spec/support/expected_files/{remove_user_with_dependencies/queueable_job_32-52.json => remove_repo_with_dependencies/queueable_job_49-53.json} (87%) rename spec/support/expected_files/remove_repo_with_dependencies/{queueable_job_53-56.json => queueable_job_54-56.json} (80%) create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/stage_20-32.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/stage_33-37.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/stage_38-50.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/stage_51-51.json rename spec/support/expected_files/{remove_repo_with_dependencies/annotation_17-21.json => remove_user_with_dependencies/annotation_1-19.json} (58%) rename spec/support/expected_files/{remove_repo_with_dependencies/annotation_22-26.json => remove_user_with_dependencies/annotation_20-24.json} (58%) rename spec/support/expected_files/{remove_repo_with_dependencies/annotation_27-31.json => remove_user_with_dependencies/annotation_25-29.json} (58%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_30-34.json rename spec/support/expected_files/{remove_org_with_dependencies/annotation_32-52.json => remove_user_with_dependencies/annotation_49-53.json} (61%) rename spec/support/expected_files/remove_user_with_dependencies/{annotation_53-89.json => annotation_54-58.json} (58%) rename spec/support/expected_files/remove_user_with_dependencies/{annotation_90-94.json => annotation_73-91.json} (55%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/annotation_92-94.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_1-58.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_143-151.json rename spec/support/expected_files/remove_user_with_dependencies/{build_145-210.json => build_153-210.json} (84%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_211-266.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_268-268.json rename spec/support/expected_files/{remove_org_with_dependencies/build_50-70.json => remove_user_with_dependencies/build_60-70.json} (85%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/build_73-83.json rename spec/support/expected_files/{remove_org_with_dependencies/build_75-140.json => remove_user_with_dependencies/build_85-140.json} (85%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_139-147.json rename spec/support/expected_files/{remove_org_with_dependencies/job_87-150.json => remove_user_with_dependencies/job_149-155.json} (82%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_157-163.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_164-212.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_2-6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_213-217.json rename spec/support/expected_files/remove_user_with_dependencies/{job_154-264.json => job_262-269.json} (80%) rename spec/support/expected_files/remove_user_with_dependencies/{job_265-272.json => job_270-272.json} (52%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_57-64.json rename spec/support/expected_files/{remove_org_with_dependencies/job_62-72.json => remove_user_with_dependencies/job_66-72.json} (85%) rename spec/support/expected_files/{remove_org_with_dependencies/job_54-61.json => remove_user_with_dependencies/job_7-56.json} (82%) rename spec/support/expected_files/remove_user_with_dependencies/{job_76-86.json => job_74-81.json} (82%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_82-89.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/job_90-94.json rename spec/support/expected_files/remove_user_with_dependencies/{log_17-21.json => log_1-19.json} (71%) rename spec/support/expected_files/{remove_org_with_dependencies/log_22-26.json => remove_user_with_dependencies/log_20-24.json} (71%) rename spec/support/expected_files/{remove_repo_with_dependencies/log_27-31.json => remove_user_with_dependencies/log_25-29.json} (71%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_30-34.json rename spec/support/expected_files/{remove_org_with_dependencies/log_32-52.json => remove_user_with_dependencies/log_49-53.json} (73%) rename spec/support/expected_files/remove_user_with_dependencies/{log_53-89.json => log_54-58.json} (71%) rename spec/support/expected_files/remove_user_with_dependencies/{log_90-94.json => log_73-91.json} (69%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/log_92-94.json rename spec/support/expected_files/{remove_repo_with_dependencies/queueable_job_17-21.json => remove_user_with_dependencies/queueable_job_1-19.json} (76%) rename spec/support/expected_files/{remove_repo_with_dependencies/queueable_job_22-26.json => remove_user_with_dependencies/queueable_job_20-24.json} (76%) rename spec/support/expected_files/{remove_repo_with_dependencies/queueable_job_27-31.json => remove_user_with_dependencies/queueable_job_25-29.json} (76%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_30-34.json rename spec/support/expected_files/{remove_org_with_dependencies/queueable_job_32-52.json => remove_user_with_dependencies/queueable_job_49-53.json} (87%) rename spec/support/expected_files/remove_user_with_dependencies/{queueable_job_53-89.json => queueable_job_54-58.json} (75%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/queueable_job_73-91.json rename spec/support/expected_files/{remove_org_with_dependencies/queueable_job_90-94.json => remove_user_with_dependencies/queueable_job_92-94.json} (67%) create mode 100644 spec/support/expected_files/remove_user_with_dependencies/stage_20-32.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/stage_33-37.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/stage_38-50.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/stage_51-63.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/stage_72-73.json diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json index ebedf9c..0496343 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_14-26.json @@ -8,8 +8,8 @@ "request_id": 15, "level": 14, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 15, @@ -18,8 +18,8 @@ "request_id": 17, "level": 15, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 16, @@ -28,8 +28,8 @@ "request_id": 17, "level": 16, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 25, @@ -38,8 +38,8 @@ "request_id": 29, "level": 25, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 26, @@ -48,8 +48,8 @@ "request_id": 29, "level": 26, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json index 7947dc1..b4be048 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_27-47.json @@ -8,8 +8,8 @@ "request_id": 31, "level": 27, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 28, @@ -18,8 +18,8 @@ "request_id": 31, "level": 28, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 29, @@ -28,8 +28,8 @@ "request_id": 33, "level": 29, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 30, @@ -38,8 +38,8 @@ "request_id": 33, "level": 30, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 47, @@ -48,8 +48,8 @@ "request_id": 55, "level": 47, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json index c83af21..e91875b 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_48-52.json @@ -8,8 +8,8 @@ "request_id": 55, "level": 48, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 49, @@ -18,8 +18,8 @@ "request_id": 57, "level": 49, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 50, @@ -28,8 +28,8 @@ "request_id": 57, "level": 50, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 51, @@ -38,8 +38,8 @@ "request_id": null, "level": 51, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 52, @@ -48,8 +48,8 @@ "request_id": null, "level": 52, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json index cbd7c03..a41cfaf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/abuse_9-13.json @@ -8,8 +8,8 @@ "request_id": 11, "level": 9, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 10, @@ -18,8 +18,8 @@ "request_id": 11, "level": 10, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 11, @@ -28,8 +28,8 @@ "request_id": 13, "level": 11, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 12, @@ -38,8 +38,8 @@ "request_id": 13, "level": 12, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 13, @@ -48,8 +48,8 @@ "request_id": 15, "level": 13, "reason": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_1-19.json similarity index 58% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_1-19.json index 1aaa8a8..9759e15 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_1-19.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_20-24.json similarity index 58% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_20-24.json index e34ac17..f148942 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_20-24.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_25-29.json similarity index 58% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_25-29.json index 6466a02..3c3eef2 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_25-29.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_30-34.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_30-34.json new file mode 100644 index 0000000..3af3afe --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_30-34.json @@ -0,0 +1,55 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 33, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 34, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_49-53.json similarity index 61% rename from spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_49-53.json index bf32a41..e66b1fd 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_49-53.json @@ -1,23 +1,13 @@ { "table_name": "annotations", "data": [ - { - "id": 32, - "job_id": 86, - "url": null, - "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "annotation_provider_id": 0, - "status": null - }, { "id": 49, "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, @@ -26,8 +16,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, @@ -36,8 +26,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, @@ -46,8 +36,18 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_54-58.json similarity index 58% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_54-58.json index 545bbfb..14655d1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_54-58.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 53, + "id": 54, "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 54, - "job_id": 154, + "id": 55, + "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 55, + "id": 56, "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 56, - "job_id": 159, + "id": 57, + "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 89, - "job_id": 264, + "id": 58, + "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_73-91.json similarity index 55% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json rename to spec/support/expected_files/remove_org_with_dependencies/annotation_73-91.json index d1237ed..f8c2144 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_73-91.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 90, - "job_id": 264, + "id": 73, + "job_id": 216, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 91, - "job_id": 269, + "id": 74, + "job_id": 216, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 92, - "job_id": 269, + "id": 89, + "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 93, - "job_id": 271, + "id": 90, + "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 94, - "job_id": 271, + "id": 91, + "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_92-94.json b/spec/support/expected_files/remove_org_with_dependencies/annotation_92-94.json new file mode 100644 index 0000000..aa0c9bb --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/annotation_92-94.json @@ -0,0 +1,35 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 92, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 93, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 94, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json index 8ec1455..18d9af4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_org_with_dependencies/branch_86-91.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 91, @@ -16,8 +16,8 @@ "last_build_id": null, "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json index c70a88d..58cedbb 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "category": null }, { @@ -19,8 +19,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "category": null } ] diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_1-58.json b/spec/support/expected_files/remove_org_with_dependencies/build_1-58.json new file mode 100644 index 0000000..1d1eb9f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_1-58.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 1, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 51, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 58, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_143-151.json b/spec/support/expected_files/remove_org_with_dependencies/build_143-151.json new file mode 100644 index 0000000..3a54218 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_143-151.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 143, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 146, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 151, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_org_with_dependencies/build_153-210.json similarity index 84% rename from spec/support/expected_files/remove_org_with_dependencies/build_145-210.json rename to spec/support/expected_files/remove_org_with_dependencies/build_153-210.json index 79a5882..31f1a77 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_153-210.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 145, + "id": 153, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 31, "state": null, "duration": null, "owner_id": null, @@ -27,21 +27,21 @@ "private": null, "pull_request_id": null, "branch_id": null, - "tag_id": 33, + "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 148, + "id": 156, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, - "commit_id": 227, - "request_id": null, + "commit_id": null, + "request_id": 33, "state": null, "duration": null, "owner_id": null, @@ -62,16 +62,16 @@ "sender_type": null }, { - "id": 153, + "id": 158, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": 31, + "request_id": 33, "state": null, "duration": null, "owner_id": null, @@ -92,20 +92,20 @@ "sender_type": null }, { - "id": 158, + "id": 161, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": 33, + "request_id": null, "state": null, "duration": null, - "owner_id": null, - "owner_type": null, + "owner_id": 1, + "owner_type": "Organization", "event_type": null, "previous_state": null, "pull_request_title": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_211-266.json b/spec/support/expected_files/remove_org_with_dependencies/build_211-266.json new file mode 100644 index 0000000..fec42d9 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_211-266.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 211, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 1, + "sender_type": "Organization" + }, + { + "id": 260, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 1, + "sender_type": "Organization" + }, + { + "id": 261, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 263, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 266, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json deleted file mode 100644 index c504ff1..0000000 --- a/spec/support/expected_files/remove_org_with_dependencies/build_260-268.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "table_name": "builds", - "data": [ - { - "id": 260, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "config": null, - "commit_id": null, - "request_id": null, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": 1, - "sender_type": "Organization" - }, - { - "id": 263, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "config": null, - "commit_id": null, - "request_id": 55, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - }, - { - "id": 268, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "config": null, - "commit_id": null, - "request_id": 57, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_268-268.json b/spec/support/expected_files/remove_org_with_dependencies/build_268-268.json new file mode 100644 index 0000000..7d7f053 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_268-268.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 268, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_org_with_dependencies/build_60-70.json similarity index 85% rename from spec/support/expected_files/remove_user_with_dependencies/build_50-70.json rename to spec/support/expected_files/remove_org_with_dependencies/build_60-70.json index 36f5cf1..30dd45c 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_60-70.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 50, - "repository_id": 1, + "id": 60, + "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, "request_id": null, @@ -26,22 +26,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": null, + "branch_id": 86, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 53, + "id": 63, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, - "commit_id": null, - "request_id": 11, + "commit_id": 217, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -62,15 +62,15 @@ "sender_type": null }, { - "id": 60, + "id": 65, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, - "commit_id": null, + "commit_id": 217, "request_id": null, "state": null, "duration": null, @@ -86,22 +86,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": 86, + "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 65, + "id": 68, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, - "commit_id": 217, - "request_id": null, + "commit_id": null, + "request_id": 13, "state": null, "duration": null, "owner_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_73-83.json b/spec/support/expected_files/remove_org_with_dependencies/build_73-83.json new file mode 100644 index 0000000..deb1151 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/build_73-83.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 73, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 78, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 83, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_org_with_dependencies/build_85-140.json similarity index 85% rename from spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json rename to spec/support/expected_files/remove_org_with_dependencies/build_85-140.json index 2d12552..82588b1 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_org_with_dependencies/build_85-140.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 75, + "id": 85, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": 15, + "request_id": 17, "state": null, "duration": null, "owner_id": null, @@ -32,15 +32,15 @@ "sender_type": null }, { - "id": 80, + "id": 88, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, - "commit_id": 219, + "commit_id": null, "request_id": null, "state": null, "duration": null, @@ -55,23 +55,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 85, + "id": 137, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": 17, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -85,23 +85,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 137, + "id": 138, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 29, "state": null, "duration": null, "owner_id": null, @@ -115,7 +115,7 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": 3, + "pull_request_id": null, "branch_id": null, "tag_id": null, "sender_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json index e241ba2..b10f234 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": 86, "tag_id": null }, @@ -32,8 +32,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": 86, "tag_id": null }, @@ -50,8 +50,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": null, "tag_id": null }, @@ -68,8 +68,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": null, "tag_id": null }, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json index 7a2f051..4317644 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_org_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json index 08bf714..2bc9524 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json index 234c492..b1963ac 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -14,8 +14,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -24,8 +24,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -34,8 +34,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_139-147.json b/spec/support/expected_files/remove_org_with_dependencies/job_139-147.json new file mode 100644 index 0000000..b406dc8 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_139-147.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 139, + "repository_id": null, + "commit_id": null, + "source_id": 138, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 144, + "repository_id": null, + "commit_id": null, + "source_id": 143, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 147, + "repository_id": null, + "commit_id": null, + "source_id": 146, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_org_with_dependencies/job_149-155.json similarity index 82% rename from spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json rename to spec/support/expected_files/remove_org_with_dependencies/job_149-155.json index 36679d0..8c705ae 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_149-155.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 87, + "id": 149, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 141, + "id": 150, "repository_id": null, - "commit_id": null, - "source_id": 29, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 142, + "id": 152, "repository_id": null, "commit_id": null, - "source_id": 29, - "source_type": "Request", + "source_id": 151, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 149, + "id": 154, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 150, + "id": 155, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_157-163.json b/spec/support/expected_files/remove_org_with_dependencies/job_157-163.json new file mode 100644 index 0000000..64ec3e3 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_157-163.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 157, + "repository_id": null, + "commit_id": null, + "source_id": 156, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 159, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 160, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 162, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52 + }, + { + "id": 163, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_164-212.json b/spec/support/expected_files/remove_org_with_dependencies/job_164-212.json new file mode 100644 index 0000000..6574272 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_164-212.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 164, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53 + }, + { + "id": 165, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53 + }, + { + "id": 166, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 167, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 212, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 62 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_2-6.json b/spec/support/expected_files/remove_org_with_dependencies/job_2-6.json new file mode 100644 index 0000000..c8d418e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_2-6.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 2, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 3, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 4, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 5, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 6, + "repository_id": null, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_213-217.json b/spec/support/expected_files/remove_org_with_dependencies/job_213-217.json new file mode 100644 index 0000000..9d87609 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_213-217.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 213, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 62 + }, + { + "id": 214, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 63 + }, + { + "id": 215, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 63 + }, + { + "id": 216, + "repository_id": null, + "commit_id": null, + "source_id": 211, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 217, + "repository_id": null, + "commit_id": null, + "source_id": 211, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_org_with_dependencies/job_262-269.json similarity index 80% rename from spec/support/expected_files/remove_org_with_dependencies/job_154-264.json rename to spec/support/expected_files/remove_org_with_dependencies/job_262-269.json index c7c04f3..74f1b52 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_262-269.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 154, + "id": 262, "repository_id": null, "commit_id": null, - "source_id": 31, - "source_type": "Request", + "source_id": 261, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,10 +31,10 @@ "stage_id": null }, { - "id": 155, + "id": 264, "repository_id": null, "commit_id": null, - "source_id": 31, + "source_id": 55, "source_type": "Request", "queue": null, "type": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,10 +60,10 @@ "stage_id": null }, { - "id": 159, + "id": 265, "repository_id": null, "commit_id": null, - "source_id": 33, + "source_id": 55, "source_type": "Request", "queue": null, "type": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 160, + "id": 267, "repository_id": null, "commit_id": null, - "source_id": 33, - "source_type": "Request", + "source_id": 266, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,10 +118,10 @@ "stage_id": null }, { - "id": 264, + "id": 269, "repository_id": null, "commit_id": null, - "source_id": 55, + "source_id": 57, "source_type": "Request", "queue": null, "type": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_org_with_dependencies/job_270-272.json similarity index 52% rename from spec/support/expected_files/remove_org_with_dependencies/job_265-272.json rename to spec/support/expected_files/remove_org_with_dependencies/job_270-272.json index ca68aa6..172a265 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_270-272.json @@ -1,64 +1,6 @@ { "table_name": "jobs", "data": [ - { - "id": 265, - "repository_id": null, - "commit_id": null, - "source_id": 55, - "source_type": "Request", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - }, - { - "id": 269, - "repository_id": null, - "commit_id": null, - "source_id": 57, - "source_type": "Request", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - }, { "id": 270, "repository_id": null, @@ -73,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": 1, @@ -131,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": 1, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_57-64.json b/spec/support/expected_files/remove_org_with_dependencies/job_57-64.json new file mode 100644 index 0000000..e3d232a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_57-64.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 59, + "repository_id": null, + "commit_id": null, + "source_id": 58, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 64, + "repository_id": null, + "commit_id": null, + "source_id": 63, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_org_with_dependencies/job_66-72.json similarity index 85% rename from spec/support/expected_files/remove_user_with_dependencies/job_62-72.json rename to spec/support/expected_files/remove_org_with_dependencies/job_66-72.json index b617f85..2ebbf08 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_66-72.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 62, + "id": 66, "repository_id": null, - "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "commit_id": 217, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 66, + "id": 67, "repository_id": null, "commit_id": 217, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 67, + "id": 69, "repository_id": null, - "commit_id": 217, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 68, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_org_with_dependencies/job_7-56.json similarity index 82% rename from spec/support/expected_files/remove_user_with_dependencies/job_54-61.json rename to spec/support/expected_files/remove_org_with_dependencies/job_7-56.json index 2cff48b..ae8161e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_7-56.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 54, + "id": 7, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 1, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 55, + "id": 52, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 51, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 56, - "repository_id": 1, + "id": 54, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 57, - "repository_id": 1, + "id": 55, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 61, - "repository_id": null, + "id": 56, + "repository_id": 1, "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_org_with_dependencies/job_74-81.json similarity index 82% rename from spec/support/expected_files/remove_org_with_dependencies/job_76-86.json rename to spec/support/expected_files/remove_org_with_dependencies/job_74-81.json index 98cf653..9b7f8c4 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_org_with_dependencies/job_74-81.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 76, + "id": 74, "repository_id": null, "commit_id": null, - "source_id": 15, - "source_type": "Request", + "source_id": 73, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 77, + "id": 76, "repository_id": null, "commit_id": null, "source_id": 15, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 81, + "id": 77, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 82, + "id": 79, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 78, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 86, + "id": 81, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 219, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_82-89.json b/spec/support/expected_files/remove_org_with_dependencies/job_82-89.json new file mode 100644 index 0000000..3305b4d --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_82-89.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 84, + "repository_id": null, + "commit_id": null, + "source_id": 83, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 89, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/job_90-94.json new file mode 100644 index 0000000..f6f2570 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/job_90-94.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 90, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + }, + { + "id": 91, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 92, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 93, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 94, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/log_1-19.json similarity index 71% rename from spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json rename to spec/support/expected_files/remove_org_with_dependencies/log_1-19.json index 77dca65..9a6da64 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_1-19.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/log_20-24.json similarity index 71% rename from spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json rename to spec/support/expected_files/remove_org_with_dependencies/log_20-24.json index defb4d2..0d38ae6 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_20-24.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/log_25-29.json similarity index 71% rename from spec/support/expected_files/remove_user_with_dependencies/log_27-31.json rename to spec/support/expected_files/remove_org_with_dependencies/log_25-29.json index de85ad6..292ae11 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_25-29.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_30-34.json b/spec/support/expected_files/remove_org_with_dependencies/log_30-34.json new file mode 100644 index 0000000..d0d1e6f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_30-34.json @@ -0,0 +1,75 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 33, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 34, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/log_49-53.json similarity index 73% rename from spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json rename to spec/support/expected_files/remove_org_with_dependencies/log_49-53.json index f629c92..4c44d28 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_49-53.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 32, - "job_id": 86, + "id": 49, + "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 49, + "id": 50, "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 50, - "job_id": 141, + "id": 51, + "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 51, + "id": 52, "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 52, - "job_id": 149, + "id": 53, + "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/log_54-58.json similarity index 71% rename from spec/support/expected_files/remove_org_with_dependencies/log_53-89.json rename to spec/support/expected_files/remove_org_with_dependencies/log_54-58.json index 6609c3d..0dc4c87 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_54-58.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 53, + "id": 54, "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 54, - "job_id": 154, + "id": 55, + "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 55, + "id": 56, "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 56, - "job_id": 159, + "id": 57, + "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 89, - "job_id": 264, + "id": 58, + "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_73-91.json similarity index 69% rename from spec/support/expected_files/remove_org_with_dependencies/log_90-94.json rename to spec/support/expected_files/remove_org_with_dependencies/log_73-91.json index 73f7a28..acbaed6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/log_73-91.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 90, - "job_id": 264, + "id": 73, + "job_id": 216, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 91, - "job_id": 269, + "id": 74, + "job_id": 216, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 92, - "job_id": 269, + "id": 89, + "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 93, - "job_id": 271, + "id": 90, + "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 94, - "job_id": 271, + "id": 91, + "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_92-94.json b/spec/support/expected_files/remove_org_with_dependencies/log_92-94.json new file mode 100644 index 0000000..ea984f0 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/log_92-94.json @@ -0,0 +1,47 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 92, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 93, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 94, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json index 3da58fa..5222427 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 15, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 16, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 25, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 26, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json index b2d7a53..c215996 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 28, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 29, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 30, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 47, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json index 0e8ec3a..211acaa 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 49, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 50, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json index 71a8709..39aabb9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_org_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 10, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 11, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 12, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 13, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json index bc512fc..938ebdf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json +++ b/spec/support/expected_files/remove_org_with_dependencies/organization_1-1.json @@ -6,8 +6,8 @@ "name": null, "login": null, "github_id": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "avatar_url": null, "location": null, "email": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json index 522ea16..a7e3a1e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/owner_group_1-2.json @@ -6,16 +6,16 @@ "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 2, "uuid": null, "owner_id": 1, "owner_type": "Organization", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json index f67b359..d9b0ab9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 6, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_1-19.json similarity index 76% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_1-19.json index 383a7f2..858cbb5 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_1-19.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 1, + "job_id": 6 + }, + { + "id": 2, + "job_id": 6 + }, { "id": 17, "job_id": 54 @@ -12,14 +20,6 @@ { "id": 19, "job_id": 56 - }, - { - "id": 20, - "job_id": 56 - }, - { - "id": 21, - "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_20-24.json similarity index 76% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_20-24.json index f88dd7e..5274e58 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_20-24.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 20, + "job_id": 56 + }, + { + "id": 21, + "job_id": 61 + }, { "id": 22, "job_id": 61 @@ -12,14 +20,6 @@ { "id": 24, "job_id": 66 - }, - { - "id": 25, - "job_id": 71 - }, - { - "id": 26, - "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_25-29.json similarity index 76% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_25-29.json index fd90ec4..1fc2d88 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_25-29.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 25, + "job_id": 71 + }, + { + "id": 26, + "job_id": 71 + }, { "id": 27, "job_id": 76 @@ -12,14 +20,6 @@ { "id": 29, "job_id": 81 - }, - { - "id": 30, - "job_id": 81 - }, - { - "id": 31, - "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_30-34.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_30-34.json new file mode 100644 index 0000000..38ef88d --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_30-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 30, + "job_id": 81 + }, + { + "id": 31, + "job_id": 86 + }, + { + "id": 32, + "job_id": 86 + }, + { + "id": 33, + "job_id": 93 + }, + { + "id": 34, + "job_id": 93 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_49-53.json similarity index 87% rename from spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_49-53.json index f922173..98c6643 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_49-53.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 32, - "job_id": 86 - }, { "id": 49, "job_id": 141 @@ -20,6 +16,10 @@ { "id": 52, "job_id": 149 + }, + { + "id": 53, + "job_id": 154 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_54-58.json similarity index 75% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_54-58.json index 091c4ca..fdf0f32 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_53-89.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_54-58.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 53, - "job_id": 154 - }, { "id": 54, "job_id": 154 @@ -18,8 +14,12 @@ "job_id": 159 }, { - "id": 89, - "job_id": 264 + "id": 57, + "job_id": 166 + }, + { + "id": 58, + "job_id": 166 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_73-91.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_73-91.json new file mode 100644 index 0000000..ff4127a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_73-91.json @@ -0,0 +1,25 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 73, + "job_id": 216 + }, + { + "id": 74, + "job_id": 216 + }, + { + "id": 89, + "job_id": 264 + }, + { + "id": 90, + "job_id": 264 + }, + { + "id": 91, + "job_id": 269 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_92-94.json similarity index 67% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json rename to spec/support/expected_files/remove_org_with_dependencies/queueable_job_92-94.json index f37a5eb..52bcc99 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_90-94.json +++ b/spec/support/expected_files/remove_org_with_dependencies/queueable_job_92-94.json @@ -1,14 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 90, - "job_id": 264 - }, - { - "id": 91, - "job_id": 269 - }, { "id": 92, "job_id": 269 diff --git a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json index b6db4a9..0a67323 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_org_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -32,8 +32,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json index 0a560c0..a952522 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json index 1757adf..73f68be 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json index 4b2a16d..2067bdf 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json index 13907dc..130db6e 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_org_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json index c43c2fc..e2dfb2f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_org_with_dependencies/ssl_key_33-34.json @@ -6,16 +6,16 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 34, "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/stage_20-32.json b/spec/support/expected_files/remove_org_with_dependencies/stage_20-32.json new file mode 100644 index 0000000..91fcb2e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/stage_20-32.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 20, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 21, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 30, + "build_id": 51, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 31, + "build_id": 58, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 32, + "build_id": 63, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/stage_33-37.json b/spec/support/expected_files/remove_org_with_dependencies/stage_33-37.json new file mode 100644 index 0000000..4b99471 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/stage_33-37.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 33, + "build_id": 68, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 34, + "build_id": 73, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 35, + "build_id": 78, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 36, + "build_id": 83, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 37, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/stage_38-50.json b/spec/support/expected_files/remove_org_with_dependencies/stage_38-50.json new file mode 100644 index 0000000..40a0031 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/stage_38-50.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 38, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 47, + "build_id": 138, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 48, + "build_id": 143, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 49, + "build_id": 146, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 50, + "build_id": 151, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/stage_51-63.json b/spec/support/expected_files/remove_org_with_dependencies/stage_51-63.json new file mode 100644 index 0000000..944cb8b --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/stage_51-63.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 51, + "build_id": 156, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 52, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 53, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 62, + "build_id": 211, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 63, + "build_id": 211, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/stage_72-73.json b/spec/support/expected_files/remove_org_with_dependencies/stage_72-73.json new file mode 100644 index 0000000..5fe27f1 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/stage_72-73.json @@ -0,0 +1,23 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 72, + "build_id": 261, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 73, + "build_id": 266, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json index 72d4308..b61a1da 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_org_with_dependencies/star_3-4.json @@ -5,15 +5,15 @@ "id": 3, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 4, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json index 6b4e660..2b06806 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -50,8 +50,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json index 93816df..0dab47f 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_org_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 38, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json index c63384b..87b63a1 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 2, @@ -20,8 +20,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json index d45a224..16ca1a7 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 2, @@ -18,8 +18,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 3, @@ -28,8 +28,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 4, @@ -38,8 +38,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" }, { "id": 5, @@ -48,8 +48,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json index cb12b8d..5423e48 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_org_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "Organization", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC" + "created_at": "2021-04-11 21:59:33 UTC", + "updated_at": "2021-04-11 21:59:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json index b8c2a2f..ec93c33 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_14-26.json @@ -8,8 +8,8 @@ "request_id": 15, "level": 14, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 15, @@ -18,8 +18,8 @@ "request_id": 17, "level": 15, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 16, @@ -28,8 +28,8 @@ "request_id": 17, "level": 16, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 25, @@ -38,8 +38,8 @@ "request_id": 29, "level": 25, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 26, @@ -48,8 +48,8 @@ "request_id": 29, "level": 26, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json index 0c9495d..b5c7a3f 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_27-30.json @@ -8,8 +8,8 @@ "request_id": 31, "level": 27, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 28, @@ -18,8 +18,8 @@ "request_id": 31, "level": 28, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 29, @@ -28,8 +28,8 @@ "request_id": 33, "level": 29, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 30, @@ -38,8 +38,8 @@ "request_id": 33, "level": 30, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json index 8e1debe..a6b9b4b 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/abuse_9-13.json @@ -8,8 +8,8 @@ "request_id": 11, "level": 9, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 10, @@ -18,8 +18,8 @@ "request_id": 11, "level": 10, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 11, @@ -28,8 +28,8 @@ "request_id": 13, "level": 11, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 12, @@ -38,8 +38,8 @@ "request_id": 13, "level": 12, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 13, @@ -48,8 +48,8 @@ "request_id": 15, "level": 13, "reason": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_1-19.json similarity index 58% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json rename to spec/support/expected_files/remove_repo_with_dependencies/annotation_1-19.json index b09ff59..8e87d96 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_1-19.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_20-24.json similarity index 58% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json rename to spec/support/expected_files/remove_repo_with_dependencies/annotation_20-24.json index 5f3d9b9..5203a65 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_20-24.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_25-29.json similarity index 58% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json rename to spec/support/expected_files/remove_repo_with_dependencies/annotation_25-29.json index d0b52ae..7d073ad 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_25-29.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_30-34.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_30-34.json new file mode 100644 index 0000000..daa05fb --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_30-34.json @@ -0,0 +1,55 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 33, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 34, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_49-53.json similarity index 61% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json rename to spec/support/expected_files/remove_repo_with_dependencies/annotation_49-53.json index e1e743a..fb579c8 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_49-53.json @@ -1,23 +1,13 @@ { "table_name": "annotations", "data": [ - { - "id": 32, - "job_id": 86, - "url": null, - "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "annotation_provider_id": 0, - "status": null - }, { "id": 49, "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, @@ -26,8 +16,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, @@ -36,8 +26,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null }, @@ -46,8 +36,18 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json deleted file mode 100644 index bd42d0b..0000000 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_53-56.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "table_name": "annotations", - "data": [ - { - "id": 53, - "job_id": 154, - "url": null, - "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "annotation_provider_id": 0, - "status": null - }, - { - "id": 54, - "job_id": 154, - "url": null, - "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "annotation_provider_id": 0, - "status": null - }, - { - "id": 55, - "job_id": 159, - "url": null, - "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "annotation_provider_id": 0, - "status": null - }, - { - "id": 56, - "job_id": 159, - "url": null, - "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "annotation_provider_id": 0, - "status": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_54-56.json b/spec/support/expected_files/remove_repo_with_dependencies/annotation_54-56.json new file mode 100644 index 0000000..ae39964 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/annotation_54-56.json @@ -0,0 +1,35 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 54, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 55, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 56, + "job_id": 159, + "url": null, + "description": "some text", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json index 774630f..5bf0da8 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/branch_86-91.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 91, @@ -16,8 +16,8 @@ "last_build_id": null, "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_1-58.json b/spec/support/expected_files/remove_repo_with_dependencies/build_1-58.json new file mode 100644 index 0000000..72a5b10 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_1-58.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 1, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 51, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 58, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_143-151.json b/spec/support/expected_files/remove_repo_with_dependencies/build_143-151.json new file mode 100644 index 0000000..c500e64 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_143-151.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 143, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 146, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 151, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json b/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json deleted file mode 100644 index 2f829f4..0000000 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_145-158.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "table_name": "builds", - "data": [ - { - "id": 145, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "config": null, - "commit_id": null, - "request_id": null, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": 33, - "sender_id": null, - "sender_type": null - }, - { - "id": 148, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "config": null, - "commit_id": 227, - "request_id": null, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - }, - { - "id": 153, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "config": null, - "commit_id": null, - "request_id": 31, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - }, - { - "id": 158, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "config": null, - "commit_id": null, - "request_id": 33, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json b/spec/support/expected_files/remove_repo_with_dependencies/build_153-158.json similarity index 80% rename from spec/support/expected_files/remove_user_with_dependencies/build_260-268.json rename to spec/support/expected_files/remove_repo_with_dependencies/build_153-158.json index 365df24..cab82c0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_260-268.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_153-158.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 260, + "id": 153, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 31, "state": null, "duration": null, "owner_id": null, @@ -28,20 +28,20 @@ "pull_request_id": null, "branch_id": null, "tag_id": null, - "sender_id": 9, - "sender_type": "User" + "sender_id": null, + "sender_type": null }, { - "id": 263, + "id": 156, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": 55, + "request_id": 33, "state": null, "duration": null, "owner_id": null, @@ -62,16 +62,16 @@ "sender_type": null }, { - "id": 268, + "id": 158, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": 57, + "request_id": 33, "state": null, "duration": null, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_repo_with_dependencies/build_60-70.json similarity index 85% rename from spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json rename to spec/support/expected_files/remove_repo_with_dependencies/build_60-70.json index de1ca12..1caca11 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_60-70.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 50, - "repository_id": 1, + "id": 60, + "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, "request_id": null, @@ -26,22 +26,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": null, + "branch_id": 86, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 53, + "id": 63, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, - "commit_id": null, - "request_id": 11, + "commit_id": 217, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -62,15 +62,15 @@ "sender_type": null }, { - "id": 60, + "id": 65, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, - "commit_id": null, + "commit_id": 217, "request_id": null, "state": null, "duration": null, @@ -86,22 +86,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": 86, + "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 65, + "id": 68, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, - "commit_id": 217, - "request_id": null, + "commit_id": null, + "request_id": 13, "state": null, "duration": null, "owner_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/build_73-83.json b/spec/support/expected_files/remove_repo_with_dependencies/build_73-83.json new file mode 100644 index 0000000..61d3d0e --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_73-83.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 73, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 78, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 83, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_repo_with_dependencies/build_85-140.json similarity index 85% rename from spec/support/expected_files/remove_user_with_dependencies/build_75-140.json rename to spec/support/expected_files/remove_repo_with_dependencies/build_85-140.json index 6c696af..53302bf 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/build_85-140.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 75, + "id": 85, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": 15, + "request_id": 17, "state": null, "duration": null, "owner_id": null, @@ -32,15 +32,15 @@ "sender_type": null }, { - "id": 80, + "id": 88, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, - "commit_id": 219, + "commit_id": null, "request_id": null, "state": null, "duration": null, @@ -55,23 +55,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 85, + "id": 137, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": 17, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -85,23 +85,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 137, + "id": 138, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 29, "state": null, "duration": null, "owner_id": null, @@ -115,7 +115,7 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": 3, + "pull_request_id": null, "branch_id": null, "tag_id": null, "sender_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json index ef73196..0459d3d 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": 86, "tag_id": null }, @@ -32,8 +32,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": 86, "tag_id": null }, @@ -50,8 +50,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": null, "tag_id": null }, @@ -68,8 +68,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": null, "tag_id": null }, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json index 5e0d3d9..5361dc6 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json index 696a3e0..cd9d56d 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_139-147.json b/spec/support/expected_files/remove_repo_with_dependencies/job_139-147.json new file mode 100644 index 0000000..3a5e23e --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_139-147.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 139, + "repository_id": null, + "commit_id": null, + "source_id": 138, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 144, + "repository_id": null, + "commit_id": null, + "source_id": 143, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 147, + "repository_id": null, + "commit_id": null, + "source_id": 146, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_repo_with_dependencies/job_149-155.json similarity index 82% rename from spec/support/expected_files/remove_user_with_dependencies/job_87-150.json rename to spec/support/expected_files/remove_repo_with_dependencies/job_149-155.json index 5416a0e..6483592 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_149-155.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 87, + "id": 149, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 141, + "id": 150, "repository_id": null, - "commit_id": null, - "source_id": 29, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 142, + "id": 152, "repository_id": null, "commit_id": null, - "source_id": 29, - "source_type": "Request", + "source_id": 151, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 149, + "id": 154, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 150, + "id": 155, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json b/spec/support/expected_files/remove_repo_with_dependencies/job_157-160.json similarity index 63% rename from spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json rename to spec/support/expected_files/remove_repo_with_dependencies/job_157-160.json index c401407..f720a86 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_154-160.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_157-160.json @@ -2,40 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 154, + "id": 157, "repository_id": null, "commit_id": null, - "source_id": 31, - "source_type": "Request", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - }, - { - "id": 155, - "repository_id": null, - "commit_id": null, - "source_id": 31, - "source_type": "Request", + "source_id": 156, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -44,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -73,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_2-6.json b/spec/support/expected_files/remove_repo_with_dependencies/job_2-6.json new file mode 100644 index 0000000..65484a3 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_2-6.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 2, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 3, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 4, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 5, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 6, + "repository_id": null, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_57-64.json b/spec/support/expected_files/remove_repo_with_dependencies/job_57-64.json new file mode 100644 index 0000000..30ea7dd --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_57-64.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 59, + "repository_id": null, + "commit_id": null, + "source_id": 58, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 64, + "repository_id": null, + "commit_id": null, + "source_id": 63, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_repo_with_dependencies/job_66-72.json similarity index 85% rename from spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json rename to spec/support/expected_files/remove_repo_with_dependencies/job_66-72.json index 95205a5..62a52eb 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_66-72.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 62, + "id": 66, "repository_id": null, - "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "commit_id": 217, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 66, + "id": 67, "repository_id": null, "commit_id": 217, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 67, + "id": 69, "repository_id": null, - "commit_id": 217, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 68, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_repo_with_dependencies/job_7-56.json similarity index 82% rename from spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json rename to spec/support/expected_files/remove_repo_with_dependencies/job_7-56.json index b2fc592..c57ce12 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_7-56.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 54, + "id": 7, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 1, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 55, + "id": 52, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 51, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 56, - "repository_id": 1, + "id": 54, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 57, - "repository_id": 1, + "id": 55, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 61, - "repository_id": null, + "id": 56, + "repository_id": 1, "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_repo_with_dependencies/job_74-81.json similarity index 82% rename from spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json rename to spec/support/expected_files/remove_repo_with_dependencies/job_74-81.json index 2266228..bb7faf9 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_74-81.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 76, + "id": 74, "repository_id": null, "commit_id": null, - "source_id": 15, - "source_type": "Request", + "source_id": 73, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 77, + "id": 76, "repository_id": null, "commit_id": null, "source_id": 15, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 81, + "id": 77, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 82, + "id": 79, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 78, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 86, + "id": 81, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 219, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_82-89.json b/spec/support/expected_files/remove_repo_with_dependencies/job_82-89.json new file mode 100644 index 0000000..c473843 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_82-89.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 84, + "repository_id": null, + "commit_id": null, + "source_id": 83, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 89, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/job_90-94.json b/spec/support/expected_files/remove_repo_with_dependencies/job_90-94.json new file mode 100644 index 0000000..b10ae33 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/job_90-94.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 90, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + }, + { + "id": 91, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 92, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 93, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 94, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/log_1-19.json similarity index 71% rename from spec/support/expected_files/remove_org_with_dependencies/log_17-21.json rename to spec/support/expected_files/remove_repo_with_dependencies/log_1-19.json index fe096bd..5c383ae 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_1-19.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/log_20-24.json similarity index 71% rename from spec/support/expected_files/remove_user_with_dependencies/log_22-26.json rename to spec/support/expected_files/remove_repo_with_dependencies/log_20-24.json index 03bb3e2..6a630c5 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_20-24.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/log_25-29.json similarity index 71% rename from spec/support/expected_files/remove_org_with_dependencies/log_27-31.json rename to spec/support/expected_files/remove_repo_with_dependencies/log_25-29.json index cc9a0a1..a62db92 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_25-29.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_30-34.json b/spec/support/expected_files/remove_repo_with_dependencies/log_30-34.json new file mode 100644 index 0000000..4bc8d2d --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_30-34.json @@ -0,0 +1,75 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 33, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 34, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/log_49-53.json similarity index 73% rename from spec/support/expected_files/remove_user_with_dependencies/log_32-52.json rename to spec/support/expected_files/remove_repo_with_dependencies/log_49-53.json index d04df49..897a624 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_49-53.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 32, - "job_id": 86, + "id": 49, + "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 49, + "id": 50, "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 50, - "job_id": 141, + "id": 51, + "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 51, + "id": 52, "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 52, - "job_id": 149, + "id": 53, + "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/log_54-56.json similarity index 57% rename from spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json rename to spec/support/expected_files/remove_repo_with_dependencies/log_54-56.json index 339ae7e..d607b61 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_53-56.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/log_54-56.json @@ -1,27 +1,13 @@ { "table_name": "logs", "data": [ - { - "id": 53, - "job_id": 154, - "content": "some log content", - "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true - }, { "id": 54, "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -34,8 +20,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -48,8 +34,8 @@ "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json index 0a1286f..e9efb63 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 15, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 16, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 25, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 26, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json index dcd8e59..048d614 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_27-30.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 28, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 29, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 30, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json index dd9e489..543c734 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 10, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 11, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 12, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 13, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json index fb30e80..7a6a2c5 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 6, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_1-19.json similarity index 76% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json rename to spec/support/expected_files/remove_repo_with_dependencies/queueable_job_1-19.json index 383a7f2..858cbb5 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_1-19.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 1, + "job_id": 6 + }, + { + "id": 2, + "job_id": 6 + }, { "id": 17, "job_id": 54 @@ -12,14 +20,6 @@ { "id": 19, "job_id": 56 - }, - { - "id": 20, - "job_id": 56 - }, - { - "id": 21, - "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_20-24.json similarity index 76% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json rename to spec/support/expected_files/remove_repo_with_dependencies/queueable_job_20-24.json index f88dd7e..5274e58 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_20-24.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 20, + "job_id": 56 + }, + { + "id": 21, + "job_id": 61 + }, { "id": 22, "job_id": 61 @@ -12,14 +20,6 @@ { "id": 24, "job_id": 66 - }, - { - "id": 25, - "job_id": 71 - }, - { - "id": 26, - "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_25-29.json similarity index 76% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json rename to spec/support/expected_files/remove_repo_with_dependencies/queueable_job_25-29.json index fd90ec4..1fc2d88 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_25-29.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 25, + "job_id": 71 + }, + { + "id": 26, + "job_id": 71 + }, { "id": 27, "job_id": 76 @@ -12,14 +20,6 @@ { "id": 29, "job_id": 81 - }, - { - "id": 30, - "job_id": 81 - }, - { - "id": 31, - "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_30-34.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_30-34.json new file mode 100644 index 0000000..38ef88d --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_30-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 30, + "job_id": 81 + }, + { + "id": 31, + "job_id": 86 + }, + { + "id": 32, + "job_id": 86 + }, + { + "id": 33, + "job_id": 93 + }, + { + "id": 34, + "job_id": 93 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_49-53.json similarity index 87% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json rename to spec/support/expected_files/remove_repo_with_dependencies/queueable_job_49-53.json index f922173..98c6643 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_49-53.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 32, - "job_id": 86 - }, { "id": 49, "job_id": 141 @@ -20,6 +16,10 @@ { "id": 52, "job_id": 149 + }, + { + "id": 53, + "job_id": 154 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_54-56.json similarity index 80% rename from spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json rename to spec/support/expected_files/remove_repo_with_dependencies/queueable_job_54-56.json index 32911b2..dcd0d35 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_53-56.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_54-56.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 53, - "job_id": 154 - }, { "id": 54, "job_id": 154 diff --git a/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json index 9931f17..ce544de 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/repository_1-1.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json index b0feaed..22d2548 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json index 97d948e..6822b21 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json index dee765c..486e755 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/request_31-34.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json index 8d0c3a7..2261aac 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/ssl_key_33-34.json @@ -6,16 +6,16 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 34, "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/stage_20-32.json b/spec/support/expected_files/remove_repo_with_dependencies/stage_20-32.json new file mode 100644 index 0000000..91fcb2e --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/stage_20-32.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 20, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 21, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 30, + "build_id": 51, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 31, + "build_id": 58, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 32, + "build_id": 63, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/stage_33-37.json b/spec/support/expected_files/remove_repo_with_dependencies/stage_33-37.json new file mode 100644 index 0000000..4b99471 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/stage_33-37.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 33, + "build_id": 68, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 34, + "build_id": 73, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 35, + "build_id": 78, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 36, + "build_id": 83, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 37, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/stage_38-50.json b/spec/support/expected_files/remove_repo_with_dependencies/stage_38-50.json new file mode 100644 index 0000000..40a0031 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/stage_38-50.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 38, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 47, + "build_id": 138, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 48, + "build_id": 143, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 49, + "build_id": 146, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 50, + "build_id": 151, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/stage_51-51.json b/spec/support/expected_files/remove_repo_with_dependencies/stage_51-51.json new file mode 100644 index 0000000..e540575 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/stage_51-51.json @@ -0,0 +1,14 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 51, + "build_id": 156, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json index f71d6cd..5b4cb04 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/star_3-4.json @@ -5,15 +5,15 @@ "id": 3, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 4, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json index cfc821c..226824f 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_repo_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" }, { "id": 38, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC" + "created_at": "2021-04-11 22:05:24 UTC", + "updated_at": "2021-04-11 22:05:24 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json index f2f927c..7f20e54 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_14-26.json @@ -8,8 +8,8 @@ "request_id": 15, "level": 14, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 15, @@ -18,8 +18,8 @@ "request_id": 17, "level": 15, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 16, @@ -28,8 +28,8 @@ "request_id": 17, "level": 16, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 25, @@ -38,8 +38,8 @@ "request_id": 29, "level": 25, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 26, @@ -48,8 +48,8 @@ "request_id": 29, "level": 26, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json index 6e34704..a502371 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_27-47.json @@ -8,8 +8,8 @@ "request_id": 31, "level": 27, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 28, @@ -18,8 +18,8 @@ "request_id": 31, "level": 28, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 29, @@ -28,8 +28,8 @@ "request_id": 33, "level": 29, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 30, @@ -38,8 +38,8 @@ "request_id": 33, "level": 30, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 47, @@ -48,8 +48,8 @@ "request_id": 55, "level": 47, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json index 45c3e2c..fbe53d3 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_48-52.json @@ -8,8 +8,8 @@ "request_id": 55, "level": 48, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 49, @@ -18,8 +18,8 @@ "request_id": 57, "level": 49, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 50, @@ -28,8 +28,8 @@ "request_id": 57, "level": 50, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 51, @@ -38,8 +38,8 @@ "request_id": null, "level": 51, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 52, @@ -48,8 +48,8 @@ "request_id": null, "level": 52, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json index eaf85ef..88eac13 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/abuse_9-13.json @@ -8,8 +8,8 @@ "request_id": 11, "level": 9, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 10, @@ -18,8 +18,8 @@ "request_id": 11, "level": 10, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 11, @@ -28,8 +28,8 @@ "request_id": 13, "level": 11, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 12, @@ -38,8 +38,8 @@ "request_id": 13, "level": 12, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 13, @@ -48,8 +48,8 @@ "request_id": 15, "level": 13, "reason": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_1-19.json similarity index 58% rename from spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_1-19.json index 2de4b6b..eee2379 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_1-19.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_20-24.json similarity index 58% rename from spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_20-24.json index 41e50e9..167cb99 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_20-24.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_25-29.json similarity index 58% rename from spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_25-29.json index 87eaac1..5a81945 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/annotation_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_25-29.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "url": null, "description": "some text", - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_30-34.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_30-34.json new file mode 100644 index 0000000..72f09bd --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_30-34.json @@ -0,0 +1,55 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 30, + "job_id": 81, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 31, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 32, + "job_id": 86, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 33, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 34, + "job_id": 93, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_49-53.json similarity index 61% rename from spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_49-53.json index 0de94fd..0b67fd6 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/annotation_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_49-53.json @@ -1,23 +1,13 @@ { "table_name": "annotations", "data": [ - { - "id": 32, - "job_id": 86, - "url": null, - "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", - "annotation_provider_id": 0, - "status": null - }, { "id": 49, "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, @@ -26,8 +16,8 @@ "job_id": 141, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, @@ -36,8 +26,8 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, @@ -46,8 +36,18 @@ "job_id": 149, "url": null, "description": "some text", - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 53, + "job_id": 154, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_54-58.json similarity index 58% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_54-58.json index 46904ed..343cd5f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_54-58.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 53, + "id": 54, "job_id": 154, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 54, - "job_id": 154, + "id": 55, + "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 55, + "id": 56, "job_id": 159, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 56, - "job_id": 159, + "id": 57, + "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 89, - "job_id": 264, + "id": 58, + "job_id": 166, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_73-91.json similarity index 55% rename from spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json rename to spec/support/expected_files/remove_user_with_dependencies/annotation_73-91.json index 5478913..30d0825 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/annotation_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_73-91.json @@ -2,52 +2,52 @@ "table_name": "annotations", "data": [ { - "id": 90, - "job_id": 264, + "id": 73, + "job_id": 216, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 91, - "job_id": 269, + "id": 74, + "job_id": 216, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 92, - "job_id": 269, + "id": 89, + "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 93, - "job_id": 271, + "id": 90, + "job_id": 264, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null }, { - "id": 94, - "job_id": 271, + "id": 91, + "job_id": 269, "url": null, "description": "some text", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_user_with_dependencies/annotation_92-94.json b/spec/support/expected_files/remove_user_with_dependencies/annotation_92-94.json new file mode 100644 index 0000000..a79a8b5 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/annotation_92-94.json @@ -0,0 +1,35 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 92, + "job_id": 269, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 93, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 94, + "job_id": 271, + "url": null, + "description": "some text", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json index 4632dd8..9378d54 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json +++ b/spec/support/expected_files/remove_user_with_dependencies/branch_86-91.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_14", "exists_on_github": true, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 91, @@ -16,8 +16,8 @@ "last_build_id": null, "name": "branch_19", "exists_on_github": true, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json index ba07dc4..727a751 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/broadcast_1-2.json @@ -8,8 +8,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "category": null }, { @@ -19,8 +19,8 @@ "kind": null, "message": null, "expired": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "category": null } ] diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_1-58.json b/spec/support/expected_files/remove_user_with_dependencies/build_1-58.json new file mode 100644 index 0000000..cc29e05 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_1-58.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 1, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 51, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 53, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 11, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 58, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 86, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_143-151.json b/spec/support/expected_files/remove_user_with_dependencies/build_143-151.json new file mode 100644 index 0000000..baa2575 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_143-151.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 143, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 145, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 33, + "sender_id": null, + "sender_type": null + }, + { + "id": 146, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 148, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": 227, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 151, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 31, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json b/spec/support/expected_files/remove_user_with_dependencies/build_153-210.json similarity index 84% rename from spec/support/expected_files/remove_user_with_dependencies/build_145-210.json rename to spec/support/expected_files/remove_user_with_dependencies/build_153-210.json index 5f681f0..5625799 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/build_145-210.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_153-210.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 145, + "id": 153, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 31, "state": null, "duration": null, "owner_id": null, @@ -27,21 +27,21 @@ "private": null, "pull_request_id": null, "branch_id": null, - "tag_id": 33, + "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 148, + "id": 156, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, - "commit_id": 227, - "request_id": null, + "commit_id": null, + "request_id": 33, "state": null, "duration": null, "owner_id": null, @@ -62,16 +62,16 @@ "sender_type": null }, { - "id": 153, + "id": 158, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": 31, + "request_id": 33, "state": null, "duration": null, "owner_id": null, @@ -92,20 +92,20 @@ "sender_type": null }, { - "id": 158, + "id": 161, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": 33, + "request_id": null, "state": null, "duration": null, - "owner_id": null, - "owner_type": null, + "owner_id": 9, + "owner_type": "User", "event_type": null, "previous_state": null, "pull_request_title": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_211-266.json b/spec/support/expected_files/remove_user_with_dependencies/build_211-266.json new file mode 100644 index 0000000..4ff3914 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_211-266.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 211, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 9, + "sender_type": "User" + }, + { + "id": 260, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": 9, + "sender_type": "User" + }, + { + "id": 261, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 263, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 55, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 266, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_268-268.json b/spec/support/expected_files/remove_user_with_dependencies/build_268-268.json new file mode 100644 index 0000000..4a201a7 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_268-268.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 268, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 57, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json b/spec/support/expected_files/remove_user_with_dependencies/build_60-70.json similarity index 85% rename from spec/support/expected_files/remove_org_with_dependencies/build_50-70.json rename to spec/support/expected_files/remove_user_with_dependencies/build_60-70.json index 8fd9d6e..cbfc3c9 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_50-70.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_60-70.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 50, - "repository_id": 1, + "id": 60, + "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, "request_id": null, @@ -26,22 +26,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": null, + "branch_id": 86, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 53, + "id": 63, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, - "commit_id": null, - "request_id": 11, + "commit_id": 217, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -62,15 +62,15 @@ "sender_type": null }, { - "id": 60, + "id": 65, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, - "commit_id": null, + "commit_id": 217, "request_id": null, "state": null, "duration": null, @@ -86,22 +86,22 @@ "received_at": null, "private": null, "pull_request_id": null, - "branch_id": 86, + "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 65, + "id": 68, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, - "commit_id": 217, - "request_id": null, + "commit_id": null, + "request_id": 13, "state": null, "duration": null, "owner_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, "request_id": 13, diff --git a/spec/support/expected_files/remove_user_with_dependencies/build_73-83.json b/spec/support/expected_files/remove_user_with_dependencies/build_73-83.json new file mode 100644 index 0000000..c297d51 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/build_73-83.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 73, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 75, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 15, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 78, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 80, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": 219, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 83, + "repository_id": null, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "config": null, + "commit_id": null, + "request_id": 17, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json b/spec/support/expected_files/remove_user_with_dependencies/build_85-140.json similarity index 85% rename from spec/support/expected_files/remove_org_with_dependencies/build_75-140.json rename to spec/support/expected_files/remove_user_with_dependencies/build_85-140.json index d3d28c5..ace42b0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/build_75-140.json +++ b/spec/support/expected_files/remove_user_with_dependencies/build_85-140.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 75, + "id": 85, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": 15, + "request_id": 17, "state": null, "duration": null, "owner_id": null, @@ -32,15 +32,15 @@ "sender_type": null }, { - "id": 80, + "id": 88, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, - "commit_id": 219, + "commit_id": null, "request_id": null, "state": null, "duration": null, @@ -55,23 +55,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 85, + "id": 137, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": 17, + "request_id": null, "state": null, "duration": null, "owner_id": null, @@ -85,23 +85,23 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": null, + "pull_request_id": 3, "branch_id": null, "tag_id": null, "sender_id": null, "sender_type": null }, { - "id": 137, + "id": 138, "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 29, "state": null, "duration": null, "owner_id": null, @@ -115,7 +115,7 @@ "cached_matrix_ids": null, "received_at": null, "private": null, - "pull_request_id": 3, + "pull_request_id": null, "branch_id": null, "tag_id": null, "sender_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "config": null, "commit_id": null, "request_id": 29, diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json index 6e2662d..29115af 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_217-227.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": 86, "tag_id": null }, @@ -32,8 +32,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": 86, "tag_id": null }, @@ -50,8 +50,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": null, "tag_id": null }, @@ -68,8 +68,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": null, "tag_id": null }, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json index 2ed7577..e54000d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json +++ b/spec/support/expected_files/remove_user_with_dependencies/commit_228-228.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "branch_id": null, "tag_id": 33 } diff --git a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json index f151520..f85171a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 86, "interval": "test", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json index 19af964..3264925 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/email_9-10.json @@ -5,15 +5,15 @@ "id": 9, "user_id": 9, "email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 10, "user_id": 9, "email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json index 6eaa5a3..501d6b6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json +++ b/spec/support/expected_files/remove_user_with_dependencies/invoice_1-4.json @@ -4,8 +4,8 @@ { "id": 1, "object": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -14,8 +14,8 @@ { "id": 2, "object": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "subscription_id": 1, "invoice_id": null, "stripe_id": null, @@ -24,8 +24,8 @@ { "id": 3, "object": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, @@ -34,8 +34,8 @@ { "id": 4, "object": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "subscription_id": 2, "invoice_id": null, "stripe_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_139-147.json b/spec/support/expected_files/remove_user_with_dependencies/job_139-147.json new file mode 100644 index 0000000..0e12cb0 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_139-147.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 139, + "repository_id": null, + "commit_id": null, + "source_id": 138, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 141, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 142, + "repository_id": null, + "commit_id": null, + "source_id": 29, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 144, + "repository_id": null, + "commit_id": null, + "source_id": 143, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 147, + "repository_id": null, + "commit_id": null, + "source_id": 146, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json b/spec/support/expected_files/remove_user_with_dependencies/job_149-155.json similarity index 82% rename from spec/support/expected_files/remove_org_with_dependencies/job_87-150.json rename to spec/support/expected_files/remove_user_with_dependencies/job_149-155.json index 85156f5..a53d3a0 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_87-150.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_149-155.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 87, + "id": 149, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 141, + "id": 150, "repository_id": null, - "commit_id": null, - "source_id": 29, - "source_type": "Request", + "commit_id": 227, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 142, + "id": 152, "repository_id": null, "commit_id": null, - "source_id": 29, - "source_type": "Request", + "source_id": 151, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 149, + "id": 154, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 150, + "id": 155, "repository_id": null, - "commit_id": 227, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 31, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_157-163.json b/spec/support/expected_files/remove_user_with_dependencies/job_157-163.json new file mode 100644 index 0000000..bd79d52 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_157-163.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 157, + "repository_id": null, + "commit_id": null, + "source_id": 156, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 159, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 160, + "repository_id": null, + "commit_id": null, + "source_id": 33, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 162, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52 + }, + { + "id": 163, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 52 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_164-212.json b/spec/support/expected_files/remove_user_with_dependencies/job_164-212.json new file mode 100644 index 0000000..f1e39fc --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_164-212.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 164, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53 + }, + { + "id": 165, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 53 + }, + { + "id": 166, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 167, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 212, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 62 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_2-6.json b/spec/support/expected_files/remove_user_with_dependencies/job_2-6.json new file mode 100644 index 0000000..5dd3fec --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_2-6.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 2, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 3, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 4, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 5, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 6, + "repository_id": null, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_213-217.json b/spec/support/expected_files/remove_user_with_dependencies/job_213-217.json new file mode 100644 index 0000000..a0d8575 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_213-217.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 213, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 62 + }, + { + "id": 214, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 63 + }, + { + "id": 215, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 63 + }, + { + "id": 216, + "repository_id": null, + "commit_id": null, + "source_id": 211, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 217, + "repository_id": null, + "commit_id": null, + "source_id": 211, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json b/spec/support/expected_files/remove_user_with_dependencies/job_262-269.json similarity index 80% rename from spec/support/expected_files/remove_user_with_dependencies/job_154-264.json rename to spec/support/expected_files/remove_user_with_dependencies/job_262-269.json index bc4b35d..f433a03 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_154-264.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_262-269.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 154, + "id": 262, "repository_id": null, "commit_id": null, - "source_id": 31, - "source_type": "Request", + "source_id": 261, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,10 +31,10 @@ "stage_id": null }, { - "id": 155, + "id": 264, "repository_id": null, "commit_id": null, - "source_id": 31, + "source_id": 55, "source_type": "Request", "queue": null, "type": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,10 +60,10 @@ "stage_id": null }, { - "id": 159, + "id": 265, "repository_id": null, "commit_id": null, - "source_id": 33, + "source_id": 55, "source_type": "Request", "queue": null, "type": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 160, + "id": 267, "repository_id": null, "commit_id": null, - "source_id": 33, - "source_type": "Request", + "source_id": 266, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,10 +118,10 @@ "stage_id": null }, { - "id": 264, + "id": 269, "repository_id": null, "commit_id": null, - "source_id": 55, + "source_id": 57, "source_type": "Request", "queue": null, "type": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json b/spec/support/expected_files/remove_user_with_dependencies/job_270-272.json similarity index 52% rename from spec/support/expected_files/remove_user_with_dependencies/job_265-272.json rename to spec/support/expected_files/remove_user_with_dependencies/job_270-272.json index a824fcb..2bb3c45 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_265-272.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_270-272.json @@ -1,64 +1,6 @@ { "table_name": "jobs", "data": [ - { - "id": 265, - "repository_id": null, - "commit_id": null, - "source_id": 55, - "source_type": "Request", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - }, - { - "id": 269, - "repository_id": null, - "commit_id": null, - "source_id": 57, - "source_type": "Request", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - }, { "id": 270, "repository_id": null, @@ -73,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": 9, @@ -131,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": 9, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_57-64.json b/spec/support/expected_files/remove_user_with_dependencies/job_57-64.json new file mode 100644 index 0000000..544ae31 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_57-64.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 57, + "repository_id": 1, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 59, + "repository_id": null, + "commit_id": null, + "source_id": 58, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 61, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 62, + "repository_id": null, + "commit_id": null, + "source_id": 86, + "source_type": "Branch", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 64, + "repository_id": null, + "commit_id": null, + "source_id": 63, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json b/spec/support/expected_files/remove_user_with_dependencies/job_66-72.json similarity index 85% rename from spec/support/expected_files/remove_org_with_dependencies/job_62-72.json rename to spec/support/expected_files/remove_user_with_dependencies/job_66-72.json index dfa1044..c0d7e0d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_62-72.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_66-72.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 62, + "id": 66, "repository_id": null, - "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "commit_id": 217, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 66, + "id": 67, "repository_id": null, "commit_id": 217, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 67, + "id": 69, "repository_id": null, - "commit_id": 217, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 68, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json b/spec/support/expected_files/remove_user_with_dependencies/job_7-56.json similarity index 82% rename from spec/support/expected_files/remove_org_with_dependencies/job_54-61.json rename to spec/support/expected_files/remove_user_with_dependencies/job_7-56.json index 6ea972e..cefdb14 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/job_54-61.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_7-56.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 54, + "id": 7, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 1, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,11 +31,11 @@ "stage_id": null }, { - "id": 55, + "id": 52, "repository_id": null, "commit_id": null, - "source_id": 11, - "source_type": "Request", + "source_id": 51, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 56, - "repository_id": 1, + "id": 54, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 57, - "repository_id": 1, + "id": 55, + "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 11, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 61, - "repository_id": null, + "id": 56, + "repository_id": 1, "commit_id": null, - "source_id": 86, - "source_type": "Branch", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json b/spec/support/expected_files/remove_user_with_dependencies/job_74-81.json similarity index 82% rename from spec/support/expected_files/remove_user_with_dependencies/job_76-86.json rename to spec/support/expected_files/remove_user_with_dependencies/job_74-81.json index 467a9a8..2d95aad 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/job_76-86.json +++ b/spec/support/expected_files/remove_user_with_dependencies/job_74-81.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 76, + "id": 74, "repository_id": null, "commit_id": null, - "source_id": 15, - "source_type": "Request", + "source_id": 73, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 77, + "id": 76, "repository_id": null, "commit_id": null, "source_id": 15, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,11 +60,11 @@ "stage_id": null }, { - "id": 81, + "id": 77, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 15, + "source_type": "Request", "queue": null, "type": null, "state": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,11 +89,11 @@ "stage_id": null }, { - "id": 82, + "id": 79, "repository_id": null, - "commit_id": 219, - "source_id": null, - "source_type": null, + "commit_id": null, + "source_id": 78, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": null }, { - "id": 86, + "id": 81, "repository_id": null, - "commit_id": null, - "source_id": 17, - "source_type": "Request", + "commit_id": 219, + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_82-89.json b/spec/support/expected_files/remove_user_with_dependencies/job_82-89.json new file mode 100644 index 0000000..210a41d --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_82-89.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 82, + "repository_id": null, + "commit_id": 219, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 84, + "repository_id": null, + "commit_id": null, + "source_id": 83, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 86, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 87, + "repository_id": null, + "commit_id": null, + "source_id": 17, + "source_type": "Request", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 89, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/job_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/job_90-94.json new file mode 100644 index 0000000..69c50e6 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/job_90-94.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 90, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 37 + }, + { + "id": 91, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 92, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 38 + }, + { + "id": 93, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 94, + "repository_id": null, + "commit_id": null, + "source_id": 88, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/log_1-19.json similarity index 71% rename from spec/support/expected_files/remove_user_with_dependencies/log_17-21.json rename to spec/support/expected_files/remove_user_with_dependencies/log_1-19.json index 1c57c97..4440de1 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_1-19.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 17, - "job_id": 54, + "id": 1, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 18, - "job_id": 54, + "id": 2, + "job_id": 6, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 19, - "job_id": 56, + "id": 17, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 20, - "job_id": 56, + "id": 18, + "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 21, - "job_id": 61, + "id": 19, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/log_20-24.json similarity index 71% rename from spec/support/expected_files/remove_org_with_dependencies/log_22-26.json rename to spec/support/expected_files/remove_user_with_dependencies/log_20-24.json index e39fab6..8f4bcbe 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_20-24.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 22, - "job_id": 61, + "id": 20, + "job_id": 56, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 23, - "job_id": 66, + "id": 21, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 24, - "job_id": 66, + "id": 22, + "job_id": 61, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 25, - "job_id": 71, + "id": 23, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 26, - "job_id": 71, + "id": 24, + "job_id": 66, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/log_25-29.json similarity index 71% rename from spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json rename to spec/support/expected_files/remove_user_with_dependencies/log_25-29.json index 79c226e..a6b717a 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/log_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_25-29.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 27, - "job_id": 76, + "id": 25, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 28, - "job_id": 76, + "id": 26, + "job_id": 71, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 29, - "job_id": 81, + "id": 27, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 30, - "job_id": 81, + "id": 28, + "job_id": 76, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 31, - "job_id": 86, + "id": 29, + "job_id": 81, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 18:18:22 UTC", - "updated_at": "2021-03-12 18:18:22 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_30-34.json b/spec/support/expected_files/remove_user_with_dependencies/log_30-34.json new file mode 100644 index 0000000..f6ab46c --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_30-34.json @@ -0,0 +1,75 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 30, + "job_id": 81, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 31, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 32, + "job_id": 86, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 33, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 34, + "job_id": 93, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/log_49-53.json similarity index 73% rename from spec/support/expected_files/remove_org_with_dependencies/log_32-52.json rename to spec/support/expected_files/remove_user_with_dependencies/log_49-53.json index 8f6f1aa..b64808d 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/log_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_49-53.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 32, - "job_id": 86, + "id": 49, + "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 49, + "id": 50, "job_id": 141, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 50, - "job_id": 141, + "id": 51, + "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 51, + "id": 52, "job_id": 149, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 52, - "job_id": 149, + "id": 53, + "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:36:58 UTC", - "updated_at": "2021-03-12 10:36:58 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/log_54-58.json similarity index 71% rename from spec/support/expected_files/remove_user_with_dependencies/log_53-89.json rename to spec/support/expected_files/remove_user_with_dependencies/log_54-58.json index a3bdc26..c74ef9e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_54-58.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 53, + "id": 54, "job_id": 154, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 54, - "job_id": 154, + "id": 55, + "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 55, + "id": 56, "job_id": 159, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 56, - "job_id": 159, + "id": 57, + "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 89, - "job_id": 264, + "id": 58, + "job_id": 166, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_73-91.json similarity index 69% rename from spec/support/expected_files/remove_user_with_dependencies/log_90-94.json rename to spec/support/expected_files/remove_user_with_dependencies/log_73-91.json index 07a3b92..d681e65 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/log_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/log_73-91.json @@ -2,12 +2,12 @@ "table_name": "logs", "data": [ { - "id": 90, - "job_id": 264, + "id": 73, + "job_id": 216, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -16,12 +16,12 @@ "archive_verified": true }, { - "id": 91, - "job_id": 269, + "id": 74, + "job_id": 216, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -30,12 +30,12 @@ "archive_verified": true }, { - "id": 92, - "job_id": 269, + "id": 89, + "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -44,12 +44,12 @@ "archive_verified": true }, { - "id": 93, - "job_id": 271, + "id": 90, + "job_id": 264, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -58,12 +58,12 @@ "archive_verified": true }, { - "id": 94, - "job_id": 271, + "id": 91, + "job_id": 269, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/log_92-94.json b/spec/support/expected_files/remove_user_with_dependencies/log_92-94.json new file mode 100644 index 0000000..a377b42 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/log_92-94.json @@ -0,0 +1,47 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 92, + "job_id": 269, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 93, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 94, + "job_id": 271, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json index 54e9dca..103c456 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_14-26.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 15, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 16, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 25, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 26, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json index 45630ab..b0834d0 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_27-47.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 28, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 29, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 30, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 47, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json index fbc232c..47cec7d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_48-50.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 49, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 50, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json index 9aaa35a..69dbf15 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json +++ b/spec/support/expected_files/remove_user_with_dependencies/message_9-13.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 10, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 11, @@ -31,8 +31,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 12, @@ -42,8 +42,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 13, @@ -53,8 +53,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json index b0ea118..e7f19a7 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/owner_group_1-2.json @@ -6,16 +6,16 @@ "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 2, "uuid": null, "owner_id": 9, "owner_type": "User", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json index 794a625..b6bae33 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/pull_request_3-6.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 6, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_1-19.json similarity index 76% rename from spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_1-19.json index 383a7f2..858cbb5 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_17-21.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_1-19.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 1, + "job_id": 6 + }, + { + "id": 2, + "job_id": 6 + }, { "id": 17, "job_id": 54 @@ -12,14 +20,6 @@ { "id": 19, "job_id": 56 - }, - { - "id": 20, - "job_id": 56 - }, - { - "id": 21, - "job_id": 61 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_20-24.json similarity index 76% rename from spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_20-24.json index f88dd7e..5274e58 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_22-26.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_20-24.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 20, + "job_id": 56 + }, + { + "id": 21, + "job_id": 61 + }, { "id": 22, "job_id": 61 @@ -12,14 +20,6 @@ { "id": 24, "job_id": 66 - }, - { - "id": 25, - "job_id": 71 - }, - { - "id": 26, - "job_id": 71 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_25-29.json similarity index 76% rename from spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_25-29.json index fd90ec4..1fc2d88 100644 --- a/spec/support/expected_files/remove_repo_with_dependencies/queueable_job_27-31.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_25-29.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 25, + "job_id": 71 + }, + { + "id": 26, + "job_id": 71 + }, { "id": 27, "job_id": 76 @@ -12,14 +20,6 @@ { "id": 29, "job_id": 81 - }, - { - "id": 30, - "job_id": 81 - }, - { - "id": 31, - "job_id": 86 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_30-34.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_30-34.json new file mode 100644 index 0000000..38ef88d --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_30-34.json @@ -0,0 +1,25 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 30, + "job_id": 81 + }, + { + "id": 31, + "job_id": 86 + }, + { + "id": 32, + "job_id": 86 + }, + { + "id": 33, + "job_id": 93 + }, + { + "id": 34, + "job_id": 93 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_49-53.json similarity index 87% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_49-53.json index f922173..98c6643 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_32-52.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_49-53.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 32, - "job_id": 86 - }, { "id": 49, "job_id": 141 @@ -20,6 +16,10 @@ { "id": 52, "job_id": 149 + }, + { + "id": 53, + "job_id": 154 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_54-58.json similarity index 75% rename from spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_54-58.json index 091c4ca..fdf0f32 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_53-89.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_54-58.json @@ -1,10 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 53, - "job_id": 154 - }, { "id": 54, "job_id": 154 @@ -18,8 +14,12 @@ "job_id": 159 }, { - "id": 89, - "job_id": 264 + "id": 57, + "job_id": 166 + }, + { + "id": 58, + "job_id": 166 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/queueable_job_73-91.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_73-91.json new file mode 100644 index 0000000..ff4127a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_73-91.json @@ -0,0 +1,25 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 73, + "job_id": 216 + }, + { + "id": 74, + "job_id": 216 + }, + { + "id": 89, + "job_id": 264 + }, + { + "id": 90, + "job_id": 264 + }, + { + "id": 91, + "job_id": 269 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_92-94.json similarity index 67% rename from spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json rename to spec/support/expected_files/remove_user_with_dependencies/queueable_job_92-94.json index f37a5eb..52bcc99 100644 --- a/spec/support/expected_files/remove_org_with_dependencies/queueable_job_90-94.json +++ b/spec/support/expected_files/remove_user_with_dependencies/queueable_job_92-94.json @@ -1,14 +1,6 @@ { "table_name": "queueable_jobs", "data": [ - { - "id": 90, - "job_id": 264 - }, - { - "id": 91, - "job_id": 269 - }, { "id": 92, "job_id": 269 diff --git a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json index 561e83f..7f8739e 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json +++ b/spec/support/expected_files/remove_user_with_dependencies/repository_1-66.json @@ -5,8 +5,8 @@ "id": 1, "name": null, "url": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "last_build_id": 260, "last_build_number": null, "last_build_started_at": null, @@ -32,8 +32,8 @@ "id": 66, "name": null, "url": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json index e3f96d6..551583b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_11-15.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json index 5d63adb..4eeb8c5 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_16-30.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json index 90d1e1e..e992ae6 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_31-55.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json index 4e24321..eb2d24d 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json +++ b/spec/support/expected_files/remove_user_with_dependencies/request_56-58.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json index f6c78fd..21cb89f 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json +++ b/spec/support/expected_files/remove_user_with_dependencies/ssl_key_33-34.json @@ -6,16 +6,16 @@ "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 34, "repository_id": 1, "public_key": null, "private_key": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/stage_20-32.json b/spec/support/expected_files/remove_user_with_dependencies/stage_20-32.json new file mode 100644 index 0000000..91fcb2e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/stage_20-32.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 20, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 21, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 30, + "build_id": 51, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 31, + "build_id": 58, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 32, + "build_id": 63, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/stage_33-37.json b/spec/support/expected_files/remove_user_with_dependencies/stage_33-37.json new file mode 100644 index 0000000..4b99471 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/stage_33-37.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 33, + "build_id": 68, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 34, + "build_id": 73, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 35, + "build_id": 78, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 36, + "build_id": 83, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 37, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/stage_38-50.json b/spec/support/expected_files/remove_user_with_dependencies/stage_38-50.json new file mode 100644 index 0000000..40a0031 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/stage_38-50.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 38, + "build_id": 88, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 47, + "build_id": 138, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 48, + "build_id": 143, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 49, + "build_id": 146, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 50, + "build_id": 151, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/stage_51-63.json b/spec/support/expected_files/remove_user_with_dependencies/stage_51-63.json new file mode 100644 index 0000000..944cb8b --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/stage_51-63.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 51, + "build_id": 156, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 52, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 53, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 62, + "build_id": 211, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 63, + "build_id": 211, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/stage_72-73.json b/spec/support/expected_files/remove_user_with_dependencies/stage_72-73.json new file mode 100644 index 0000000..5fe27f1 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/stage_72-73.json @@ -0,0 +1,23 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 72, + "build_id": 261, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 73, + "build_id": 266, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json index e794dad..f6a459b 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/star_1-6.json @@ -5,29 +5,29 @@ "id": 1, "repository_id": null, "user_id": 9, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 2, "repository_id": null, "user_id": 9, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 5, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 6, "repository_id": 1, "user_id": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json index 37dc6cf..30761cb 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/subscription_1-2.json @@ -18,8 +18,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, @@ -50,8 +50,8 @@ "country": null, "vat_id": null, "customer_id": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "cc_owner": null, "cc_last_digits": null, "cc_expiration_date": null, diff --git a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json index dbf611e..e95f550 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json +++ b/spec/support/expected_files/remove_user_with_dependencies/tag_33-38.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 38, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json index 00c49b1..479096a 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json +++ b/spec/support/expected_files/remove_user_with_dependencies/token_9-10.json @@ -5,15 +5,15 @@ "id": 9, "user_id": 9, "token": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 10, "user_id": 9, "token": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json index f52f9a4..1bb0e18 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_1-2.json @@ -9,8 +9,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 2, @@ -20,8 +20,8 @@ ], "status": "new", - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json index 9043ec6..b9a12bd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_1-5.json @@ -8,8 +8,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 2, @@ -18,8 +18,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 3, @@ -28,8 +28,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 4, @@ -38,8 +38,8 @@ "creator_type": null, "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" }, { "id": 5, @@ -48,8 +48,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json index eede241..6c5e7cd 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json +++ b/spec/support/expected_files/remove_user_with_dependencies/trial_allowance_6-6.json @@ -8,8 +8,8 @@ "creator_type": "User", "builds_allowed": null, "builds_remaining": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC" + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json index bcc2b6f..afbb7b4 100644 --- a/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json +++ b/spec/support/expected_files/remove_user_with_dependencies/user_9-9.json @@ -6,8 +6,8 @@ "name": null, "login": null, "email": null, - "created_at": "2021-03-12 10:46:10 UTC", - "updated_at": "2021-03-12 10:46:10 UTC", + "created_at": "2021-04-11 21:55:03 UTC", + "updated_at": "2021-04-11 21:55:03 UTC", "is_admin": false, "github_id": null, "github_oauth_token": null, From 225dbefbeddefcb0d7d88d8803e0a1ff06ec84f6 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Fri, 12 Nov 2021 12:15:30 +0100 Subject: [PATCH 74/88] all tests in remove_specified_spec with new expected files and with new way of testing --- .../remove_specified/remove_heavy_data.rb | 45 +- lib/id_hash.rb | 1 + lib/ids_of_all_dependencies.rb | 28 +- spec/backup/load_from_files_spec.rb | 27 +- spec/backup/remove_specified_spec.rb | 96 +- .../remove_org_with_dependencies.rb | 3216 ++++++++--------- .../remove_repo_builds.rb | 1745 +++++++++ .../remove_repo_requests.rb | 1745 +++++++++ .../remove_user_with_dependencies.rb | 3210 ++++++++-------- .../remove_repo_builds/annotation_1-61.json | 55 + .../remove_repo_builds/annotation_57-58.json | 25 - .../remove_repo_builds/annotation_62-62.json | 15 + .../remove_repo_builds/build_1-175.json | 125 + .../remove_repo_builds/job_166-178.json | 150 + .../remove_repo_builds/job_167-167.json | 34 - .../remove_repo_builds/job_179-181.json | 92 + .../remove_repo_builds/job_2-6.json | 150 + .../{job_162-166.json => job_7-165.json} | 44 +- .../remove_repo_builds/log_1-61.json | 75 + .../remove_repo_builds/log_57-58.json | 33 - .../remove_repo_builds/log_62-62.json | 19 + ...job_57-58.json => queueable_job_1-61.json} | 12 + .../queueable_job_62-62.json | 9 + .../remove_repo_builds/stage_20-56.json | 50 + .../remove_repo_builds/stage_52-53.json | 23 - .../remove_repo_builds/stage_57-57.json | 14 + .../remove_repo_requests/abuse_9-10.json | 8 +- .../annotation_17-18.json | 8 +- .../build_51-53.json} | 20 +- .../remove_repo_requests/build_53-53.json | 35 - .../{job_54-55.json => job_52-55.json} | 37 +- .../remove_repo_requests/log_17-18.json | 8 +- .../remove_repo_requests/message_9-10.json | 8 +- ...{request_11-12.json => request_11-35.json} | 36 +- .../remove_repo_requests/stage_30-30.json | 14 + .../expected_id_trees/load_from_files.rb | 118 + spec/support/factories/repository.rb | 10 + spec/support/factories/request.rb | 1 + 38 files changed, 7800 insertions(+), 3541 deletions(-) create mode 100644 spec/support/expected_dependency_trees/remove_repo_builds.rb create mode 100644 spec/support/expected_dependency_trees/remove_repo_requests.rb create mode 100644 spec/support/expected_files/remove_repo_builds/annotation_1-61.json delete mode 100644 spec/support/expected_files/remove_repo_builds/annotation_57-58.json create mode 100644 spec/support/expected_files/remove_repo_builds/annotation_62-62.json create mode 100644 spec/support/expected_files/remove_repo_builds/build_1-175.json create mode 100644 spec/support/expected_files/remove_repo_builds/job_166-178.json delete mode 100644 spec/support/expected_files/remove_repo_builds/job_167-167.json create mode 100644 spec/support/expected_files/remove_repo_builds/job_179-181.json create mode 100644 spec/support/expected_files/remove_repo_builds/job_2-6.json rename spec/support/expected_files/remove_repo_builds/{job_162-166.json => job_7-165.json} (85%) create mode 100644 spec/support/expected_files/remove_repo_builds/log_1-61.json delete mode 100644 spec/support/expected_files/remove_repo_builds/log_57-58.json create mode 100644 spec/support/expected_files/remove_repo_builds/log_62-62.json rename spec/support/expected_files/remove_repo_builds/{queueable_job_57-58.json => queueable_job_1-61.json} (51%) create mode 100644 spec/support/expected_files/remove_repo_builds/queueable_job_62-62.json create mode 100644 spec/support/expected_files/remove_repo_builds/stage_20-56.json delete mode 100644 spec/support/expected_files/remove_repo_builds/stage_52-53.json create mode 100644 spec/support/expected_files/remove_repo_builds/stage_57-57.json rename spec/support/expected_files/{remove_repo_builds/build_50-161.json => remove_repo_requests/build_51-53.json} (79%) delete mode 100644 spec/support/expected_files/remove_repo_requests/build_53-53.json rename spec/support/expected_files/remove_repo_requests/{job_54-55.json => job_52-55.json} (58%) rename spec/support/expected_files/remove_repo_requests/{request_11-12.json => request_11-35.json} (58%) create mode 100644 spec/support/expected_files/remove_repo_requests/stage_30-30.json create mode 100644 spec/support/expected_id_trees/load_from_files.rb diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index fffab60..292a9d5 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -18,14 +18,17 @@ def remove_heavy_data_for_repo(repository) def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength threshold = @config.threshold.to_i.months.ago.to_datetime - builds_dependencies = repository.builds.where('created_at < ?', threshold).map do |build| - next if should_build_be_filtered?(build) + builds_to_remove = repository.builds.where('created_at < ?', threshold) - result = build.ids_of_all_dependencies + builds_dependencies = builds_to_remove.map do |build| + # next if should_build_be_filtered?(build) + + result = build.ids_of_all_dependencies(dependencies_to_filter, :without_parents) result.add(:build, build.id) result end.compact + builds_to_remove&.each(&:nullify_default_dependencies) unless @config.dry_run ids_to_remove = IdHash.join(*builds_dependencies) @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" process_ids_to_remove(ids_to_remove) @@ -33,20 +36,22 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me def remove_repo_requests(repository) threshold = @config.threshold.to_i.months.ago.to_datetime + requests_to_remove = repository.requests.where('created_at < ?', threshold) - requests_dependencies = repository.requests.where('created_at < ?', threshold).map do |request| - hash_with_filtered = request.ids_of_all_dependencies_with_filtered(dependencies_to_filter) - hash_with_filtered[:main].add(:request, request.id) - hash_with_filtered[:main].join(hash_with_filtered[:filtered_out]) - hash_with_filtered + requests_dependencies = requests_to_remove.map do |request| + hash_with_filtered = request.ids_of_all_dependencies(dependencies_to_filter, :without_parents) + hash_with_filtered.add(:request, request.id) end - requests_dependencies.each do |hash| - filtered_builds = hash[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } - filtered_builds&.each(&:nullify_default_dependencies) unless @config.dry_run + unless @config.dry_run + requests_to_remove.each do |request| + hash_with_filtered = request.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + filtered_builds&.each(&:nullify_default_dependencies) + end end - ids_to_remove = IdHash.join(*(requests_dependencies.map { |h| h[:main] })) + ids_to_remove = IdHash.join(*(requests_dependencies)) @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" process_ids_to_remove(ids_to_remove) end @@ -62,15 +67,21 @@ def process_ids_to_remove(ids_to_remove) end end + def nullify_filtered_dependencies(entry) + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + filtered_builds&.each(&:nullify_default_dependencies) + end + def time_for_subfolder Time.now.to_s.parameterize.underscore end - def should_build_be_filtered?(build) - dependencies_to_filter[:build].map do |association| - build.send(association).to_a - end.flatten.any? - end + # def should_build_be_filtered?(build) + # dependencies_to_filter[:build].map do |association| + # build.send(association).to_a + # end.flatten.any? + # end def dependencies_to_filter { diff --git a/lib/id_hash.rb b/lib/id_hash.rb index bb8b197..6d00824 100644 --- a/lib/id_hash.rb +++ b/lib/id_hash.rb @@ -55,6 +55,7 @@ class IdHash < HashOfArrays def add(key, *values) super(key, *values) self[key].uniq! + self end def remove_entries_from_db(as_first: [], as_last: []) diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index fdd17c3..48cac25 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -73,13 +73,12 @@ def status_tree end def status_tree_condensed - @hash_for_duplication_check = IdHash.new result = status_tree.do_recursive do |tree| tree.each do |name, array| next unless array.class == Array new_array = array.map do |subtree| - next subtree.root_duplicate_summary if is_duplicate?(name, subtree) + next subtree.root_duplicate_summary if subtree[:duplicate] next subtree if subtree.class != Tree || subtree.size > 2 subtree.root_summary @@ -98,15 +97,6 @@ def status_tree_condensed end end - def is_duplicate?(name, tree) - if @hash_for_duplication_check[name]&.include?(tree[:id]) - true - else - @hash_for_duplication_check.add(name, tree[:id]) - false - end - end - def last_to_beginning! arr = self.to_a arr.unshift(arr.pop) @@ -165,16 +155,20 @@ def do_recursive(&block) end end - def dependency_tree(depth = Float::INFINITY) - result = depth > 0 ? get_associations_for_tree(depth) : Tree.new + def dependency_tree(depth = Float::INFINITY, hash_for_duplication_check = IdHash.new) + is_duplicate = hash_for_duplication_check[self.class]&.include?(id) + hash_for_duplication_check.add(self.class, id) + shoud_go_deeper = depth > 0 && !is_duplicate + result = shoud_go_deeper ? get_associations_for_tree(depth, hash_for_duplication_check) : Tree.new result[:id] = id result[:instance] = self + result[:duplicate] = true if is_duplicate result end private - def get_associations_for_tree(depth) + def get_associations_for_tree(depth, hash_for_duplication_check) result = Tree.new self.class.reflect_on_all_associations.map do |association| @@ -183,7 +177,7 @@ def get_associations_for_tree(depth) symbol = association.klass.name.underscore.to_sym self.send(association.name).sort_by(&:id).map do |associated_object| result[symbol] = [] if result[symbol].nil? - result[symbol] << associated_object.dependency_tree(depth - 1) + result[symbol] << associated_object.dependency_tree(depth - 1, hash_for_duplication_check) end end @@ -196,8 +190,8 @@ module IdsOfAllDependencies include IdsOfAllDirectDependencies include DependencyTree - def ids_of_all_dependencies(to_filter=nil) - ids_of_all_dependencies_with_filtered(to_filter)[:main] + def ids_of_all_dependencies(to_filter=nil, filtering_strategy=:with_parents) + ids_of_all_dependencies_with_filtered(to_filter, filtering_strategy)[:main] end def ids_of_all_dependencies_with_filtered(to_filter=nil, filtering_strategy=:with_parents) diff --git a/spec/backup/load_from_files_spec.rb b/spec/backup/load_from_files_spec.rb index 5be6787..f5688f5 100644 --- a/spec/backup/load_from_files_spec.rb +++ b/spec/backup/load_from_files_spec.rb @@ -8,6 +8,7 @@ require 'support/factories' require 'support/before_tests' require 'support/utils' +require 'support/expected_id_trees/load_from_files' require 'pry' require 'byebug' @@ -24,31 +25,7 @@ describe 'run' do context 'when it has remove_repo_builds resulting files to load' do let!(:expected_structure) { - [ - 100, - { - job: [ - { - log: [100, 101], - annotation: [100, 101], - queueable_job: [100, 101], - id: 216 - }, - 217 - ], - stage: [ - { - job: [212, 213], - id: 100 - }, - { - job: [214, 215], - id: 101 - } - ], - id: 211 - } - ] + ExpectedIdTrees.load_from_files } it 'loads data properly' do diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 077c341..c85ae87 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -9,6 +9,8 @@ require 'support/before_tests' require 'support/utils' require 'support/expected_dependency_trees/remove_repo_with_dependencies' +require 'support/expected_dependency_trees/remove_repo_builds' +require 'support/expected_dependency_trees/remove_repo_requests' require 'support/expected_dependency_trees/remove_org_with_dependencies' require 'support/expected_dependency_trees/remove_user_with_dependencies' require 'pry' @@ -65,39 +67,23 @@ def get_expected_files(directory, datetime) shared_context 'removing builds with dependencies' do it 'removes builds with all its dependencies' do + dependency_tree = repository.dependency_tree + remove_specified.remove_repo_builds(repository) + expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_repo_builds) + end + + it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_builds(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-16) - .and change { Log.all.size }.by(-2) - .and change { Job.all.size }.by(-6) - .and change { Build.all.size }.by(-2) - .and change { Request.all.size }.by(0) - .and change { Repository.all.size }.by(0) - .and change { Branch.all.size }.by(0) - .and change { Tag.all.size }.by(0) - .and change { Commit.all.size }.by(0) - .and change { Cron.all.size }.by(0) - .and change { PullRequest.all.size }.by(0) - .and change { SslKey.all.size }.by(0) - .and change { Stage.all.size }.by(-2) - .and change { Star.all.size }.by(0) - .and change { Permission.all.size }.by(0) - .and change { Message.all.size }.by(0) - .and change { Abuse.all.size }.by(0) - .and change { Annotation.all.size }.by(-2) - .and change { QueueableJob.all.size }.by(-2) - .and change { Email.all.size }.by(0) - .and change { Invoice.all.size }.by(0) - .and change { Membership.all.size }.by(0) - .and change { Organization.all.size }.by(0) - .and change { OwnerGroup.all.size }.by(0) - .and change { Broadcast.all.size }.by(0) - .and change { Subscription.all.size }.by(0) - .and change { Token.all.size }.by(0) - .and change { TrialAllowance.all.size }.by(0) - .and change { Trial.all.size }.by(0) - .and change { UserBetaFeature.all.size }.by(0) - .and change { User.all.size }.by(0) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-46) + end + + it 'nullifies orphaned builds dependencies' do + expect( + nullifies_all_orphaned_builds_dependencies? do + remove_specified.remove_repo_builds(repository) + end + ).to eql(true) end end @@ -167,7 +153,7 @@ def get_expected_files(directory, datetime) db_helper.do_without_triggers do FactoryBot.create( - :repository_with_all_dependencies, + :repository_for_removing_heavy_data, created_at: datetime, updated_at: datetime ) @@ -176,39 +162,23 @@ def get_expected_files(directory, datetime) shared_context 'removing requests with dependencies' do it 'removes requests with all its dependencies' do + dependency_tree = repository.dependency_tree + remove_specified.remove_repo_requests(repository) + expect(dependency_tree.status_tree_condensed).to eql(ExpectedDependencyTrees.remove_repo_requests) + end + + it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_requests(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-16) - .and change { Log.all.size }.by(-2) - .and change { Job.all.size }.by(-2) - .and change { Build.all.size }.by(-2) - .and change { Request.all.size }.by(-2) - .and change { Repository.all.size }.by(0) - .and change { Branch.all.size }.by(0) - .and change { Tag.all.size }.by(0) - .and change { Commit.all.size }.by(0) - .and change { Cron.all.size }.by(0) - .and change { PullRequest.all.size }.by(0) - .and change { SslKey.all.size }.by(0) - .and change { Stage.all.size }.by(0) - .and change { Star.all.size }.by(0) - .and change { Permission.all.size }.by(0) - .and change { Message.all.size }.by(-2) - .and change { Abuse.all.size }.by(-2) - .and change { Annotation.all.size }.by(-2) - .and change { QueueableJob.all.size }.by(-2) - .and change { Email.all.size }.by(0) - .and change { Invoice.all.size }.by(0) - .and change { Membership.all.size }.by(0) - .and change { Organization.all.size }.by(0) - .and change { OwnerGroup.all.size }.by(0) - .and change { Broadcast.all.size }.by(0) - .and change { Subscription.all.size }.by(0) - .and change { Token.all.size }.by(0) - .and change { TrialAllowance.all.size }.by(0) - .and change { Trial.all.size }.by(0) - .and change { UserBetaFeature.all.size }.by(0) - .and change { User.all.size }.by(0) + }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-19) + end + + it 'nullifies orphaned builds dependencies' do + expect( + nullifies_all_orphaned_builds_dependencies? do + remove_specified.remove_repo_requests(repository) + end + ).to eql(true) end end diff --git a/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb index ccb956e..4fa5f39 100644 --- a/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb +++ b/spec/support/expected_dependency_trees/remove_org_with_dependencies.rb @@ -499,2135 +499,2135 @@ def self.remove_org_with_dependencies { _: "id 210, removed", repository: [ - "id 1, removed, duplicate" - ] - }, - { - _: "id 211, removed", - job: [ - { - _: "id 216, removed", - log: [ - "id 73, removed", - "id 74, removed" - ], - annotation: [ - "id 73, removed", - "id 74, removed" - ], - queueable_job: [ - "id 73, removed", - "id 74, removed" - ] - }, - "id 217, removed" - ], - repository: [ - { - _: "id 105, present", - build: [ - "id 258, present" - ], - request: [ - "id 54, present" - ], - job: [ - "id 259, present" - ], - branch: [ - "id 134, present" - ], - ssl_key: [ - "id 40, present" - ], - commit: [ - "id 240, present" - ], - permission: [ - "id 10, present" - ], - star: [ - "id 10, present" - ], - pull_request: [ - "id 10, present" - ], - tag: [ - "id 62, present" - ] - }, - "id 106, present", - { - _: "id 103, present", - build: [ - "id 256, present" - ], - request: [ - "id 53, present" - ], - job: [ - "id 257, present" - ], - branch: [ - "id 133, present" - ], - ssl_key: [ - "id 39, present" - ], - commit: [ - "id 239, present" - ], - permission: [ - "id 9, present" - ], - star: [ - "id 9, present" - ], - pull_request: [ - "id 9, present" - ], - tag: [ - "id 61, present" - ] - }, - "id 104, present" - ], - tag: [ { - _: "id 51, present", + _: "id 1, removed", build: [ { - _: "id 218, present", + _: "id 1, removed", job: [ - "id 219, present" + { + _: "id 6, removed", + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ] + }, + "id 7, removed" ], repository: [ - "id 88, present", - "id 87, present" - ], - tag: [ - "id 52, present" - ], - branch: [ - "id 123, present" - ], - stage: [ - "id 64, present" - ] - }, - "id 220, present" - ], - commit: [ - { - _: "id 235, present", - build: [ { - _: "id 221, present", - job: [ - "id 222, present" + _: "id 20, present", + build: [ + "id 48, present" ], - repository: [ - "id 90, present", - "id 89, present" + request: [ + "id 10, present" ], - tag: [ - "id 53, present" + job: [ + "id 49, present" ], branch: [ - "id 124, present" + "id 84, present" ], - stage: [ - "id 65, present" - ] - }, - "id 223, present" - ], - job: [ - { - _: "id 224, present", - log: [ - "id 75, present", - "id 76, present" + ssl_key: [ + "id 32, present" ], - annotation: [ - "id 75, present", - "id 76, present" + commit: [ + "id 216, present" ], - queueable_job: [ - "id 75, present", - "id 76, present" + permission: [ + "id 2, present" + ], + star: [ + "id 2, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" ] }, - "id 225, present" - ], - request: [ + "id 21, present", { - _: "id 45, present", - abuse: [ - "id 39, present", - "id 40, present" + _: "id 18, present", + build: [ + "id 46, present" ], - message: [ - "id 39, present", - "id 40, present" + request: [ + "id 9, present" ], job: [ - { - _: "id 229, present", - log: [ - "id 77, present", - "id 78, present" - ], - annotation: [ - "id 77, present", - "id 78, present" - ], - queueable_job: [ - "id 77, present", - "id 78, present" - ] - }, - "id 230, present" + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 1, present" + ], + star: [ + "id 1, present" + ], + pull_request: [ + "id 1, present" ], + tag: [ + "id 11, present" + ] + }, + "id 19, present" + ], + tag: [ + { + _: "id 1, present", build: [ { - _: "id 226, present", + _: "id 8, present", job: [ - "id 227, present" + "id 9, present" ], repository: [ - "id 92, present", - "id 91, present" + "id 3, present", + "id 2, present" ], tag: [ - "id 54, present" + "id 2, present" ], branch: [ - "id 125, present" + "id 73, present" ], stage: [ - "id 66, present" + "id 22, present" ] }, - "id 228, present" - ] - }, - "id 46, present" - ] - }, - "id 236, present" - ], - request: [ - { - _: "id 47, present", - abuse: [ - "id 41, present", - "id 42, present" - ], - message: [ - "id 41, present", - "id 42, present" - ], - job: [ - { - _: "id 234, present", - log: [ - "id 79, present", - "id 80, present" - ], - annotation: [ - "id 79, present", - "id 80, present" - ], - queueable_job: [ - "id 79, present", - "id 80, present" - ] - }, - "id 235, present" - ], - build: [ - { - _: "id 231, present", - job: [ - "id 232, present" - ], - repository: [ - "id 94, present", - "id 93, present" - ], - tag: [ - "id 55, present" - ], - branch: [ - "id 126, present" - ], - stage: [ - "id 67, present" - ] - }, - "id 233, present" - ] - }, - "id 48, present" - ] - }, - "id 56, present" - ], - branch: [ - { - _: "id 127, present", - build: [ - { - _: "id 236, present", - job: [ - "id 237, present" - ], - repository: [ - "id 96, present", - "id 95, present" - ], - tag: [ - "id 57, present" - ], - branch: [ - "id 128, present" - ], - stage: [ - "id 68, present" - ] - }, - "id 238, present" - ], - commit: [ - { - _: "id 237, present", - build: [ - { - _: "id 241, present", - job: [ - "id 242, present" - ], - repository: [ - "id 98, present", - "id 97, present" - ], - tag: [ - "id 58, present" - ], - branch: [ - "id 129, present" - ], - stage: [ - "id 69, present" - ] - }, - "id 243, present" - ], - job: [ - { - _: "id 244, present", - log: [ - "id 83, present", - "id 84, present" - ], - annotation: [ - "id 83, present", - "id 84, present" - ], - queueable_job: [ - "id 83, present", - "id 84, present" - ] - }, - "id 245, present" - ], - request: [ - { - _: "id 49, present", - abuse: [ - "id 43, present", - "id 44, present" - ], - message: [ - "id 43, present", - "id 44, present" - ], - job: [ - { - _: "id 249, present", - log: [ - "id 85, present", - "id 86, present" - ], - annotation: [ - "id 85, present", - "id 86, present" - ], - queueable_job: [ - "id 85, present", - "id 86, present" - ] - }, - "id 250, present" - ], - build: [ - { - _: "id 246, present", - job: [ - "id 247, present" - ], - repository: [ - "id 100, present", - "id 99, present" - ], - tag: [ - "id 59, present" - ], - branch: [ - "id 130, present" - ], - stage: [ - "id 70, present" - ] - }, - "id 248, present" - ] - }, - "id 50, present" - ] - }, - "id 238, present" - ], - cron: [ - "id 9, present", - "id 10, present" - ], - job: [ - { - _: "id 239, present", - log: [ - "id 81, present", - "id 82, present" - ], - annotation: [ - "id 81, present", - "id 82, present" - ], - queueable_job: [ - "id 81, present", - "id 82, present" - ] - }, - "id 240, present" - ], - request: [ - { - _: "id 51, present", - abuse: [ - "id 45, present", - "id 46, present" - ], - message: [ - "id 45, present", - "id 46, present" - ], - job: [ - { - _: "id 254, present", - log: [ - "id 87, present", - "id 88, present" - ], - annotation: [ - "id 87, present", - "id 88, present" - ], - queueable_job: [ - "id 87, present", - "id 88, present" - ] - }, - "id 255, present" - ], - build: [ - { - _: "id 251, present", - job: [ - "id 252, present" - ], - repository: [ - "id 102, present", - "id 101, present" - ], - tag: [ - "id 60, present" - ], - branch: [ - "id 131, present" - ], - stage: [ - "id 71, present" - ] - }, - "id 253, present" - ] - }, - "id 52, present" - ] - }, - "id 132, present" - ], - stage: [ - { - _: "id 62, removed", - job: [ - "id 212, removed", - "id 213, removed" - ] - }, - { - _: "id 63, removed", - job: [ - "id 214, removed", - "id 215, removed" - ] - } - ] - }, - { - _: "id 260, removed", - repository: [ - "id 1, removed, duplicate" - ] - } - ], - repository: [ - { - _: "id 1, removed", - build: [ - { - _: "id 1, removed", - job: [ - { - _: "id 6, removed", - log: [ - "id 1, removed", - "id 2, removed" - ], - annotation: [ - "id 1, removed", - "id 2, removed" - ], - queueable_job: [ - "id 1, removed", - "id 2, removed" - ] - }, - "id 7, removed" - ], - repository: [ - { - _: "id 20, present", - build: [ - "id 48, present" - ], - request: [ - "id 10, present" - ], - job: [ - "id 49, present" - ], - branch: [ - "id 84, present" - ], - ssl_key: [ - "id 32, present" - ], - commit: [ - "id 216, present" - ], - permission: [ - "id 2, present" - ], - star: [ - "id 2, present" - ], - pull_request: [ - "id 2, present" - ], - tag: [ - "id 12, present" - ] - }, - "id 21, present", - { - _: "id 18, present", - build: [ - "id 46, present" - ], - request: [ - "id 9, present" - ], - job: [ - "id 47, present" - ], - branch: [ - "id 83, present" - ], - ssl_key: [ - "id 31, present" - ], - commit: [ - "id 215, present" - ], - permission: [ - "id 1, present" - ], - star: [ - "id 1, present" - ], - pull_request: [ - "id 1, present" - ], - tag: [ - "id 11, present" - ] - }, - "id 19, present" - ], - tag: [ - { - _: "id 1, present", - build: [ - { - _: "id 8, present", - job: [ - "id 9, present" - ], - repository: [ - "id 3, present", - "id 2, present" - ], - tag: [ - "id 2, present" - ], - branch: [ - "id 73, present" - ], - stage: [ - "id 22, present" - ] - }, - "id 10, present" - ], - commit: [ - { - _: "id 211, present", - build: [ - { - _: "id 11, present", - job: [ - "id 12, present" - ], - repository: [ - "id 5, present", - "id 4, present" - ], - tag: [ - "id 3, present" - ], - branch: [ - "id 74, present" - ], - stage: [ - "id 23, present" - ] - }, - "id 13, present" + "id 10, present" ], - job: [ + commit: [ { - _: "id 14, present", - log: [ - "id 3, present", - "id 4, present" + _: "id 211, present", + build: [ + { + _: "id 11, present", + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ] + }, + "id 13, present" ], - annotation: [ - "id 3, present", - "id 4, present" + job: [ + { + _: "id 14, present", + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" ], - queueable_job: [ - "id 3, present", - "id 4, present" + request: [ + { + _: "id 1, present", + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 19, present", + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + build: [ + { + _: "id 16, present", + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" ] }, - "id 15, present" + "id 212, present" ], request: [ { - _: "id 1, present", + _: "id 3, present", abuse: [ - "id 1, present", - "id 2, present" + "id 3, present", + "id 4, present" ], message: [ - "id 1, present", - "id 2, present" + "id 3, present", + "id 4, present" ], job: [ { - _: "id 19, present", + _: "id 24, present", log: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], annotation: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], queueable_job: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ] }, - "id 20, present" + "id 25, present" ], build: [ { - _: "id 16, present", + _: "id 21, present", job: [ - "id 17, present" + "id 22, present" ], repository: [ - "id 7, present", - "id 6, present" + "id 9, present", + "id 8, present" ], tag: [ - "id 4, present" + "id 5, present" ], branch: [ - "id 75, present" + "id 76, present" ], stage: [ - "id 24, present" + "id 25, present" ] }, - "id 18, present" + "id 23, present" ] }, - "id 2, present" + "id 4, present" ] }, - "id 212, present" + "id 6, present" ], - request: [ + branch: [ { - _: "id 3, present", - abuse: [ - "id 3, present", - "id 4, present" - ], - message: [ - "id 3, present", - "id 4, present" - ], - job: [ - { - _: "id 24, present", - log: [ - "id 7, present", - "id 8, present" - ], - annotation: [ - "id 7, present", - "id 8, present" - ], - queueable_job: [ - "id 7, present", - "id 8, present" - ] - }, - "id 25, present" - ], + _: "id 77, present", build: [ { - _: "id 21, present", + _: "id 26, present", job: [ - "id 22, present" + "id 27, present" ], repository: [ - "id 9, present", - "id 8, present" + "id 11, present", + "id 10, present" ], tag: [ - "id 5, present" + "id 7, present" ], branch: [ - "id 76, present" + "id 78, present" ], stage: [ - "id 25, present" + "id 26, present" ] }, - "id 23, present" - ] - }, - "id 4, present" - ] - }, - "id 6, present" - ], - branch: [ - { - _: "id 77, present", - build: [ - { - _: "id 26, present", - job: [ - "id 27, present" - ], - repository: [ - "id 11, present", - "id 10, present" - ], - tag: [ - "id 7, present" - ], - branch: [ - "id 78, present" + "id 28, present" ], - stage: [ - "id 26, present" - ] - }, - "id 28, present" - ], - commit: [ - { - _: "id 213, present", - build: [ + commit: [ { - _: "id 31, present", - job: [ - "id 32, present" - ], - repository: [ - "id 13, present", - "id 12, present" - ], - tag: [ - "id 8, present" + _: "id 213, present", + build: [ + { + _: "id 31, present", + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ] + }, + "id 33, present" ], - branch: [ - "id 79, present" + job: [ + { + _: "id 34, present", + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" ], - stage: [ - "id 27, present" + request: [ + { + _: "id 5, present", + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 39, present", + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + build: [ + { + _: "id 36, present", + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" ] }, - "id 33, present" + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" ], job: [ { - _: "id 34, present", + _: "id 29, present", log: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ], annotation: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ], queueable_job: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ] }, - "id 35, present" + "id 30, present" ], request: [ { - _: "id 5, present", + _: "id 7, present", abuse: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], message: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], job: [ { - _: "id 39, present", + _: "id 44, present", log: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ], annotation: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ], queueable_job: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ] }, - "id 40, present" + "id 45, present" ], build: [ { - _: "id 36, present", + _: "id 41, present", job: [ - "id 37, present" + "id 42, present" ], repository: [ - "id 15, present", - "id 14, present" + "id 17, present", + "id 16, present" ], tag: [ - "id 9, present" + "id 10, present" ], branch: [ - "id 80, present" + "id 81, present" ], stage: [ - "id 28, present" + "id 29, present" ] }, - "id 38, present" + "id 43, present" ] }, - "id 6, present" + "id 8, present" ] }, - "id 214, present" + "id 82, present" ], - cron: [ - "id 1, present", - "id 2, present" + stage: [ + { + _: "id 20, removed", + job: [ + "id 2, removed", + "id 3, removed" + ] + }, + { + _: "id 21, removed", + job: [ + "id 4, removed", + "id 5, removed" + ] + } + ] + }, + "id 50, removed" + ], + request: [ + { + _: "id 11, removed", + abuse: [ + "id 9, removed", + "id 10, removed" + ], + message: [ + "id 9, removed", + "id 10, removed" ], job: [ { - _: "id 29, present", + _: "id 54, removed", log: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ], annotation: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ], queueable_job: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ] }, - "id 30, present" + "id 55, removed" ], - request: [ + build: [ { - _: "id 7, present", - abuse: [ - "id 7, present", - "id 8, present" + _: "id 51, removed", + job: [ + "id 52, removed" ], - message: [ - "id 7, present", - "id 8, present" + repository: [ + "id 23, present", + "id 22, present" ], - job: [ - { - _: "id 44, present", - log: [ - "id 15, present", - "id 16, present" - ], - annotation: [ - "id 15, present", - "id 16, present" - ], - queueable_job: [ - "id 15, present", - "id 16, present" - ] - }, - "id 45, present" + tag: [ + "id 13, present" ], - build: [ - { - _: "id 41, present", - job: [ - "id 42, present" - ], - repository: [ - "id 17, present", - "id 16, present" - ], - tag: [ - "id 10, present" - ], - branch: [ - "id 81, present" - ], - stage: [ - "id 29, present" - ] - }, - "id 43, present" + branch: [ + "id 85, present" + ], + stage: [ + "id 30, removed" ] }, - "id 8, present" - ] - }, - "id 82, present" - ], - stage: [ - { - _: "id 20, removed", - job: [ - "id 2, removed", - "id 3, removed" + "id 53, removed" ] }, - { - _: "id 21, removed", - job: [ - "id 4, removed", - "id 5, removed" - ] - } - ] - }, - "id 50, removed" - ], - request: [ - { - _: "id 11, removed", - abuse: [ - "id 9, removed", - "id 10, removed" - ], - message: [ - "id 9, removed", - "id 10, removed" + "id 12, removed" ], job: [ { - _: "id 54, removed", + _: "id 56, removed", log: [ - "id 17, removed", - "id 18, removed" + "id 19, removed", + "id 20, removed" ], annotation: [ - "id 17, removed", - "id 18, removed" + "id 19, removed", + "id 20, removed" ], queueable_job: [ - "id 17, removed", - "id 18, removed" - ] - }, - "id 55, removed" - ], - build: [ - { - _: "id 51, removed", - job: [ - "id 52, removed" - ], - repository: [ - "id 23, present", - "id 22, present" - ], - tag: [ - "id 13, present" - ], - branch: [ - "id 85, present" - ], - stage: [ - "id 30, removed" - ] - }, - "id 53, removed" - ] - }, - "id 12, removed" - ], - job: [ - { - _: "id 56, removed", - log: [ - "id 19, removed", - "id 20, removed" - ], - annotation: [ - "id 19, removed", - "id 20, removed" - ], - queueable_job: [ - "id 19, removed", - "id 20, removed" - ] - }, - "id 57, removed" - ], - branch: [ - { - _: "id 86, removed", - build: [ - { - _: "id 58, removed", - job: [ - "id 59, removed" - ], - repository: [ - "id 25, present", - "id 24, present" - ], - tag: [ - "id 14, present" - ], - branch: [ - "id 87, present" - ], - stage: [ - "id 31, removed" + "id 19, removed", + "id 20, removed" ] }, - "id 60, removed" + "id 57, removed" ], - commit: [ + branch: [ { - _: "id 217, removed", + _: "id 86, removed", build: [ { - _: "id 63, removed", + _: "id 58, removed", job: [ - "id 64, removed" + "id 59, removed" ], repository: [ - "id 27, present", - "id 26, present" + "id 25, present", + "id 24, present" ], tag: [ - "id 15, present" + "id 14, present" ], branch: [ - "id 88, present" + "id 87, present" ], stage: [ - "id 32, removed" - ] - }, - "id 65, removed" - ], - job: [ - { - _: "id 66, removed", - log: [ - "id 23, removed", - "id 24, removed" - ], - annotation: [ - "id 23, removed", - "id 24, removed" - ], - queueable_job: [ - "id 23, removed", - "id 24, removed" + "id 31, removed" ] }, - "id 67, removed" + "id 60, removed" ], - request: [ + commit: [ { - _: "id 13, removed", - abuse: [ - "id 11, removed", - "id 12, removed" - ], - message: [ - "id 11, removed", - "id 12, removed" - ], - job: [ - { - _: "id 71, removed", - log: [ - "id 25, removed", - "id 26, removed" - ], - annotation: [ - "id 25, removed", - "id 26, removed" - ], - queueable_job: [ - "id 25, removed", - "id 26, removed" - ] - }, - "id 72, removed" - ], + _: "id 217, removed", build: [ { - _: "id 68, removed", + _: "id 63, removed", job: [ - "id 69, removed" + "id 64, removed" ], repository: [ - "id 29, present", - "id 28, present" + "id 27, present", + "id 26, present" ], tag: [ - "id 16, present" + "id 15, present" ], branch: [ - "id 89, present" + "id 88, present" ], stage: [ - "id 33, removed" + "id 32, removed" ] }, - "id 70, removed" - ] - }, - "id 14, removed" - ] - }, - "id 218, removed" - ], - cron: [ - "id 3, removed", - "id 4, removed" - ], - job: [ - { - _: "id 61, removed", - log: [ - "id 21, removed", - "id 22, removed" - ], - annotation: [ - "id 21, removed", - "id 22, removed" - ], - queueable_job: [ - "id 21, removed", - "id 22, removed" - ] - }, - "id 62, removed" - ], - request: [ - { - _: "id 15, removed", - abuse: [ - "id 13, removed", - "id 14, removed" - ], - message: [ - "id 13, removed", - "id 14, removed" - ], - job: [ - { - _: "id 76, removed", - log: [ - "id 27, removed", - "id 28, removed" + "id 65, removed" ], - annotation: [ - "id 27, removed", - "id 28, removed" - ], - queueable_job: [ - "id 27, removed", - "id 28, removed" - ] - }, - "id 77, removed" - ], - build: [ - { - _: "id 73, removed", job: [ - "id 74, removed" - ], - repository: [ - "id 31, present", - "id 30, present" - ], - tag: [ - "id 17, present" - ], - branch: [ - "id 90, present" - ], - stage: [ - "id 34, removed" - ] - }, - "id 75, removed" - ] - }, - "id 16, removed" - ] - }, - "id 91, removed" - ], - ssl_key: [ - "id 33, removed", - "id 34, removed" - ], - commit: [ - { - _: "id 219, removed", - build: [ - { - _: "id 78, removed", - job: [ - "id 79, removed" - ], - repository: [ - "id 33, present", - "id 32, present" - ], - tag: [ - "id 18, present" - ], - branch: [ - "id 92, present" - ], - stage: [ - "id 35, removed" - ] - }, - "id 80, removed" - ], - job: [ - { - _: "id 81, removed", - log: [ - "id 29, removed", - "id 30, removed" - ], - annotation: [ - "id 29, removed", - "id 30, removed" - ], - queueable_job: [ - "id 29, removed", - "id 30, removed" - ] - }, - "id 82, removed" - ], - request: [ - { - _: "id 17, removed", - abuse: [ - "id 15, removed", - "id 16, removed" + { + _: "id 66, removed", + log: [ + "id 23, removed", + "id 24, removed" + ], + annotation: [ + "id 23, removed", + "id 24, removed" + ], + queueable_job: [ + "id 23, removed", + "id 24, removed" + ] + }, + "id 67, removed" + ], + request: [ + { + _: "id 13, removed", + abuse: [ + "id 11, removed", + "id 12, removed" + ], + message: [ + "id 11, removed", + "id 12, removed" + ], + job: [ + { + _: "id 71, removed", + log: [ + "id 25, removed", + "id 26, removed" + ], + annotation: [ + "id 25, removed", + "id 26, removed" + ], + queueable_job: [ + "id 25, removed", + "id 26, removed" + ] + }, + "id 72, removed" + ], + build: [ + { + _: "id 68, removed", + job: [ + "id 69, removed" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, removed" + ] + }, + "id 70, removed" + ] + }, + "id 14, removed" + ] + }, + "id 218, removed" ], - message: [ - "id 15, removed", - "id 16, removed" + cron: [ + "id 3, removed", + "id 4, removed" ], job: [ { - _: "id 86, removed", + _: "id 61, removed", log: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ], annotation: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ], queueable_job: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ] }, - "id 87, removed" + "id 62, removed" ], - build: [ + request: [ { - _: "id 83, removed", - job: [ - "id 84, removed" - ], - repository: [ - "id 35, present", - "id 34, present" + _: "id 15, removed", + abuse: [ + "id 13, removed", + "id 14, removed" ], - tag: [ - "id 19, present" + message: [ + "id 13, removed", + "id 14, removed" ], - branch: [ - "id 93, present" + job: [ + { + _: "id 76, removed", + log: [ + "id 27, removed", + "id 28, removed" + ], + annotation: [ + "id 27, removed", + "id 28, removed" + ], + queueable_job: [ + "id 27, removed", + "id 28, removed" + ] + }, + "id 77, removed" ], - stage: [ - "id 36, removed" + build: [ + { + _: "id 73, removed", + job: [ + "id 74, removed" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, removed" + ] + }, + "id 75, removed" ] }, - "id 85, removed" + "id 16, removed" ] }, - "id 18, removed" - ] - }, - "id 220, removed" - ], - permission: [ - "id 3, removed", - "id 4, removed" - ], - star: [ - "id 3, removed", - "id 4, removed" - ], - pull_request: [ - { - _: "id 3, removed", - request: [ + "id 91, removed" + ], + ssl_key: [ + "id 33, removed", + "id 34, removed" + ], + commit: [ { - _: "id 29, removed", - abuse: [ - "id 25, removed", - "id 26, removed" - ], - message: [ - "id 25, removed", - "id 26, removed" - ], - job: [ - { - _: "id 141, removed", - log: [ - "id 49, removed", - "id 50, removed" - ], - annotation: [ - "id 49, removed", - "id 50, removed" - ], - queueable_job: [ - "id 49, removed", - "id 50, removed" - ] - }, - "id 142, removed" - ], + _: "id 219, removed", build: [ { - _: "id 138, removed", + _: "id 78, removed", job: [ - "id 139, removed" + "id 79, removed" ], repository: [ - "id 57, present", - "id 56, present" + "id 33, present", + "id 32, present" ], tag: [ - "id 32, present" + "id 18, present" ], branch: [ - "id 106, present" + "id 92, present" ], stage: [ - "id 47, removed" + "id 35, removed" ] }, - "id 140, removed" - ] - }, - "id 30, removed" - ], - build: [ - { - _: "id 88, removed", + "id 80, removed" + ], job: [ { - _: "id 93, removed", + _: "id 81, removed", log: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ], annotation: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ], queueable_job: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ] }, - "id 94, removed" + "id 82, removed" ], - repository: [ + request: [ { - _: "id 54, present", - build: [ - "id 135, present" + _: "id 17, removed", + abuse: [ + "id 15, removed", + "id 16, removed" ], - request: [ - "id 28, present" + message: [ + "id 15, removed", + "id 16, removed" ], job: [ - "id 136, present" - ], - branch: [ - "id 105, present" - ], - ssl_key: [ - "id 36, present" - ], - commit: [ - "id 226, present" - ], - permission: [ - "id 6, present" - ], - star: [ - "id 6, present" - ], - pull_request: [ - "id 5, present" + { + _: "id 86, removed", + log: [ + "id 31, removed", + "id 32, removed" + ], + annotation: [ + "id 31, removed", + "id 32, removed" + ], + queueable_job: [ + "id 31, removed", + "id 32, removed" + ] + }, + "id 87, removed" ], - tag: [ - "id 31, present" + build: [ + { + _: "id 83, removed", + job: [ + "id 84, removed" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, removed" + ] + }, + "id 85, removed" ] }, - "id 55, present", + "id 18, removed" + ] + }, + "id 220, removed" + ], + permission: [ + "id 3, removed", + "id 4, removed" + ], + star: [ + "id 3, removed", + "id 4, removed" + ], + pull_request: [ + { + _: "id 3, removed", + request: [ { - _: "id 52, present", - build: [ - "id 133, present" + _: "id 29, removed", + abuse: [ + "id 25, removed", + "id 26, removed" ], - request: [ - "id 27, present" + message: [ + "id 25, removed", + "id 26, removed" ], job: [ - "id 134, present" - ], - branch: [ - "id 104, present" - ], - ssl_key: [ - "id 35, present" - ], - commit: [ - "id 225, present" - ], - permission: [ - "id 5, present" - ], - star: [ - "id 5, present" - ], - pull_request: [ - "id 4, present" + { + _: "id 141, removed", + log: [ + "id 49, removed", + "id 50, removed" + ], + annotation: [ + "id 49, removed", + "id 50, removed" + ], + queueable_job: [ + "id 49, removed", + "id 50, removed" + ] + }, + "id 142, removed" ], - tag: [ - "id 30, present" + build: [ + { + _: "id 138, removed", + job: [ + "id 139, removed" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, removed" + ] + }, + "id 140, removed" ] }, - "id 53, present" + "id 30, removed" ], - tag: [ + build: [ { - _: "id 20, present", - build: [ + _: "id 88, removed", + job: [ + { + _: "id 93, removed", + log: [ + "id 33, removed", + "id 34, removed" + ], + annotation: [ + "id 33, removed", + "id 34, removed" + ], + queueable_job: [ + "id 33, removed", + "id 34, removed" + ] + }, + "id 94, removed" + ], + repository: [ + { + _: "id 54, present", + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 6, present" + ], + star: [ + "id 6, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ] + }, + "id 55, present", { - _: "id 95, present", + _: "id 52, present", + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], job: [ - "id 96, present" + "id 134, present" ], - repository: [ - "id 37, present", - "id 36, present" + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 5, present" + ], + star: [ + "id 5, present" + ], + pull_request: [ + "id 4, present" ], tag: [ - "id 21, present" + "id 30, present" + ] + }, + "id 53, present" + ], + tag: [ + { + _: "id 20, present", + build: [ + { + _: "id 95, present", + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ] + }, + "id 97, present" ], - branch: [ - "id 94, present" + commit: [ + { + _: "id 221, present", + build: [ + { + _: "id 98, present", + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ] + }, + "id 100, present" + ], + job: [ + { + _: "id 101, present", + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + request: [ + { + _: "id 19, present", + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + _: "id 106, present", + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + build: [ + { + _: "id 103, present", + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" ], - stage: [ - "id 39, present" + request: [ + { + _: "id 21, present", + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + _: "id 111, present", + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + build: [ + { + _: "id 108, present", + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" ] }, - "id 97, present" + "id 25, present" ], - commit: [ + branch: [ { - _: "id 221, present", + _: "id 98, present", build: [ { - _: "id 98, present", + _: "id 113, present", job: [ - "id 99, present" + "id 114, present" ], repository: [ - "id 39, present", - "id 38, present" + "id 45, present", + "id 44, present" ], tag: [ - "id 22, present" + "id 26, present" ], branch: [ - "id 95, present" + "id 99, present" ], stage: [ - "id 40, present" + "id 43, present" + ] + }, + "id 115, present" + ], + commit: [ + { + _: "id 223, present", + build: [ + { + _: "id 118, present", + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ] + }, + "id 120, present" + ], + job: [ + { + _: "id 121, present", + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + request: [ + { + _: "id 23, present", + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + _: "id 126, present", + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + build: [ + { + _: "id 123, present", + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" ] }, - "id 100, present" + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" ], job: [ { - _: "id 101, present", + _: "id 116, present", log: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ], annotation: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ], queueable_job: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ] }, - "id 102, present" + "id 117, present" ], request: [ { - _: "id 19, present", + _: "id 25, present", abuse: [ - "id 17, present", - "id 18, present" + "id 23, present", + "id 24, present" ], message: [ - "id 17, present", - "id 18, present" + "id 23, present", + "id 24, present" ], job: [ { - _: "id 106, present", + _: "id 131, present", log: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ], annotation: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ], queueable_job: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ] }, - "id 107, present" + "id 132, present" ], build: [ { - _: "id 103, present", + _: "id 128, present", job: [ - "id 104, present" + "id 129, present" ], repository: [ - "id 41, present", - "id 40, present" + "id 51, present", + "id 50, present" ], tag: [ - "id 23, present" + "id 29, present" ], branch: [ - "id 96, present" + "id 102, present" ], stage: [ - "id 41, present" + "id 46, present" ] }, - "id 105, present" + "id 130, present" ] }, - "id 20, present" + "id 26, present" ] }, - "id 222, present" + "id 103, present" + ], + stage: [ + { + _: "id 37, removed", + job: [ + "id 89, removed", + "id 90, removed" + ] + }, + { + _: "id 38, removed", + job: [ + "id 91, removed", + "id 92, removed" + ] + } + ] + }, + "id 137, removed" + ] + }, + "id 6, removed" + ], + tag: [ + { + _: "id 33, removed", + build: [ + { + _: "id 143, removed", + job: [ + "id 144, removed" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, removed" + ] + }, + "id 145, removed" + ], + commit: [ + { + _: "id 227, removed", + build: [ + { + _: "id 146, removed", + job: [ + "id 147, removed" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, removed" + ] + }, + "id 148, removed" + ], + job: [ + { + _: "id 149, removed", + log: [ + "id 51, removed", + "id 52, removed" + ], + annotation: [ + "id 51, removed", + "id 52, removed" + ], + queueable_job: [ + "id 51, removed", + "id 52, removed" + ] + }, + "id 150, removed" ], request: [ { - _: "id 21, present", + _: "id 31, removed", abuse: [ - "id 19, present", - "id 20, present" + "id 27, removed", + "id 28, removed" ], message: [ - "id 19, present", - "id 20, present" + "id 27, removed", + "id 28, removed" ], job: [ { - _: "id 111, present", + _: "id 154, removed", log: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ], annotation: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ], queueable_job: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ] }, - "id 112, present" + "id 155, removed" ], build: [ { - _: "id 108, present", + _: "id 151, removed", job: [ - "id 109, present" + "id 152, removed" ], repository: [ - "id 43, present", - "id 42, present" + "id 63, present", + "id 62, present" ], tag: [ - "id 24, present" + "id 36, present" ], branch: [ - "id 97, present" + "id 109, present" ], stage: [ - "id 42, present" + "id 50, removed" ] }, - "id 110, present" + "id 153, removed" ] }, - "id 22, present" + "id 32, removed" ] }, - "id 25, present" + "id 228, removed" ], - branch: [ + request: [ { - _: "id 98, present", + _: "id 33, removed", + abuse: [ + "id 29, removed", + "id 30, removed" + ], + message: [ + "id 29, removed", + "id 30, removed" + ], + job: [ + { + _: "id 159, removed", + log: [ + "id 55, removed", + "id 56, removed" + ], + annotation: [ + "id 55, removed", + "id 56, removed" + ], + queueable_job: [ + "id 55, removed", + "id 56, removed" + ] + }, + "id 160, removed" + ], build: [ { - _: "id 113, present", + _: "id 156, removed", job: [ - "id 114, present" + "id 157, removed" ], repository: [ - "id 45, present", - "id 44, present" + "id 65, present", + "id 64, present" ], tag: [ - "id 26, present" + "id 37, present" ], branch: [ - "id 99, present" + "id 110, present" ], stage: [ - "id 43, present" + "id 51, removed" ] }, - "id 115, present" + "id 158, removed" + ] + }, + "id 34, removed" + ] + }, + "id 38, removed" + ] + } + ] + }, + { + _: "id 211, removed", + job: [ + { + _: "id 216, removed", + log: [ + "id 73, removed", + "id 74, removed" + ], + annotation: [ + "id 73, removed", + "id 74, removed" + ], + queueable_job: [ + "id 73, removed", + "id 74, removed" + ] + }, + "id 217, removed" + ], + repository: [ + { + _: "id 105, present", + build: [ + "id 258, present" + ], + request: [ + "id 54, present" + ], + job: [ + "id 259, present" + ], + branch: [ + "id 134, present" + ], + ssl_key: [ + "id 40, present" + ], + commit: [ + "id 240, present" + ], + permission: [ + "id 10, present" + ], + star: [ + "id 10, present" + ], + pull_request: [ + "id 10, present" + ], + tag: [ + "id 62, present" + ] + }, + "id 106, present", + { + _: "id 103, present", + build: [ + "id 256, present" + ], + request: [ + "id 53, present" + ], + job: [ + "id 257, present" + ], + branch: [ + "id 133, present" + ], + ssl_key: [ + "id 39, present" + ], + commit: [ + "id 239, present" + ], + permission: [ + "id 9, present" + ], + star: [ + "id 9, present" + ], + pull_request: [ + "id 9, present" + ], + tag: [ + "id 61, present" + ] + }, + "id 104, present" + ], + tag: [ + { + _: "id 51, present", + build: [ + { + _: "id 218, present", + job: [ + "id 219, present" + ], + repository: [ + "id 88, present", + "id 87, present" + ], + tag: [ + "id 52, present" + ], + branch: [ + "id 123, present" + ], + stage: [ + "id 64, present" + ] + }, + "id 220, present" + ], + commit: [ + { + _: "id 235, present", + build: [ + { + _: "id 221, present", + job: [ + "id 222, present" ], - commit: [ - { - _: "id 223, present", - build: [ - { - _: "id 118, present", - job: [ - "id 119, present" - ], - repository: [ - "id 47, present", - "id 46, present" - ], - tag: [ - "id 27, present" - ], - branch: [ - "id 100, present" - ], - stage: [ - "id 44, present" - ] - }, - "id 120, present" - ], - job: [ - { - _: "id 121, present", - log: [ - "id 43, present", - "id 44, present" - ], - annotation: [ - "id 43, present", - "id 44, present" - ], - queueable_job: [ - "id 43, present", - "id 44, present" - ] - }, - "id 122, present" - ], - request: [ - { - _: "id 23, present", - abuse: [ - "id 21, present", - "id 22, present" - ], - message: [ - "id 21, present", - "id 22, present" - ], - job: [ - { - _: "id 126, present", - log: [ - "id 45, present", - "id 46, present" - ], - annotation: [ - "id 45, present", - "id 46, present" - ], - queueable_job: [ - "id 45, present", - "id 46, present" - ] - }, - "id 127, present" - ], - build: [ - { - _: "id 123, present", - job: [ - "id 124, present" - ], - repository: [ - "id 49, present", - "id 48, present" - ], - tag: [ - "id 28, present" - ], - branch: [ - "id 101, present" - ], - stage: [ - "id 45, present" - ] - }, - "id 125, present" - ] - }, - "id 24, present" - ] - }, - "id 224, present" + repository: [ + "id 90, present", + "id 89, present" + ], + tag: [ + "id 53, present" + ], + branch: [ + "id 124, present" + ], + stage: [ + "id 65, present" + ] + }, + "id 223, present" + ], + job: [ + { + _: "id 224, present", + log: [ + "id 75, present", + "id 76, present" + ], + annotation: [ + "id 75, present", + "id 76, present" + ], + queueable_job: [ + "id 75, present", + "id 76, present" + ] + }, + "id 225, present" + ], + request: [ + { + _: "id 45, present", + abuse: [ + "id 39, present", + "id 40, present" ], - cron: [ - "id 5, present", - "id 6, present" + message: [ + "id 39, present", + "id 40, present" ], job: [ { - _: "id 116, present", + _: "id 229, present", log: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ], annotation: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ], queueable_job: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ] }, - "id 117, present" + "id 230, present" ], - request: [ + build: [ { - _: "id 25, present", - abuse: [ - "id 23, present", - "id 24, present" + _: "id 226, present", + job: [ + "id 227, present" ], - message: [ - "id 23, present", - "id 24, present" + repository: [ + "id 92, present", + "id 91, present" ], - job: [ - { - _: "id 131, present", - log: [ - "id 47, present", - "id 48, present" - ], - annotation: [ - "id 47, present", - "id 48, present" - ], - queueable_job: [ - "id 47, present", - "id 48, present" - ] - }, - "id 132, present" + tag: [ + "id 54, present" ], - build: [ - { - _: "id 128, present", - job: [ - "id 129, present" - ], - repository: [ - "id 51, present", - "id 50, present" - ], - tag: [ - "id 29, present" - ], - branch: [ - "id 102, present" - ], - stage: [ - "id 46, present" - ] - }, - "id 130, present" + branch: [ + "id 125, present" + ], + stage: [ + "id 66, present" ] }, - "id 26, present" + "id 228, present" ] }, - "id 103, present" + "id 46, present" + ] + }, + "id 236, present" + ], + request: [ + { + _: "id 47, present", + abuse: [ + "id 41, present", + "id 42, present" ], - stage: [ + message: [ + "id 41, present", + "id 42, present" + ], + job: [ { - _: "id 37, removed", - job: [ - "id 89, removed", - "id 90, removed" + _: "id 234, present", + log: [ + "id 79, present", + "id 80, present" + ], + annotation: [ + "id 79, present", + "id 80, present" + ], + queueable_job: [ + "id 79, present", + "id 80, present" ] }, + "id 235, present" + ], + build: [ { - _: "id 38, removed", + _: "id 231, present", job: [ - "id 91, removed", - "id 92, removed" + "id 232, present" + ], + repository: [ + "id 94, present", + "id 93, present" + ], + tag: [ + "id 55, present" + ], + branch: [ + "id 126, present" + ], + stage: [ + "id 67, present" ] - } + }, + "id 233, present" ] }, - "id 137, removed" + "id 48, present" ] }, - "id 6, removed" + "id 56, present" ], - tag: [ + branch: [ { - _: "id 33, removed", + _: "id 127, present", build: [ { - _: "id 143, removed", + _: "id 236, present", job: [ - "id 144, removed" + "id 237, present" ], repository: [ - "id 59, present", - "id 58, present" + "id 96, present", + "id 95, present" ], tag: [ - "id 34, present" + "id 57, present" ], branch: [ - "id 107, present" + "id 128, present" ], stage: [ - "id 48, removed" + "id 68, present" ] }, - "id 145, removed" + "id 238, present" ], commit: [ { - _: "id 227, removed", + _: "id 237, present", build: [ { - _: "id 146, removed", + _: "id 241, present", job: [ - "id 147, removed" + "id 242, present" ], repository: [ - "id 61, present", - "id 60, present" + "id 98, present", + "id 97, present" ], tag: [ - "id 35, present" + "id 58, present" ], branch: [ - "id 108, present" + "id 129, present" ], stage: [ - "id 49, removed" + "id 69, present" ] }, - "id 148, removed" + "id 243, present" ], job: [ { - _: "id 149, removed", + _: "id 244, present", log: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ], annotation: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ], queueable_job: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ] }, - "id 150, removed" + "id 245, present" ], request: [ { - _: "id 31, removed", + _: "id 49, present", abuse: [ - "id 27, removed", - "id 28, removed" + "id 43, present", + "id 44, present" ], message: [ - "id 27, removed", - "id 28, removed" + "id 43, present", + "id 44, present" ], job: [ { - _: "id 154, removed", + _: "id 249, present", log: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ], annotation: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ], queueable_job: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ] }, - "id 155, removed" + "id 250, present" ], build: [ { - _: "id 151, removed", + _: "id 246, present", job: [ - "id 152, removed" + "id 247, present" ], repository: [ - "id 63, present", - "id 62, present" + "id 100, present", + "id 99, present" ], tag: [ - "id 36, present" + "id 59, present" ], branch: [ - "id 109, present" + "id 130, present" ], stage: [ - "id 50, removed" + "id 70, present" ] }, - "id 153, removed" + "id 248, present" ] }, - "id 32, removed" + "id 50, present" + ] + }, + "id 238, present" + ], + cron: [ + "id 9, present", + "id 10, present" + ], + job: [ + { + _: "id 239, present", + log: [ + "id 81, present", + "id 82, present" + ], + annotation: [ + "id 81, present", + "id 82, present" + ], + queueable_job: [ + "id 81, present", + "id 82, present" ] }, - "id 228, removed" + "id 240, present" ], request: [ { - _: "id 33, removed", + _: "id 51, present", abuse: [ - "id 29, removed", - "id 30, removed" + "id 45, present", + "id 46, present" ], message: [ - "id 29, removed", - "id 30, removed" + "id 45, present", + "id 46, present" ], job: [ { - _: "id 159, removed", + _: "id 254, present", log: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ], annotation: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ], queueable_job: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ] }, - "id 160, removed" + "id 255, present" ], build: [ { - _: "id 156, removed", + _: "id 251, present", job: [ - "id 157, removed" + "id 252, present" ], repository: [ - "id 65, present", - "id 64, present" + "id 102, present", + "id 101, present" ], tag: [ - "id 37, present" + "id 60, present" ], branch: [ - "id 110, present" + "id 131, present" ], stage: [ - "id 51, removed" + "id 71, present" ] }, - "id 158, removed" + "id 253, present" ] }, - "id 34, removed" + "id 52, present" + ] + }, + "id 132, present" + ], + stage: [ + { + _: "id 62, removed", + job: [ + "id 212, removed", + "id 213, removed" ] }, - "id 38, removed" + { + _: "id 63, removed", + job: [ + "id 214, removed", + "id 215, removed" + ] + } ] }, + { + _: "id 260, removed", + repository: [ + "id 1, removed, duplicate" + ] + } + ], + repository: [ + "id 1, removed, duplicate", "id 66, removed" ], job: [ diff --git a/spec/support/expected_dependency_trees/remove_repo_builds.rb b/spec/support/expected_dependency_trees/remove_repo_builds.rb new file mode 100644 index 0000000..c80003d --- /dev/null +++ b/spec/support/expected_dependency_trees/remove_repo_builds.rb @@ -0,0 +1,1745 @@ +class ExpectedDependencyTrees + def self.remove_repo_builds + { + _: "id 1, present", + build: [ + { + _: "id 1, removed", + job: [ + { + _: "id 6, removed", + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ] + }, + "id 7, removed" + ], + repository: [ + { + _: "id 20, present", + build: [ + "id 48, present" + ], + request: [ + "id 10, present" + ], + job: [ + "id 49, present" + ], + branch: [ + "id 84, present" + ], + ssl_key: [ + "id 32, present" + ], + commit: [ + "id 216, present" + ], + permission: [ + "id 2, present" + ], + star: [ + "id 2, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" + ] + }, + "id 21, present", + { + _: "id 18, present", + build: [ + "id 46, present" + ], + request: [ + "id 9, present" + ], + job: [ + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 1, present" + ], + star: [ + "id 1, present" + ], + pull_request: [ + "id 1, present" + ], + tag: [ + "id 11, present" + ] + }, + "id 19, present" + ], + tag: [ + { + _: "id 1, present", + build: [ + { + _: "id 8, present", + job: [ + "id 9, present" + ], + repository: [ + "id 3, present", + "id 2, present" + ], + tag: [ + "id 2, present" + ], + branch: [ + "id 73, present" + ], + stage: [ + "id 22, present" + ] + }, + "id 10, present" + ], + commit: [ + { + _: "id 211, present", + build: [ + { + _: "id 11, present", + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ] + }, + "id 13, present" + ], + job: [ + { + _: "id 14, present", + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" + ], + request: [ + { + _: "id 1, present", + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 19, present", + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + build: [ + { + _: "id 16, present", + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" + ] + }, + "id 212, present" + ], + request: [ + { + _: "id 3, present", + abuse: [ + "id 3, present", + "id 4, present" + ], + message: [ + "id 3, present", + "id 4, present" + ], + job: [ + { + _: "id 24, present", + log: [ + "id 7, present", + "id 8, present" + ], + annotation: [ + "id 7, present", + "id 8, present" + ], + queueable_job: [ + "id 7, present", + "id 8, present" + ] + }, + "id 25, present" + ], + build: [ + { + _: "id 21, present", + job: [ + "id 22, present" + ], + repository: [ + "id 9, present", + "id 8, present" + ], + tag: [ + "id 5, present" + ], + branch: [ + "id 76, present" + ], + stage: [ + "id 25, present" + ] + }, + "id 23, present" + ] + }, + "id 4, present" + ] + }, + "id 6, present" + ], + branch: [ + { + _: "id 77, present", + build: [ + { + _: "id 26, present", + job: [ + "id 27, present" + ], + repository: [ + "id 11, present", + "id 10, present" + ], + tag: [ + "id 7, present" + ], + branch: [ + "id 78, present" + ], + stage: [ + "id 26, present" + ] + }, + "id 28, present" + ], + commit: [ + { + _: "id 213, present", + build: [ + { + _: "id 31, present", + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ] + }, + "id 33, present" + ], + job: [ + { + _: "id 34, present", + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" + ], + request: [ + { + _: "id 5, present", + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 39, present", + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + build: [ + { + _: "id 36, present", + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" + ] + }, + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 29, present", + log: [ + "id 9, present", + "id 10, present" + ], + annotation: [ + "id 9, present", + "id 10, present" + ], + queueable_job: [ + "id 9, present", + "id 10, present" + ] + }, + "id 30, present" + ], + request: [ + { + _: "id 7, present", + abuse: [ + "id 7, present", + "id 8, present" + ], + message: [ + "id 7, present", + "id 8, present" + ], + job: [ + { + _: "id 44, present", + log: [ + "id 15, present", + "id 16, present" + ], + annotation: [ + "id 15, present", + "id 16, present" + ], + queueable_job: [ + "id 15, present", + "id 16, present" + ] + }, + "id 45, present" + ], + build: [ + { + _: "id 41, present", + job: [ + "id 42, present" + ], + repository: [ + "id 17, present", + "id 16, present" + ], + tag: [ + "id 10, present" + ], + branch: [ + "id 81, present" + ], + stage: [ + "id 29, present" + ] + }, + "id 43, present" + ] + }, + "id 8, present" + ] + }, + "id 82, present" + ], + stage: [ + { + _: "id 20, removed", + job: [ + "id 2, removed", + "id 3, removed" + ] + }, + { + _: "id 21, removed", + job: [ + "id 4, removed", + "id 5, removed" + ] + } + ] + }, + "id 50, removed", + { + _: "id 161, removed", + job: [ + { + _: "id 166, removed", + log: [ + "id 57, removed", + "id 58, removed" + ], + annotation: [ + "id 57, removed", + "id 58, removed" + ], + queueable_job: [ + "id 57, removed", + "id 58, removed" + ] + }, + "id 167, removed" + ], + stage: [ + { + _: "id 52, removed", + job: [ + "id 162, removed", + "id 163, removed" + ] + }, + { + _: "id 53, removed", + job: [ + "id 164, removed", + "id 165, removed" + ] + } + ] + }, + { + _: "id 168, present", + job: [ + { + _: "id 173, present", + log: [ + "id 59, present", + "id 60, present" + ], + annotation: [ + "id 59, present", + "id 60, present" + ], + queueable_job: [ + "id 59, present", + "id 60, present" + ] + }, + "id 174, present" + ], + stage: [ + { + _: "id 54, present", + job: [ + "id 169, present", + "id 170, present" + ] + }, + { + _: "id 55, present", + job: [ + "id 171, present", + "id 172, present" + ] + } + ] + }, + { + _: "id 175, removed", + job: [ + { + _: "id 180, removed", + log: [ + "id 61, removed", + "id 62, removed" + ], + annotation: [ + "id 61, removed", + "id 62, removed" + ], + queueable_job: [ + "id 61, removed", + "id 62, removed" + ] + }, + "id 181, removed" + ], + repository: [ + "id 1, present, duplicate" + ], + stage: [ + { + _: "id 56, removed", + job: [ + "id 176, removed", + "id 177, removed" + ] + }, + { + _: "id 57, removed", + job: [ + "id 178, removed", + "id 179, removed" + ] + } + ] + } + ], + request: [ + { + _: "id 11, present", + abuse: [ + "id 9, present", + "id 10, present" + ], + message: [ + "id 9, present", + "id 10, present" + ], + job: [ + { + _: "id 54, present", + log: [ + "id 17, present", + "id 18, present" + ], + annotation: [ + "id 17, present", + "id 18, present" + ], + queueable_job: [ + "id 17, present", + "id 18, present" + ] + }, + "id 55, present" + ], + build: [ + { + _: "id 51, present", + job: [ + "id 52, present" + ], + repository: [ + "id 23, present", + "id 22, present" + ], + tag: [ + "id 13, present" + ], + branch: [ + "id 85, present" + ], + stage: [ + "id 30, present" + ] + }, + "id 53, present" + ] + }, + "id 12, present", + "id 35, present", + "id 36, present" + ], + job: [ + { + _: "id 56, present", + log: [ + "id 19, present", + "id 20, present" + ], + annotation: [ + "id 19, present", + "id 20, present" + ], + queueable_job: [ + "id 19, present", + "id 20, present" + ] + }, + "id 57, present" + ], + branch: [ + { + _: "id 86, present", + build: [ + { + _: "id 58, present", + job: [ + "id 59, present" + ], + repository: [ + "id 25, present", + "id 24, present" + ], + tag: [ + "id 14, present" + ], + branch: [ + "id 87, present" + ], + stage: [ + "id 31, present" + ] + }, + "id 60, present" + ], + commit: [ + { + _: "id 217, present", + build: [ + { + _: "id 63, present", + job: [ + "id 64, present" + ], + repository: [ + "id 27, present", + "id 26, present" + ], + tag: [ + "id 15, present" + ], + branch: [ + "id 88, present" + ], + stage: [ + "id 32, present" + ] + }, + "id 65, present" + ], + job: [ + { + _: "id 66, present", + log: [ + "id 23, present", + "id 24, present" + ], + annotation: [ + "id 23, present", + "id 24, present" + ], + queueable_job: [ + "id 23, present", + "id 24, present" + ] + }, + "id 67, present" + ], + request: [ + { + _: "id 13, present", + abuse: [ + "id 11, present", + "id 12, present" + ], + message: [ + "id 11, present", + "id 12, present" + ], + job: [ + { + _: "id 71, present", + log: [ + "id 25, present", + "id 26, present" + ], + annotation: [ + "id 25, present", + "id 26, present" + ], + queueable_job: [ + "id 25, present", + "id 26, present" + ] + }, + "id 72, present" + ], + build: [ + { + _: "id 68, present", + job: [ + "id 69, present" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, present" + ] + }, + "id 70, present" + ] + }, + "id 14, present" + ] + }, + "id 218, present" + ], + cron: [ + "id 3, present", + "id 4, present" + ], + job: [ + { + _: "id 61, present", + log: [ + "id 21, present", + "id 22, present" + ], + annotation: [ + "id 21, present", + "id 22, present" + ], + queueable_job: [ + "id 21, present", + "id 22, present" + ] + }, + "id 62, present" + ], + request: [ + { + _: "id 15, present", + abuse: [ + "id 13, present", + "id 14, present" + ], + message: [ + "id 13, present", + "id 14, present" + ], + job: [ + { + _: "id 76, present", + log: [ + "id 27, present", + "id 28, present" + ], + annotation: [ + "id 27, present", + "id 28, present" + ], + queueable_job: [ + "id 27, present", + "id 28, present" + ] + }, + "id 77, present" + ], + build: [ + { + _: "id 73, present", + job: [ + "id 74, present" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, present" + ] + }, + "id 75, present" + ] + }, + "id 16, present" + ] + }, + "id 91, present" + ], + ssl_key: [ + "id 33, present", + "id 34, present" + ], + commit: [ + { + _: "id 219, present", + build: [ + { + _: "id 78, present", + job: [ + "id 79, present" + ], + repository: [ + "id 33, present", + "id 32, present" + ], + tag: [ + "id 18, present" + ], + branch: [ + "id 92, present" + ], + stage: [ + "id 35, present" + ] + }, + "id 80, present" + ], + job: [ + { + _: "id 81, present", + log: [ + "id 29, present", + "id 30, present" + ], + annotation: [ + "id 29, present", + "id 30, present" + ], + queueable_job: [ + "id 29, present", + "id 30, present" + ] + }, + "id 82, present" + ], + request: [ + { + _: "id 17, present", + abuse: [ + "id 15, present", + "id 16, present" + ], + message: [ + "id 15, present", + "id 16, present" + ], + job: [ + { + _: "id 86, present", + log: [ + "id 31, present", + "id 32, present" + ], + annotation: [ + "id 31, present", + "id 32, present" + ], + queueable_job: [ + "id 31, present", + "id 32, present" + ] + }, + "id 87, present" + ], + build: [ + { + _: "id 83, present", + job: [ + "id 84, present" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, present" + ] + }, + "id 85, present" + ] + }, + "id 18, present" + ] + }, + "id 220, present" + ], + permission: [ + "id 3, present", + "id 4, present" + ], + star: [ + "id 3, present", + "id 4, present" + ], + pull_request: [ + { + _: "id 3, present", + request: [ + { + _: "id 29, present", + abuse: [ + "id 25, present", + "id 26, present" + ], + message: [ + "id 25, present", + "id 26, present" + ], + job: [ + { + _: "id 141, present", + log: [ + "id 49, present", + "id 50, present" + ], + annotation: [ + "id 49, present", + "id 50, present" + ], + queueable_job: [ + "id 49, present", + "id 50, present" + ] + }, + "id 142, present" + ], + build: [ + { + _: "id 138, present", + job: [ + "id 139, present" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, present" + ] + }, + "id 140, present" + ] + }, + "id 30, present" + ], + build: [ + { + _: "id 88, present", + job: [ + { + _: "id 93, present", + log: [ + "id 33, present", + "id 34, present" + ], + annotation: [ + "id 33, present", + "id 34, present" + ], + queueable_job: [ + "id 33, present", + "id 34, present" + ] + }, + "id 94, present" + ], + repository: [ + { + _: "id 54, present", + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 6, present" + ], + star: [ + "id 6, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ] + }, + "id 55, present", + { + _: "id 52, present", + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], + job: [ + "id 134, present" + ], + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 5, present" + ], + star: [ + "id 5, present" + ], + pull_request: [ + "id 4, present" + ], + tag: [ + "id 30, present" + ] + }, + "id 53, present" + ], + tag: [ + { + _: "id 20, present", + build: [ + { + _: "id 95, present", + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ] + }, + "id 97, present" + ], + commit: [ + { + _: "id 221, present", + build: [ + { + _: "id 98, present", + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ] + }, + "id 100, present" + ], + job: [ + { + _: "id 101, present", + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + request: [ + { + _: "id 19, present", + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + _: "id 106, present", + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + build: [ + { + _: "id 103, present", + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" + ], + request: [ + { + _: "id 21, present", + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + _: "id 111, present", + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + build: [ + { + _: "id 108, present", + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" + ] + }, + "id 25, present" + ], + branch: [ + { + _: "id 98, present", + build: [ + { + _: "id 113, present", + job: [ + "id 114, present" + ], + repository: [ + "id 45, present", + "id 44, present" + ], + tag: [ + "id 26, present" + ], + branch: [ + "id 99, present" + ], + stage: [ + "id 43, present" + ] + }, + "id 115, present" + ], + commit: [ + { + _: "id 223, present", + build: [ + { + _: "id 118, present", + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ] + }, + "id 120, present" + ], + job: [ + { + _: "id 121, present", + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + request: [ + { + _: "id 23, present", + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + _: "id 126, present", + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + build: [ + { + _: "id 123, present", + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" + ] + }, + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 116, present", + log: [ + "id 41, present", + "id 42, present" + ], + annotation: [ + "id 41, present", + "id 42, present" + ], + queueable_job: [ + "id 41, present", + "id 42, present" + ] + }, + "id 117, present" + ], + request: [ + { + _: "id 25, present", + abuse: [ + "id 23, present", + "id 24, present" + ], + message: [ + "id 23, present", + "id 24, present" + ], + job: [ + { + _: "id 131, present", + log: [ + "id 47, present", + "id 48, present" + ], + annotation: [ + "id 47, present", + "id 48, present" + ], + queueable_job: [ + "id 47, present", + "id 48, present" + ] + }, + "id 132, present" + ], + build: [ + { + _: "id 128, present", + job: [ + "id 129, present" + ], + repository: [ + "id 51, present", + "id 50, present" + ], + tag: [ + "id 29, present" + ], + branch: [ + "id 102, present" + ], + stage: [ + "id 46, present" + ] + }, + "id 130, present" + ] + }, + "id 26, present" + ] + }, + "id 103, present" + ], + stage: [ + { + _: "id 37, present", + job: [ + "id 89, present", + "id 90, present" + ] + }, + { + _: "id 38, present", + job: [ + "id 91, present", + "id 92, present" + ] + } + ] + }, + "id 137, present" + ] + }, + "id 6, present" + ], + tag: [ + { + _: "id 33, present", + build: [ + { + _: "id 143, present", + job: [ + "id 144, present" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, present" + ] + }, + "id 145, present" + ], + commit: [ + { + _: "id 227, present", + build: [ + { + _: "id 146, present", + job: [ + "id 147, present" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, present" + ] + }, + "id 148, present" + ], + job: [ + { + _: "id 149, present", + log: [ + "id 51, present", + "id 52, present" + ], + annotation: [ + "id 51, present", + "id 52, present" + ], + queueable_job: [ + "id 51, present", + "id 52, present" + ] + }, + "id 150, present" + ], + request: [ + { + _: "id 31, present", + abuse: [ + "id 27, present", + "id 28, present" + ], + message: [ + "id 27, present", + "id 28, present" + ], + job: [ + { + _: "id 154, present", + log: [ + "id 53, present", + "id 54, present" + ], + annotation: [ + "id 53, present", + "id 54, present" + ], + queueable_job: [ + "id 53, present", + "id 54, present" + ] + }, + "id 155, present" + ], + build: [ + { + _: "id 151, present", + job: [ + "id 152, present" + ], + repository: [ + "id 63, present", + "id 62, present" + ], + tag: [ + "id 36, present" + ], + branch: [ + "id 109, present" + ], + stage: [ + "id 50, present" + ] + }, + "id 153, present" + ] + }, + "id 32, present" + ] + }, + "id 228, present" + ], + request: [ + { + _: "id 33, present", + abuse: [ + "id 29, present", + "id 30, present" + ], + message: [ + "id 29, present", + "id 30, present" + ], + job: [ + { + _: "id 159, present", + log: [ + "id 55, present", + "id 56, present" + ], + annotation: [ + "id 55, present", + "id 56, present" + ], + queueable_job: [ + "id 55, present", + "id 56, present" + ] + }, + "id 160, present" + ], + build: [ + { + _: "id 156, present", + job: [ + "id 157, present" + ], + repository: [ + "id 65, present", + "id 64, present" + ], + tag: [ + "id 37, present" + ], + branch: [ + "id 110, present" + ], + stage: [ + "id 51, present" + ] + }, + "id 158, present" + ] + }, + "id 34, present" + ] + }, + "id 38, present" + ] + } + end +end \ No newline at end of file diff --git a/spec/support/expected_dependency_trees/remove_repo_requests.rb b/spec/support/expected_dependency_trees/remove_repo_requests.rb new file mode 100644 index 0000000..4c0d500 --- /dev/null +++ b/spec/support/expected_dependency_trees/remove_repo_requests.rb @@ -0,0 +1,1745 @@ +class ExpectedDependencyTrees + def self.remove_repo_requests + { + "_": "id 1, present", + "build": [ + { + "_": "id 1, present", + "job": [ + { + "_": "id 6, present", + "log": [ + "id 1, present", + "id 2, present" + ], + "annotation": [ + "id 1, present", + "id 2, present" + ], + "queueable_job": [ + "id 1, present", + "id 2, present" + ] + }, + "id 7, present" + ], + "repository": [ + { + "_": "id 20, present", + "build": [ + "id 48, present" + ], + "request": [ + "id 10, present" + ], + "job": [ + "id 49, present" + ], + "branch": [ + "id 84, present" + ], + "ssl_key": [ + "id 32, present" + ], + "commit": [ + "id 216, present" + ], + "permission": [ + "id 2, present" + ], + "star": [ + "id 2, present" + ], + "pull_request": [ + "id 2, present" + ], + "tag": [ + "id 12, present" + ] + }, + "id 21, present", + { + "_": "id 18, present", + "build": [ + "id 46, present" + ], + "request": [ + "id 9, present" + ], + "job": [ + "id 47, present" + ], + "branch": [ + "id 83, present" + ], + "ssl_key": [ + "id 31, present" + ], + "commit": [ + "id 215, present" + ], + "permission": [ + "id 1, present" + ], + "star": [ + "id 1, present" + ], + "pull_request": [ + "id 1, present" + ], + "tag": [ + "id 11, present" + ] + }, + "id 19, present" + ], + "tag": [ + { + "_": "id 1, present", + "build": [ + { + "_": "id 8, present", + "job": [ + "id 9, present" + ], + "repository": [ + "id 3, present", + "id 2, present" + ], + "tag": [ + "id 2, present" + ], + "branch": [ + "id 73, present" + ], + "stage": [ + "id 22, present" + ] + }, + "id 10, present" + ], + "commit": [ + { + "_": "id 211, present", + "build": [ + { + "_": "id 11, present", + "job": [ + "id 12, present" + ], + "repository": [ + "id 5, present", + "id 4, present" + ], + "tag": [ + "id 3, present" + ], + "branch": [ + "id 74, present" + ], + "stage": [ + "id 23, present" + ] + }, + "id 13, present" + ], + "job": [ + { + "_": "id 14, present", + "log": [ + "id 3, present", + "id 4, present" + ], + "annotation": [ + "id 3, present", + "id 4, present" + ], + "queueable_job": [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" + ], + "request": [ + { + "_": "id 1, present", + "abuse": [ + "id 1, present", + "id 2, present" + ], + "message": [ + "id 1, present", + "id 2, present" + ], + "job": [ + { + "_": "id 19, present", + "log": [ + "id 5, present", + "id 6, present" + ], + "annotation": [ + "id 5, present", + "id 6, present" + ], + "queueable_job": [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + "build": [ + { + "_": "id 16, present", + "job": [ + "id 17, present" + ], + "repository": [ + "id 7, present", + "id 6, present" + ], + "tag": [ + "id 4, present" + ], + "branch": [ + "id 75, present" + ], + "stage": [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" + ] + }, + "id 212, present" + ], + "request": [ + { + "_": "id 3, present", + "abuse": [ + "id 3, present", + "id 4, present" + ], + "message": [ + "id 3, present", + "id 4, present" + ], + "job": [ + { + "_": "id 24, present", + "log": [ + "id 7, present", + "id 8, present" + ], + "annotation": [ + "id 7, present", + "id 8, present" + ], + "queueable_job": [ + "id 7, present", + "id 8, present" + ] + }, + "id 25, present" + ], + "build": [ + { + "_": "id 21, present", + "job": [ + "id 22, present" + ], + "repository": [ + "id 9, present", + "id 8, present" + ], + "tag": [ + "id 5, present" + ], + "branch": [ + "id 76, present" + ], + "stage": [ + "id 25, present" + ] + }, + "id 23, present" + ] + }, + "id 4, present" + ] + }, + "id 6, present" + ], + "branch": [ + { + "_": "id 77, present", + "build": [ + { + "_": "id 26, present", + "job": [ + "id 27, present" + ], + "repository": [ + "id 11, present", + "id 10, present" + ], + "tag": [ + "id 7, present" + ], + "branch": [ + "id 78, present" + ], + "stage": [ + "id 26, present" + ] + }, + "id 28, present" + ], + "commit": [ + { + "_": "id 213, present", + "build": [ + { + "_": "id 31, present", + "job": [ + "id 32, present" + ], + "repository": [ + "id 13, present", + "id 12, present" + ], + "tag": [ + "id 8, present" + ], + "branch": [ + "id 79, present" + ], + "stage": [ + "id 27, present" + ] + }, + "id 33, present" + ], + "job": [ + { + "_": "id 34, present", + "log": [ + "id 11, present", + "id 12, present" + ], + "annotation": [ + "id 11, present", + "id 12, present" + ], + "queueable_job": [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" + ], + "request": [ + { + "_": "id 5, present", + "abuse": [ + "id 5, present", + "id 6, present" + ], + "message": [ + "id 5, present", + "id 6, present" + ], + "job": [ + { + "_": "id 39, present", + "log": [ + "id 13, present", + "id 14, present" + ], + "annotation": [ + "id 13, present", + "id 14, present" + ], + "queueable_job": [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + "build": [ + { + "_": "id 36, present", + "job": [ + "id 37, present" + ], + "repository": [ + "id 15, present", + "id 14, present" + ], + "tag": [ + "id 9, present" + ], + "branch": [ + "id 80, present" + ], + "stage": [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" + ] + }, + "id 214, present" + ], + "cron": [ + "id 1, present", + "id 2, present" + ], + "job": [ + { + "_": "id 29, present", + "log": [ + "id 9, present", + "id 10, present" + ], + "annotation": [ + "id 9, present", + "id 10, present" + ], + "queueable_job": [ + "id 9, present", + "id 10, present" + ] + }, + "id 30, present" + ], + "request": [ + { + "_": "id 7, present", + "abuse": [ + "id 7, present", + "id 8, present" + ], + "message": [ + "id 7, present", + "id 8, present" + ], + "job": [ + { + "_": "id 44, present", + "log": [ + "id 15, present", + "id 16, present" + ], + "annotation": [ + "id 15, present", + "id 16, present" + ], + "queueable_job": [ + "id 15, present", + "id 16, present" + ] + }, + "id 45, present" + ], + "build": [ + { + "_": "id 41, present", + "job": [ + "id 42, present" + ], + "repository": [ + "id 17, present", + "id 16, present" + ], + "tag": [ + "id 10, present" + ], + "branch": [ + "id 81, present" + ], + "stage": [ + "id 29, present" + ] + }, + "id 43, present" + ] + }, + "id 8, present" + ] + }, + "id 82, present" + ], + "stage": [ + { + "_": "id 20, present", + "job": [ + "id 2, present", + "id 3, present" + ] + }, + { + "_": "id 21, present", + "job": [ + "id 4, present", + "id 5, present" + ] + } + ] + }, + "id 50, present", + { + "_": "id 161, present", + "job": [ + { + "_": "id 166, present", + "log": [ + "id 57, present", + "id 58, present" + ], + "annotation": [ + "id 57, present", + "id 58, present" + ], + "queueable_job": [ + "id 57, present", + "id 58, present" + ] + }, + "id 167, present" + ], + "stage": [ + { + "_": "id 52, present", + "job": [ + "id 162, present", + "id 163, present" + ] + }, + { + "_": "id 53, present", + "job": [ + "id 164, present", + "id 165, present" + ] + } + ] + }, + { + "_": "id 168, present", + "job": [ + { + "_": "id 173, present", + "log": [ + "id 59, present", + "id 60, present" + ], + "annotation": [ + "id 59, present", + "id 60, present" + ], + "queueable_job": [ + "id 59, present", + "id 60, present" + ] + }, + "id 174, present" + ], + "stage": [ + { + "_": "id 54, present", + "job": [ + "id 169, present", + "id 170, present" + ] + }, + { + "_": "id 55, present", + "job": [ + "id 171, present", + "id 172, present" + ] + } + ] + }, + { + "_": "id 175, present", + "job": [ + { + "_": "id 180, present", + "log": [ + "id 61, present", + "id 62, present" + ], + "annotation": [ + "id 61, present", + "id 62, present" + ], + "queueable_job": [ + "id 61, present", + "id 62, present" + ] + }, + "id 181, present" + ], + "repository": [ + "id 1, present, duplicate" + ], + "stage": [ + { + "_": "id 56, present", + "job": [ + "id 176, present", + "id 177, present" + ] + }, + { + "_": "id 57, present", + "job": [ + "id 178, present", + "id 179, present" + ] + } + ] + } + ], + "request": [ + { + "_": "id 11, removed", + "abuse": [ + "id 9, removed", + "id 10, removed" + ], + "message": [ + "id 9, removed", + "id 10, removed" + ], + "job": [ + { + "_": "id 54, removed", + "log": [ + "id 17, removed", + "id 18, removed" + ], + "annotation": [ + "id 17, removed", + "id 18, removed" + ], + "queueable_job": [ + "id 17, removed", + "id 18, removed" + ] + }, + "id 55, removed" + ], + "build": [ + { + "_": "id 51, removed", + "job": [ + "id 52, removed" + ], + "repository": [ + "id 23, present", + "id 22, present" + ], + "tag": [ + "id 13, present" + ], + "branch": [ + "id 85, present" + ], + "stage": [ + "id 30, removed" + ] + }, + "id 53, removed" + ] + }, + "id 12, removed", + "id 35, removed", + "id 36, present" + ], + "job": [ + { + "_": "id 56, present", + "log": [ + "id 19, present", + "id 20, present" + ], + "annotation": [ + "id 19, present", + "id 20, present" + ], + "queueable_job": [ + "id 19, present", + "id 20, present" + ] + }, + "id 57, present" + ], + "branch": [ + { + "_": "id 86, present", + "build": [ + { + "_": "id 58, present", + "job": [ + "id 59, present" + ], + "repository": [ + "id 25, present", + "id 24, present" + ], + "tag": [ + "id 14, present" + ], + "branch": [ + "id 87, present" + ], + "stage": [ + "id 31, present" + ] + }, + "id 60, present" + ], + "commit": [ + { + "_": "id 217, present", + "build": [ + { + "_": "id 63, present", + "job": [ + "id 64, present" + ], + "repository": [ + "id 27, present", + "id 26, present" + ], + "tag": [ + "id 15, present" + ], + "branch": [ + "id 88, present" + ], + "stage": [ + "id 32, present" + ] + }, + "id 65, present" + ], + "job": [ + { + "_": "id 66, present", + "log": [ + "id 23, present", + "id 24, present" + ], + "annotation": [ + "id 23, present", + "id 24, present" + ], + "queueable_job": [ + "id 23, present", + "id 24, present" + ] + }, + "id 67, present" + ], + "request": [ + { + "_": "id 13, present", + "abuse": [ + "id 11, present", + "id 12, present" + ], + "message": [ + "id 11, present", + "id 12, present" + ], + "job": [ + { + "_": "id 71, present", + "log": [ + "id 25, present", + "id 26, present" + ], + "annotation": [ + "id 25, present", + "id 26, present" + ], + "queueable_job": [ + "id 25, present", + "id 26, present" + ] + }, + "id 72, present" + ], + "build": [ + { + "_": "id 68, present", + "job": [ + "id 69, present" + ], + "repository": [ + "id 29, present", + "id 28, present" + ], + "tag": [ + "id 16, present" + ], + "branch": [ + "id 89, present" + ], + "stage": [ + "id 33, present" + ] + }, + "id 70, present" + ] + }, + "id 14, present" + ] + }, + "id 218, present" + ], + "cron": [ + "id 3, present", + "id 4, present" + ], + "job": [ + { + "_": "id 61, present", + "log": [ + "id 21, present", + "id 22, present" + ], + "annotation": [ + "id 21, present", + "id 22, present" + ], + "queueable_job": [ + "id 21, present", + "id 22, present" + ] + }, + "id 62, present" + ], + "request": [ + { + "_": "id 15, present", + "abuse": [ + "id 13, present", + "id 14, present" + ], + "message": [ + "id 13, present", + "id 14, present" + ], + "job": [ + { + "_": "id 76, present", + "log": [ + "id 27, present", + "id 28, present" + ], + "annotation": [ + "id 27, present", + "id 28, present" + ], + "queueable_job": [ + "id 27, present", + "id 28, present" + ] + }, + "id 77, present" + ], + "build": [ + { + "_": "id 73, present", + "job": [ + "id 74, present" + ], + "repository": [ + "id 31, present", + "id 30, present" + ], + "tag": [ + "id 17, present" + ], + "branch": [ + "id 90, present" + ], + "stage": [ + "id 34, present" + ] + }, + "id 75, present" + ] + }, + "id 16, present" + ] + }, + "id 91, present" + ], + "ssl_key": [ + "id 33, present", + "id 34, present" + ], + "commit": [ + { + "_": "id 219, present", + "build": [ + { + "_": "id 78, present", + "job": [ + "id 79, present" + ], + "repository": [ + "id 33, present", + "id 32, present" + ], + "tag": [ + "id 18, present" + ], + "branch": [ + "id 92, present" + ], + "stage": [ + "id 35, present" + ] + }, + "id 80, present" + ], + "job": [ + { + "_": "id 81, present", + "log": [ + "id 29, present", + "id 30, present" + ], + "annotation": [ + "id 29, present", + "id 30, present" + ], + "queueable_job": [ + "id 29, present", + "id 30, present" + ] + }, + "id 82, present" + ], + "request": [ + { + "_": "id 17, present", + "abuse": [ + "id 15, present", + "id 16, present" + ], + "message": [ + "id 15, present", + "id 16, present" + ], + "job": [ + { + "_": "id 86, present", + "log": [ + "id 31, present", + "id 32, present" + ], + "annotation": [ + "id 31, present", + "id 32, present" + ], + "queueable_job": [ + "id 31, present", + "id 32, present" + ] + }, + "id 87, present" + ], + "build": [ + { + "_": "id 83, present", + "job": [ + "id 84, present" + ], + "repository": [ + "id 35, present", + "id 34, present" + ], + "tag": [ + "id 19, present" + ], + "branch": [ + "id 93, present" + ], + "stage": [ + "id 36, present" + ] + }, + "id 85, present" + ] + }, + "id 18, present" + ] + }, + "id 220, present" + ], + "permission": [ + "id 3, present", + "id 4, present" + ], + "star": [ + "id 3, present", + "id 4, present" + ], + "pull_request": [ + { + "_": "id 3, present", + "request": [ + { + "_": "id 29, present", + "abuse": [ + "id 25, present", + "id 26, present" + ], + "message": [ + "id 25, present", + "id 26, present" + ], + "job": [ + { + "_": "id 141, present", + "log": [ + "id 49, present", + "id 50, present" + ], + "annotation": [ + "id 49, present", + "id 50, present" + ], + "queueable_job": [ + "id 49, present", + "id 50, present" + ] + }, + "id 142, present" + ], + "build": [ + { + "_": "id 138, present", + "job": [ + "id 139, present" + ], + "repository": [ + "id 57, present", + "id 56, present" + ], + "tag": [ + "id 32, present" + ], + "branch": [ + "id 106, present" + ], + "stage": [ + "id 47, present" + ] + }, + "id 140, present" + ] + }, + "id 30, present" + ], + "build": [ + { + "_": "id 88, present", + "job": [ + { + "_": "id 93, present", + "log": [ + "id 33, present", + "id 34, present" + ], + "annotation": [ + "id 33, present", + "id 34, present" + ], + "queueable_job": [ + "id 33, present", + "id 34, present" + ] + }, + "id 94, present" + ], + "repository": [ + { + "_": "id 54, present", + "build": [ + "id 135, present" + ], + "request": [ + "id 28, present" + ], + "job": [ + "id 136, present" + ], + "branch": [ + "id 105, present" + ], + "ssl_key": [ + "id 36, present" + ], + "commit": [ + "id 226, present" + ], + "permission": [ + "id 6, present" + ], + "star": [ + "id 6, present" + ], + "pull_request": [ + "id 5, present" + ], + "tag": [ + "id 31, present" + ] + }, + "id 55, present", + { + "_": "id 52, present", + "build": [ + "id 133, present" + ], + "request": [ + "id 27, present" + ], + "job": [ + "id 134, present" + ], + "branch": [ + "id 104, present" + ], + "ssl_key": [ + "id 35, present" + ], + "commit": [ + "id 225, present" + ], + "permission": [ + "id 5, present" + ], + "star": [ + "id 5, present" + ], + "pull_request": [ + "id 4, present" + ], + "tag": [ + "id 30, present" + ] + }, + "id 53, present" + ], + "tag": [ + { + "_": "id 20, present", + "build": [ + { + "_": "id 95, present", + "job": [ + "id 96, present" + ], + "repository": [ + "id 37, present", + "id 36, present" + ], + "tag": [ + "id 21, present" + ], + "branch": [ + "id 94, present" + ], + "stage": [ + "id 39, present" + ] + }, + "id 97, present" + ], + "commit": [ + { + "_": "id 221, present", + "build": [ + { + "_": "id 98, present", + "job": [ + "id 99, present" + ], + "repository": [ + "id 39, present", + "id 38, present" + ], + "tag": [ + "id 22, present" + ], + "branch": [ + "id 95, present" + ], + "stage": [ + "id 40, present" + ] + }, + "id 100, present" + ], + "job": [ + { + "_": "id 101, present", + "log": [ + "id 35, present", + "id 36, present" + ], + "annotation": [ + "id 35, present", + "id 36, present" + ], + "queueable_job": [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + "request": [ + { + "_": "id 19, present", + "abuse": [ + "id 17, present", + "id 18, present" + ], + "message": [ + "id 17, present", + "id 18, present" + ], + "job": [ + { + "_": "id 106, present", + "log": [ + "id 37, present", + "id 38, present" + ], + "annotation": [ + "id 37, present", + "id 38, present" + ], + "queueable_job": [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + "build": [ + { + "_": "id 103, present", + "job": [ + "id 104, present" + ], + "repository": [ + "id 41, present", + "id 40, present" + ], + "tag": [ + "id 23, present" + ], + "branch": [ + "id 96, present" + ], + "stage": [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" + ], + "request": [ + { + "_": "id 21, present", + "abuse": [ + "id 19, present", + "id 20, present" + ], + "message": [ + "id 19, present", + "id 20, present" + ], + "job": [ + { + "_": "id 111, present", + "log": [ + "id 39, present", + "id 40, present" + ], + "annotation": [ + "id 39, present", + "id 40, present" + ], + "queueable_job": [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + "build": [ + { + "_": "id 108, present", + "job": [ + "id 109, present" + ], + "repository": [ + "id 43, present", + "id 42, present" + ], + "tag": [ + "id 24, present" + ], + "branch": [ + "id 97, present" + ], + "stage": [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" + ] + }, + "id 25, present" + ], + "branch": [ + { + "_": "id 98, present", + "build": [ + { + "_": "id 113, present", + "job": [ + "id 114, present" + ], + "repository": [ + "id 45, present", + "id 44, present" + ], + "tag": [ + "id 26, present" + ], + "branch": [ + "id 99, present" + ], + "stage": [ + "id 43, present" + ] + }, + "id 115, present" + ], + "commit": [ + { + "_": "id 223, present", + "build": [ + { + "_": "id 118, present", + "job": [ + "id 119, present" + ], + "repository": [ + "id 47, present", + "id 46, present" + ], + "tag": [ + "id 27, present" + ], + "branch": [ + "id 100, present" + ], + "stage": [ + "id 44, present" + ] + }, + "id 120, present" + ], + "job": [ + { + "_": "id 121, present", + "log": [ + "id 43, present", + "id 44, present" + ], + "annotation": [ + "id 43, present", + "id 44, present" + ], + "queueable_job": [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + "request": [ + { + "_": "id 23, present", + "abuse": [ + "id 21, present", + "id 22, present" + ], + "message": [ + "id 21, present", + "id 22, present" + ], + "job": [ + { + "_": "id 126, present", + "log": [ + "id 45, present", + "id 46, present" + ], + "annotation": [ + "id 45, present", + "id 46, present" + ], + "queueable_job": [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + "build": [ + { + "_": "id 123, present", + "job": [ + "id 124, present" + ], + "repository": [ + "id 49, present", + "id 48, present" + ], + "tag": [ + "id 28, present" + ], + "branch": [ + "id 101, present" + ], + "stage": [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" + ] + }, + "id 224, present" + ], + "cron": [ + "id 5, present", + "id 6, present" + ], + "job": [ + { + "_": "id 116, present", + "log": [ + "id 41, present", + "id 42, present" + ], + "annotation": [ + "id 41, present", + "id 42, present" + ], + "queueable_job": [ + "id 41, present", + "id 42, present" + ] + }, + "id 117, present" + ], + "request": [ + { + "_": "id 25, present", + "abuse": [ + "id 23, present", + "id 24, present" + ], + "message": [ + "id 23, present", + "id 24, present" + ], + "job": [ + { + "_": "id 131, present", + "log": [ + "id 47, present", + "id 48, present" + ], + "annotation": [ + "id 47, present", + "id 48, present" + ], + "queueable_job": [ + "id 47, present", + "id 48, present" + ] + }, + "id 132, present" + ], + "build": [ + { + "_": "id 128, present", + "job": [ + "id 129, present" + ], + "repository": [ + "id 51, present", + "id 50, present" + ], + "tag": [ + "id 29, present" + ], + "branch": [ + "id 102, present" + ], + "stage": [ + "id 46, present" + ] + }, + "id 130, present" + ] + }, + "id 26, present" + ] + }, + "id 103, present" + ], + "stage": [ + { + "_": "id 37, present", + "job": [ + "id 89, present", + "id 90, present" + ] + }, + { + "_": "id 38, present", + "job": [ + "id 91, present", + "id 92, present" + ] + } + ] + }, + "id 137, present" + ] + }, + "id 6, present" + ], + "tag": [ + { + "_": "id 33, present", + "build": [ + { + "_": "id 143, present", + "job": [ + "id 144, present" + ], + "repository": [ + "id 59, present", + "id 58, present" + ], + "tag": [ + "id 34, present" + ], + "branch": [ + "id 107, present" + ], + "stage": [ + "id 48, present" + ] + }, + "id 145, present" + ], + "commit": [ + { + "_": "id 227, present", + "build": [ + { + "_": "id 146, present", + "job": [ + "id 147, present" + ], + "repository": [ + "id 61, present", + "id 60, present" + ], + "tag": [ + "id 35, present" + ], + "branch": [ + "id 108, present" + ], + "stage": [ + "id 49, present" + ] + }, + "id 148, present" + ], + "job": [ + { + "_": "id 149, present", + "log": [ + "id 51, present", + "id 52, present" + ], + "annotation": [ + "id 51, present", + "id 52, present" + ], + "queueable_job": [ + "id 51, present", + "id 52, present" + ] + }, + "id 150, present" + ], + "request": [ + { + "_": "id 31, present", + "abuse": [ + "id 27, present", + "id 28, present" + ], + "message": [ + "id 27, present", + "id 28, present" + ], + "job": [ + { + "_": "id 154, present", + "log": [ + "id 53, present", + "id 54, present" + ], + "annotation": [ + "id 53, present", + "id 54, present" + ], + "queueable_job": [ + "id 53, present", + "id 54, present" + ] + }, + "id 155, present" + ], + "build": [ + { + "_": "id 151, present", + "job": [ + "id 152, present" + ], + "repository": [ + "id 63, present", + "id 62, present" + ], + "tag": [ + "id 36, present" + ], + "branch": [ + "id 109, present" + ], + "stage": [ + "id 50, present" + ] + }, + "id 153, present" + ] + }, + "id 32, present" + ] + }, + "id 228, present" + ], + "request": [ + { + "_": "id 33, present", + "abuse": [ + "id 29, present", + "id 30, present" + ], + "message": [ + "id 29, present", + "id 30, present" + ], + "job": [ + { + "_": "id 159, present", + "log": [ + "id 55, present", + "id 56, present" + ], + "annotation": [ + "id 55, present", + "id 56, present" + ], + "queueable_job": [ + "id 55, present", + "id 56, present" + ] + }, + "id 160, present" + ], + "build": [ + { + "_": "id 156, present", + "job": [ + "id 157, present" + ], + "repository": [ + "id 65, present", + "id 64, present" + ], + "tag": [ + "id 37, present" + ], + "branch": [ + "id 110, present" + ], + "stage": [ + "id 51, present" + ] + }, + "id 158, present" + ] + }, + "id 34, present" + ] + }, + "id 38, present" + ] + } + end +end \ No newline at end of file diff --git a/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb b/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb index b92675b..06234e1 100644 --- a/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb +++ b/spec/support/expected_dependency_trees/remove_user_with_dependencies.rb @@ -499,2135 +499,2135 @@ def self.remove_user_with_dependencies { _: "id 210, removed", repository: [ - "id 1, removed, duplicate" - ] - }, - { - _: "id 211, removed", - job: [ - { - _: "id 216, removed", - log: [ - "id 73, removed", - "id 74, removed" - ], - annotation: [ - "id 73, removed", - "id 74, removed" - ], - queueable_job: [ - "id 73, removed", - "id 74, removed" - ] - }, - "id 217, removed" - ], - repository: [ - { - _: "id 105, present", - build: [ - "id 258, present" - ], - request: [ - "id 54, present" - ], - job: [ - "id 259, present" - ], - branch: [ - "id 134, present" - ], - ssl_key: [ - "id 40, present" - ], - commit: [ - "id 240, present" - ], - permission: [ - "id 12, present" - ], - star: [ - "id 12, present" - ], - pull_request: [ - "id 10, present" - ], - tag: [ - "id 62, present" - ] - }, - "id 106, present", - { - _: "id 103, present", - build: [ - "id 256, present" - ], - request: [ - "id 53, present" - ], - job: [ - "id 257, present" - ], - branch: [ - "id 133, present" - ], - ssl_key: [ - "id 39, present" - ], - commit: [ - "id 239, present" - ], - permission: [ - "id 11, present" - ], - star: [ - "id 11, present" - ], - pull_request: [ - "id 9, present" - ], - tag: [ - "id 61, present" - ] - }, - "id 104, present" - ], - tag: [ { - _: "id 51, present", + _: "id 1, removed", build: [ { - _: "id 218, present", + _: "id 1, removed", job: [ - "id 219, present" + { + _: "id 6, removed", + log: [ + "id 1, removed", + "id 2, removed" + ], + annotation: [ + "id 1, removed", + "id 2, removed" + ], + queueable_job: [ + "id 1, removed", + "id 2, removed" + ] + }, + "id 7, removed" ], repository: [ - "id 88, present", - "id 87, present" - ], - tag: [ - "id 52, present" - ], - branch: [ - "id 123, present" - ], - stage: [ - "id 64, present" - ] - }, - "id 220, present" - ], - commit: [ - { - _: "id 235, present", - build: [ { - _: "id 221, present", - job: [ - "id 222, present" + _: "id 20, present", + build: [ + "id 48, present" ], - repository: [ - "id 90, present", - "id 89, present" + request: [ + "id 10, present" ], - tag: [ - "id 53, present" + job: [ + "id 49, present" ], branch: [ - "id 124, present" + "id 84, present" ], - stage: [ - "id 65, present" - ] - }, - "id 223, present" - ], - job: [ - { - _: "id 224, present", - log: [ - "id 75, present", - "id 76, present" + ssl_key: [ + "id 32, present" ], - annotation: [ - "id 75, present", - "id 76, present" + commit: [ + "id 216, present" ], - queueable_job: [ - "id 75, present", - "id 76, present" + permission: [ + "id 4, present" + ], + star: [ + "id 4, present" + ], + pull_request: [ + "id 2, present" + ], + tag: [ + "id 12, present" ] }, - "id 225, present" - ], - request: [ + "id 21, present", { - _: "id 45, present", - abuse: [ - "id 39, present", - "id 40, present" + _: "id 18, present", + build: [ + "id 46, present" ], - message: [ - "id 39, present", - "id 40, present" + request: [ + "id 9, present" ], job: [ - { - _: "id 229, present", - log: [ - "id 77, present", - "id 78, present" - ], - annotation: [ - "id 77, present", - "id 78, present" - ], - queueable_job: [ - "id 77, present", - "id 78, present" - ] - }, - "id 230, present" + "id 47, present" + ], + branch: [ + "id 83, present" + ], + ssl_key: [ + "id 31, present" + ], + commit: [ + "id 215, present" + ], + permission: [ + "id 3, present" + ], + star: [ + "id 3, present" + ], + pull_request: [ + "id 1, present" ], + tag: [ + "id 11, present" + ] + }, + "id 19, present" + ], + tag: [ + { + _: "id 1, present", build: [ { - _: "id 226, present", + _: "id 8, present", job: [ - "id 227, present" + "id 9, present" ], repository: [ - "id 92, present", - "id 91, present" + "id 3, present", + "id 2, present" ], tag: [ - "id 54, present" + "id 2, present" ], branch: [ - "id 125, present" + "id 73, present" ], stage: [ - "id 66, present" + "id 22, present" ] }, - "id 228, present" - ] - }, - "id 46, present" - ] - }, - "id 236, present" - ], - request: [ - { - _: "id 47, present", - abuse: [ - "id 41, present", - "id 42, present" - ], - message: [ - "id 41, present", - "id 42, present" - ], - job: [ - { - _: "id 234, present", - log: [ - "id 79, present", - "id 80, present" - ], - annotation: [ - "id 79, present", - "id 80, present" - ], - queueable_job: [ - "id 79, present", - "id 80, present" - ] - }, - "id 235, present" - ], - build: [ - { - _: "id 231, present", - job: [ - "id 232, present" - ], - repository: [ - "id 94, present", - "id 93, present" - ], - tag: [ - "id 55, present" - ], - branch: [ - "id 126, present" - ], - stage: [ - "id 67, present" - ] - }, - "id 233, present" - ] - }, - "id 48, present" - ] - }, - "id 56, present" - ], - branch: [ - { - _: "id 127, present", - build: [ - { - _: "id 236, present", - job: [ - "id 237, present" - ], - repository: [ - "id 96, present", - "id 95, present" - ], - tag: [ - "id 57, present" - ], - branch: [ - "id 128, present" - ], - stage: [ - "id 68, present" - ] - }, - "id 238, present" - ], - commit: [ - { - _: "id 237, present", - build: [ - { - _: "id 241, present", - job: [ - "id 242, present" - ], - repository: [ - "id 98, present", - "id 97, present" - ], - tag: [ - "id 58, present" - ], - branch: [ - "id 129, present" - ], - stage: [ - "id 69, present" - ] - }, - "id 243, present" - ], - job: [ - { - _: "id 244, present", - log: [ - "id 83, present", - "id 84, present" - ], - annotation: [ - "id 83, present", - "id 84, present" - ], - queueable_job: [ - "id 83, present", - "id 84, present" - ] - }, - "id 245, present" - ], - request: [ - { - _: "id 49, present", - abuse: [ - "id 43, present", - "id 44, present" - ], - message: [ - "id 43, present", - "id 44, present" - ], - job: [ - { - _: "id 249, present", - log: [ - "id 85, present", - "id 86, present" - ], - annotation: [ - "id 85, present", - "id 86, present" - ], - queueable_job: [ - "id 85, present", - "id 86, present" - ] - }, - "id 250, present" - ], - build: [ - { - _: "id 246, present", - job: [ - "id 247, present" - ], - repository: [ - "id 100, present", - "id 99, present" - ], - tag: [ - "id 59, present" - ], - branch: [ - "id 130, present" - ], - stage: [ - "id 70, present" - ] - }, - "id 248, present" - ] - }, - "id 50, present" - ] - }, - "id 238, present" - ], - cron: [ - "id 9, present", - "id 10, present" - ], - job: [ - { - _: "id 239, present", - log: [ - "id 81, present", - "id 82, present" - ], - annotation: [ - "id 81, present", - "id 82, present" - ], - queueable_job: [ - "id 81, present", - "id 82, present" - ] - }, - "id 240, present" - ], - request: [ - { - _: "id 51, present", - abuse: [ - "id 45, present", - "id 46, present" - ], - message: [ - "id 45, present", - "id 46, present" - ], - job: [ - { - _: "id 254, present", - log: [ - "id 87, present", - "id 88, present" - ], - annotation: [ - "id 87, present", - "id 88, present" - ], - queueable_job: [ - "id 87, present", - "id 88, present" - ] - }, - "id 255, present" - ], - build: [ - { - _: "id 251, present", - job: [ - "id 252, present" - ], - repository: [ - "id 102, present", - "id 101, present" - ], - tag: [ - "id 60, present" - ], - branch: [ - "id 131, present" - ], - stage: [ - "id 71, present" - ] - }, - "id 253, present" - ] - }, - "id 52, present" - ] - }, - "id 132, present" - ], - stage: [ - { - _: "id 62, removed", - job: [ - "id 212, removed", - "id 213, removed" - ] - }, - { - _: "id 63, removed", - job: [ - "id 214, removed", - "id 215, removed" - ] - } - ] - }, - { - _: "id 260, removed", - repository: [ - "id 1, removed, duplicate" - ] - } - ], - repository: [ - { - _: "id 1, removed", - build: [ - { - _: "id 1, removed", - job: [ - { - _: "id 6, removed", - log: [ - "id 1, removed", - "id 2, removed" - ], - annotation: [ - "id 1, removed", - "id 2, removed" - ], - queueable_job: [ - "id 1, removed", - "id 2, removed" - ] - }, - "id 7, removed" - ], - repository: [ - { - _: "id 20, present", - build: [ - "id 48, present" - ], - request: [ - "id 10, present" - ], - job: [ - "id 49, present" - ], - branch: [ - "id 84, present" - ], - ssl_key: [ - "id 32, present" - ], - commit: [ - "id 216, present" - ], - permission: [ - "id 4, present" - ], - star: [ - "id 4, present" - ], - pull_request: [ - "id 2, present" - ], - tag: [ - "id 12, present" - ] - }, - "id 21, present", - { - _: "id 18, present", - build: [ - "id 46, present" - ], - request: [ - "id 9, present" - ], - job: [ - "id 47, present" - ], - branch: [ - "id 83, present" - ], - ssl_key: [ - "id 31, present" - ], - commit: [ - "id 215, present" - ], - permission: [ - "id 3, present" - ], - star: [ - "id 3, present" - ], - pull_request: [ - "id 1, present" - ], - tag: [ - "id 11, present" - ] - }, - "id 19, present" - ], - tag: [ - { - _: "id 1, present", - build: [ - { - _: "id 8, present", - job: [ - "id 9, present" - ], - repository: [ - "id 3, present", - "id 2, present" - ], - tag: [ - "id 2, present" - ], - branch: [ - "id 73, present" - ], - stage: [ - "id 22, present" - ] - }, - "id 10, present" - ], - commit: [ - { - _: "id 211, present", - build: [ - { - _: "id 11, present", - job: [ - "id 12, present" - ], - repository: [ - "id 5, present", - "id 4, present" - ], - tag: [ - "id 3, present" - ], - branch: [ - "id 74, present" - ], - stage: [ - "id 23, present" - ] - }, - "id 13, present" + "id 10, present" ], - job: [ + commit: [ { - _: "id 14, present", - log: [ - "id 3, present", - "id 4, present" + _: "id 211, present", + build: [ + { + _: "id 11, present", + job: [ + "id 12, present" + ], + repository: [ + "id 5, present", + "id 4, present" + ], + tag: [ + "id 3, present" + ], + branch: [ + "id 74, present" + ], + stage: [ + "id 23, present" + ] + }, + "id 13, present" ], - annotation: [ - "id 3, present", - "id 4, present" + job: [ + { + _: "id 14, present", + log: [ + "id 3, present", + "id 4, present" + ], + annotation: [ + "id 3, present", + "id 4, present" + ], + queueable_job: [ + "id 3, present", + "id 4, present" + ] + }, + "id 15, present" ], - queueable_job: [ - "id 3, present", - "id 4, present" + request: [ + { + _: "id 1, present", + abuse: [ + "id 1, present", + "id 2, present" + ], + message: [ + "id 1, present", + "id 2, present" + ], + job: [ + { + _: "id 19, present", + log: [ + "id 5, present", + "id 6, present" + ], + annotation: [ + "id 5, present", + "id 6, present" + ], + queueable_job: [ + "id 5, present", + "id 6, present" + ] + }, + "id 20, present" + ], + build: [ + { + _: "id 16, present", + job: [ + "id 17, present" + ], + repository: [ + "id 7, present", + "id 6, present" + ], + tag: [ + "id 4, present" + ], + branch: [ + "id 75, present" + ], + stage: [ + "id 24, present" + ] + }, + "id 18, present" + ] + }, + "id 2, present" ] }, - "id 15, present" + "id 212, present" ], request: [ { - _: "id 1, present", + _: "id 3, present", abuse: [ - "id 1, present", - "id 2, present" + "id 3, present", + "id 4, present" ], message: [ - "id 1, present", - "id 2, present" + "id 3, present", + "id 4, present" ], job: [ { - _: "id 19, present", + _: "id 24, present", log: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], annotation: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], queueable_job: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ] }, - "id 20, present" + "id 25, present" ], build: [ { - _: "id 16, present", + _: "id 21, present", job: [ - "id 17, present" + "id 22, present" ], repository: [ - "id 7, present", - "id 6, present" + "id 9, present", + "id 8, present" ], tag: [ - "id 4, present" + "id 5, present" ], branch: [ - "id 75, present" + "id 76, present" ], stage: [ - "id 24, present" + "id 25, present" ] }, - "id 18, present" + "id 23, present" ] }, - "id 2, present" + "id 4, present" ] }, - "id 212, present" + "id 6, present" ], - request: [ + branch: [ { - _: "id 3, present", - abuse: [ - "id 3, present", - "id 4, present" - ], - message: [ - "id 3, present", - "id 4, present" - ], - job: [ - { - _: "id 24, present", - log: [ - "id 7, present", - "id 8, present" - ], - annotation: [ - "id 7, present", - "id 8, present" - ], - queueable_job: [ - "id 7, present", - "id 8, present" - ] - }, - "id 25, present" - ], + _: "id 77, present", build: [ { - _: "id 21, present", + _: "id 26, present", job: [ - "id 22, present" + "id 27, present" ], repository: [ - "id 9, present", - "id 8, present" + "id 11, present", + "id 10, present" ], tag: [ - "id 5, present" + "id 7, present" ], branch: [ - "id 76, present" + "id 78, present" ], stage: [ - "id 25, present" + "id 26, present" ] }, - "id 23, present" - ] - }, - "id 4, present" - ] - }, - "id 6, present" - ], - branch: [ - { - _: "id 77, present", - build: [ - { - _: "id 26, present", - job: [ - "id 27, present" - ], - repository: [ - "id 11, present", - "id 10, present" - ], - tag: [ - "id 7, present" - ], - branch: [ - "id 78, present" + "id 28, present" ], - stage: [ - "id 26, present" - ] - }, - "id 28, present" - ], - commit: [ - { - _: "id 213, present", - build: [ + commit: [ { - _: "id 31, present", - job: [ - "id 32, present" - ], - repository: [ - "id 13, present", - "id 12, present" - ], - tag: [ - "id 8, present" + _: "id 213, present", + build: [ + { + _: "id 31, present", + job: [ + "id 32, present" + ], + repository: [ + "id 13, present", + "id 12, present" + ], + tag: [ + "id 8, present" + ], + branch: [ + "id 79, present" + ], + stage: [ + "id 27, present" + ] + }, + "id 33, present" ], - branch: [ - "id 79, present" + job: [ + { + _: "id 34, present", + log: [ + "id 11, present", + "id 12, present" + ], + annotation: [ + "id 11, present", + "id 12, present" + ], + queueable_job: [ + "id 11, present", + "id 12, present" + ] + }, + "id 35, present" ], - stage: [ - "id 27, present" + request: [ + { + _: "id 5, present", + abuse: [ + "id 5, present", + "id 6, present" + ], + message: [ + "id 5, present", + "id 6, present" + ], + job: [ + { + _: "id 39, present", + log: [ + "id 13, present", + "id 14, present" + ], + annotation: [ + "id 13, present", + "id 14, present" + ], + queueable_job: [ + "id 13, present", + "id 14, present" + ] + }, + "id 40, present" + ], + build: [ + { + _: "id 36, present", + job: [ + "id 37, present" + ], + repository: [ + "id 15, present", + "id 14, present" + ], + tag: [ + "id 9, present" + ], + branch: [ + "id 80, present" + ], + stage: [ + "id 28, present" + ] + }, + "id 38, present" + ] + }, + "id 6, present" ] }, - "id 33, present" + "id 214, present" + ], + cron: [ + "id 1, present", + "id 2, present" ], job: [ { - _: "id 34, present", + _: "id 29, present", log: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ], annotation: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ], queueable_job: [ - "id 11, present", - "id 12, present" + "id 9, present", + "id 10, present" ] }, - "id 35, present" + "id 30, present" ], request: [ { - _: "id 5, present", + _: "id 7, present", abuse: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], message: [ - "id 5, present", - "id 6, present" + "id 7, present", + "id 8, present" ], job: [ { - _: "id 39, present", + _: "id 44, present", log: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ], annotation: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ], queueable_job: [ - "id 13, present", - "id 14, present" + "id 15, present", + "id 16, present" ] }, - "id 40, present" + "id 45, present" ], build: [ { - _: "id 36, present", + _: "id 41, present", job: [ - "id 37, present" + "id 42, present" ], repository: [ - "id 15, present", - "id 14, present" + "id 17, present", + "id 16, present" ], tag: [ - "id 9, present" + "id 10, present" ], branch: [ - "id 80, present" + "id 81, present" ], stage: [ - "id 28, present" + "id 29, present" ] }, - "id 38, present" + "id 43, present" ] }, - "id 6, present" + "id 8, present" ] }, - "id 214, present" + "id 82, present" ], - cron: [ - "id 1, present", - "id 2, present" + stage: [ + { + _: "id 20, removed", + job: [ + "id 2, removed", + "id 3, removed" + ] + }, + { + _: "id 21, removed", + job: [ + "id 4, removed", + "id 5, removed" + ] + } + ] + }, + "id 50, removed" + ], + request: [ + { + _: "id 11, removed", + abuse: [ + "id 9, removed", + "id 10, removed" + ], + message: [ + "id 9, removed", + "id 10, removed" ], job: [ { - _: "id 29, present", + _: "id 54, removed", log: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ], annotation: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ], queueable_job: [ - "id 9, present", - "id 10, present" + "id 17, removed", + "id 18, removed" ] }, - "id 30, present" + "id 55, removed" ], - request: [ + build: [ { - _: "id 7, present", - abuse: [ - "id 7, present", - "id 8, present" + _: "id 51, removed", + job: [ + "id 52, removed" ], - message: [ - "id 7, present", - "id 8, present" + repository: [ + "id 23, present", + "id 22, present" ], - job: [ - { - _: "id 44, present", - log: [ - "id 15, present", - "id 16, present" - ], - annotation: [ - "id 15, present", - "id 16, present" - ], - queueable_job: [ - "id 15, present", - "id 16, present" - ] - }, - "id 45, present" + tag: [ + "id 13, present" ], - build: [ - { - _: "id 41, present", - job: [ - "id 42, present" - ], - repository: [ - "id 17, present", - "id 16, present" - ], - tag: [ - "id 10, present" - ], - branch: [ - "id 81, present" - ], - stage: [ - "id 29, present" - ] - }, - "id 43, present" + branch: [ + "id 85, present" + ], + stage: [ + "id 30, removed" ] }, - "id 8, present" - ] - }, - "id 82, present" - ], - stage: [ - { - _: "id 20, removed", - job: [ - "id 2, removed", - "id 3, removed" + "id 53, removed" ] }, - { - _: "id 21, removed", - job: [ - "id 4, removed", - "id 5, removed" - ] - } - ] - }, - "id 50, removed" - ], - request: [ - { - _: "id 11, removed", - abuse: [ - "id 9, removed", - "id 10, removed" - ], - message: [ - "id 9, removed", - "id 10, removed" + "id 12, removed" ], job: [ { - _: "id 54, removed", + _: "id 56, removed", log: [ - "id 17, removed", - "id 18, removed" + "id 19, removed", + "id 20, removed" ], annotation: [ - "id 17, removed", - "id 18, removed" + "id 19, removed", + "id 20, removed" ], queueable_job: [ - "id 17, removed", - "id 18, removed" - ] - }, - "id 55, removed" - ], - build: [ - { - _: "id 51, removed", - job: [ - "id 52, removed" - ], - repository: [ - "id 23, present", - "id 22, present" - ], - tag: [ - "id 13, present" - ], - branch: [ - "id 85, present" - ], - stage: [ - "id 30, removed" - ] - }, - "id 53, removed" - ] - }, - "id 12, removed" - ], - job: [ - { - _: "id 56, removed", - log: [ - "id 19, removed", - "id 20, removed" - ], - annotation: [ - "id 19, removed", - "id 20, removed" - ], - queueable_job: [ - "id 19, removed", - "id 20, removed" - ] - }, - "id 57, removed" - ], - branch: [ - { - _: "id 86, removed", - build: [ - { - _: "id 58, removed", - job: [ - "id 59, removed" - ], - repository: [ - "id 25, present", - "id 24, present" - ], - tag: [ - "id 14, present" - ], - branch: [ - "id 87, present" - ], - stage: [ - "id 31, removed" + "id 19, removed", + "id 20, removed" ] }, - "id 60, removed" + "id 57, removed" ], - commit: [ + branch: [ { - _: "id 217, removed", + _: "id 86, removed", build: [ { - _: "id 63, removed", + _: "id 58, removed", job: [ - "id 64, removed" + "id 59, removed" ], repository: [ - "id 27, present", - "id 26, present" + "id 25, present", + "id 24, present" ], tag: [ - "id 15, present" + "id 14, present" ], branch: [ - "id 88, present" + "id 87, present" ], stage: [ - "id 32, removed" - ] - }, - "id 65, removed" - ], - job: [ - { - _: "id 66, removed", - log: [ - "id 23, removed", - "id 24, removed" - ], - annotation: [ - "id 23, removed", - "id 24, removed" - ], - queueable_job: [ - "id 23, removed", - "id 24, removed" + "id 31, removed" ] }, - "id 67, removed" + "id 60, removed" ], - request: [ + commit: [ { - _: "id 13, removed", - abuse: [ - "id 11, removed", - "id 12, removed" - ], - message: [ - "id 11, removed", - "id 12, removed" - ], - job: [ - { - _: "id 71, removed", - log: [ - "id 25, removed", - "id 26, removed" - ], - annotation: [ - "id 25, removed", - "id 26, removed" - ], - queueable_job: [ - "id 25, removed", - "id 26, removed" - ] - }, - "id 72, removed" - ], + _: "id 217, removed", build: [ { - _: "id 68, removed", + _: "id 63, removed", job: [ - "id 69, removed" + "id 64, removed" ], repository: [ - "id 29, present", - "id 28, present" + "id 27, present", + "id 26, present" ], tag: [ - "id 16, present" + "id 15, present" ], branch: [ - "id 89, present" + "id 88, present" ], stage: [ - "id 33, removed" + "id 32, removed" ] }, - "id 70, removed" - ] - }, - "id 14, removed" - ] - }, - "id 218, removed" - ], - cron: [ - "id 3, removed", - "id 4, removed" - ], - job: [ - { - _: "id 61, removed", - log: [ - "id 21, removed", - "id 22, removed" - ], - annotation: [ - "id 21, removed", - "id 22, removed" - ], - queueable_job: [ - "id 21, removed", - "id 22, removed" - ] - }, - "id 62, removed" - ], - request: [ - { - _: "id 15, removed", - abuse: [ - "id 13, removed", - "id 14, removed" - ], - message: [ - "id 13, removed", - "id 14, removed" - ], - job: [ - { - _: "id 76, removed", - log: [ - "id 27, removed", - "id 28, removed" - ], - annotation: [ - "id 27, removed", - "id 28, removed" + "id 65, removed" ], - queueable_job: [ - "id 27, removed", - "id 28, removed" - ] - }, - "id 77, removed" - ], - build: [ - { - _: "id 73, removed", job: [ - "id 74, removed" - ], - repository: [ - "id 31, present", - "id 30, present" - ], - tag: [ - "id 17, present" - ], - branch: [ - "id 90, present" + { + _: "id 66, removed", + log: [ + "id 23, removed", + "id 24, removed" + ], + annotation: [ + "id 23, removed", + "id 24, removed" + ], + queueable_job: [ + "id 23, removed", + "id 24, removed" + ] + }, + "id 67, removed" ], - stage: [ - "id 34, removed" + request: [ + { + _: "id 13, removed", + abuse: [ + "id 11, removed", + "id 12, removed" + ], + message: [ + "id 11, removed", + "id 12, removed" + ], + job: [ + { + _: "id 71, removed", + log: [ + "id 25, removed", + "id 26, removed" + ], + annotation: [ + "id 25, removed", + "id 26, removed" + ], + queueable_job: [ + "id 25, removed", + "id 26, removed" + ] + }, + "id 72, removed" + ], + build: [ + { + _: "id 68, removed", + job: [ + "id 69, removed" + ], + repository: [ + "id 29, present", + "id 28, present" + ], + tag: [ + "id 16, present" + ], + branch: [ + "id 89, present" + ], + stage: [ + "id 33, removed" + ] + }, + "id 70, removed" + ] + }, + "id 14, removed" ] }, - "id 75, removed" - ] - }, - "id 16, removed" - ] - }, - "id 91, removed" - ], - ssl_key: [ - "id 33, removed", - "id 34, removed" - ], - commit: [ - { - _: "id 219, removed", - build: [ - { - _: "id 78, removed", - job: [ - "id 79, removed" - ], - repository: [ - "id 33, present", - "id 32, present" - ], - tag: [ - "id 18, present" - ], - branch: [ - "id 92, present" - ], - stage: [ - "id 35, removed" - ] - }, - "id 80, removed" - ], - job: [ - { - _: "id 81, removed", - log: [ - "id 29, removed", - "id 30, removed" - ], - annotation: [ - "id 29, removed", - "id 30, removed" - ], - queueable_job: [ - "id 29, removed", - "id 30, removed" - ] - }, - "id 82, removed" - ], - request: [ - { - _: "id 17, removed", - abuse: [ - "id 15, removed", - "id 16, removed" + "id 218, removed" ], - message: [ - "id 15, removed", - "id 16, removed" + cron: [ + "id 3, removed", + "id 4, removed" ], job: [ { - _: "id 86, removed", + _: "id 61, removed", log: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ], annotation: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ], queueable_job: [ - "id 31, removed", - "id 32, removed" + "id 21, removed", + "id 22, removed" ] }, - "id 87, removed" + "id 62, removed" ], - build: [ + request: [ { - _: "id 83, removed", - job: [ - "id 84, removed" - ], - repository: [ - "id 35, present", - "id 34, present" + _: "id 15, removed", + abuse: [ + "id 13, removed", + "id 14, removed" ], - tag: [ - "id 19, present" + message: [ + "id 13, removed", + "id 14, removed" ], - branch: [ - "id 93, present" + job: [ + { + _: "id 76, removed", + log: [ + "id 27, removed", + "id 28, removed" + ], + annotation: [ + "id 27, removed", + "id 28, removed" + ], + queueable_job: [ + "id 27, removed", + "id 28, removed" + ] + }, + "id 77, removed" ], - stage: [ - "id 36, removed" + build: [ + { + _: "id 73, removed", + job: [ + "id 74, removed" + ], + repository: [ + "id 31, present", + "id 30, present" + ], + tag: [ + "id 17, present" + ], + branch: [ + "id 90, present" + ], + stage: [ + "id 34, removed" + ] + }, + "id 75, removed" ] }, - "id 85, removed" + "id 16, removed" ] }, - "id 18, removed" - ] - }, - "id 220, removed" - ], - permission: [ - "id 5, removed", - "id 6, removed" - ], - star: [ - "id 5, removed", - "id 6, removed" - ], - pull_request: [ - { - _: "id 3, removed", - request: [ + "id 91, removed" + ], + ssl_key: [ + "id 33, removed", + "id 34, removed" + ], + commit: [ { - _: "id 29, removed", - abuse: [ - "id 25, removed", - "id 26, removed" - ], - message: [ - "id 25, removed", - "id 26, removed" - ], - job: [ - { - _: "id 141, removed", - log: [ - "id 49, removed", - "id 50, removed" - ], - annotation: [ - "id 49, removed", - "id 50, removed" - ], - queueable_job: [ - "id 49, removed", - "id 50, removed" - ] - }, - "id 142, removed" - ], + _: "id 219, removed", build: [ { - _: "id 138, removed", + _: "id 78, removed", job: [ - "id 139, removed" + "id 79, removed" ], repository: [ - "id 57, present", - "id 56, present" + "id 33, present", + "id 32, present" ], tag: [ - "id 32, present" + "id 18, present" ], branch: [ - "id 106, present" + "id 92, present" ], stage: [ - "id 47, removed" + "id 35, removed" ] }, - "id 140, removed" - ] - }, - "id 30, removed" - ], - build: [ - { - _: "id 88, removed", + "id 80, removed" + ], job: [ { - _: "id 93, removed", + _: "id 81, removed", log: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ], annotation: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ], queueable_job: [ - "id 33, removed", - "id 34, removed" + "id 29, removed", + "id 30, removed" ] }, - "id 94, removed" + "id 82, removed" ], - repository: [ + request: [ { - _: "id 54, present", - build: [ - "id 135, present" + _: "id 17, removed", + abuse: [ + "id 15, removed", + "id 16, removed" ], - request: [ - "id 28, present" + message: [ + "id 15, removed", + "id 16, removed" ], job: [ - "id 136, present" - ], - branch: [ - "id 105, present" - ], - ssl_key: [ - "id 36, present" - ], - commit: [ - "id 226, present" - ], - permission: [ - "id 8, present" - ], - star: [ - "id 8, present" - ], - pull_request: [ - "id 5, present" + { + _: "id 86, removed", + log: [ + "id 31, removed", + "id 32, removed" + ], + annotation: [ + "id 31, removed", + "id 32, removed" + ], + queueable_job: [ + "id 31, removed", + "id 32, removed" + ] + }, + "id 87, removed" ], - tag: [ - "id 31, present" + build: [ + { + _: "id 83, removed", + job: [ + "id 84, removed" + ], + repository: [ + "id 35, present", + "id 34, present" + ], + tag: [ + "id 19, present" + ], + branch: [ + "id 93, present" + ], + stage: [ + "id 36, removed" + ] + }, + "id 85, removed" ] }, - "id 55, present", + "id 18, removed" + ] + }, + "id 220, removed" + ], + permission: [ + "id 5, removed", + "id 6, removed" + ], + star: [ + "id 5, removed", + "id 6, removed" + ], + pull_request: [ + { + _: "id 3, removed", + request: [ { - _: "id 52, present", - build: [ - "id 133, present" + _: "id 29, removed", + abuse: [ + "id 25, removed", + "id 26, removed" ], - request: [ - "id 27, present" + message: [ + "id 25, removed", + "id 26, removed" ], job: [ - "id 134, present" - ], - branch: [ - "id 104, present" - ], - ssl_key: [ - "id 35, present" - ], - commit: [ - "id 225, present" - ], - permission: [ - "id 7, present" - ], - star: [ - "id 7, present" - ], - pull_request: [ - "id 4, present" + { + _: "id 141, removed", + log: [ + "id 49, removed", + "id 50, removed" + ], + annotation: [ + "id 49, removed", + "id 50, removed" + ], + queueable_job: [ + "id 49, removed", + "id 50, removed" + ] + }, + "id 142, removed" ], - tag: [ - "id 30, present" + build: [ + { + _: "id 138, removed", + job: [ + "id 139, removed" + ], + repository: [ + "id 57, present", + "id 56, present" + ], + tag: [ + "id 32, present" + ], + branch: [ + "id 106, present" + ], + stage: [ + "id 47, removed" + ] + }, + "id 140, removed" ] }, - "id 53, present" + "id 30, removed" ], - tag: [ + build: [ { - _: "id 20, present", - build: [ + _: "id 88, removed", + job: [ + { + _: "id 93, removed", + log: [ + "id 33, removed", + "id 34, removed" + ], + annotation: [ + "id 33, removed", + "id 34, removed" + ], + queueable_job: [ + "id 33, removed", + "id 34, removed" + ] + }, + "id 94, removed" + ], + repository: [ + { + _: "id 54, present", + build: [ + "id 135, present" + ], + request: [ + "id 28, present" + ], + job: [ + "id 136, present" + ], + branch: [ + "id 105, present" + ], + ssl_key: [ + "id 36, present" + ], + commit: [ + "id 226, present" + ], + permission: [ + "id 8, present" + ], + star: [ + "id 8, present" + ], + pull_request: [ + "id 5, present" + ], + tag: [ + "id 31, present" + ] + }, + "id 55, present", { - _: "id 95, present", + _: "id 52, present", + build: [ + "id 133, present" + ], + request: [ + "id 27, present" + ], job: [ - "id 96, present" + "id 134, present" ], - repository: [ - "id 37, present", - "id 36, present" + branch: [ + "id 104, present" + ], + ssl_key: [ + "id 35, present" + ], + commit: [ + "id 225, present" + ], + permission: [ + "id 7, present" + ], + star: [ + "id 7, present" + ], + pull_request: [ + "id 4, present" ], tag: [ - "id 21, present" + "id 30, present" + ] + }, + "id 53, present" + ], + tag: [ + { + _: "id 20, present", + build: [ + { + _: "id 95, present", + job: [ + "id 96, present" + ], + repository: [ + "id 37, present", + "id 36, present" + ], + tag: [ + "id 21, present" + ], + branch: [ + "id 94, present" + ], + stage: [ + "id 39, present" + ] + }, + "id 97, present" ], - branch: [ - "id 94, present" + commit: [ + { + _: "id 221, present", + build: [ + { + _: "id 98, present", + job: [ + "id 99, present" + ], + repository: [ + "id 39, present", + "id 38, present" + ], + tag: [ + "id 22, present" + ], + branch: [ + "id 95, present" + ], + stage: [ + "id 40, present" + ] + }, + "id 100, present" + ], + job: [ + { + _: "id 101, present", + log: [ + "id 35, present", + "id 36, present" + ], + annotation: [ + "id 35, present", + "id 36, present" + ], + queueable_job: [ + "id 35, present", + "id 36, present" + ] + }, + "id 102, present" + ], + request: [ + { + _: "id 19, present", + abuse: [ + "id 17, present", + "id 18, present" + ], + message: [ + "id 17, present", + "id 18, present" + ], + job: [ + { + _: "id 106, present", + log: [ + "id 37, present", + "id 38, present" + ], + annotation: [ + "id 37, present", + "id 38, present" + ], + queueable_job: [ + "id 37, present", + "id 38, present" + ] + }, + "id 107, present" + ], + build: [ + { + _: "id 103, present", + job: [ + "id 104, present" + ], + repository: [ + "id 41, present", + "id 40, present" + ], + tag: [ + "id 23, present" + ], + branch: [ + "id 96, present" + ], + stage: [ + "id 41, present" + ] + }, + "id 105, present" + ] + }, + "id 20, present" + ] + }, + "id 222, present" ], - stage: [ - "id 39, present" + request: [ + { + _: "id 21, present", + abuse: [ + "id 19, present", + "id 20, present" + ], + message: [ + "id 19, present", + "id 20, present" + ], + job: [ + { + _: "id 111, present", + log: [ + "id 39, present", + "id 40, present" + ], + annotation: [ + "id 39, present", + "id 40, present" + ], + queueable_job: [ + "id 39, present", + "id 40, present" + ] + }, + "id 112, present" + ], + build: [ + { + _: "id 108, present", + job: [ + "id 109, present" + ], + repository: [ + "id 43, present", + "id 42, present" + ], + tag: [ + "id 24, present" + ], + branch: [ + "id 97, present" + ], + stage: [ + "id 42, present" + ] + }, + "id 110, present" + ] + }, + "id 22, present" ] }, - "id 97, present" + "id 25, present" ], - commit: [ + branch: [ { - _: "id 221, present", + _: "id 98, present", build: [ { - _: "id 98, present", + _: "id 113, present", job: [ - "id 99, present" + "id 114, present" ], repository: [ - "id 39, present", - "id 38, present" + "id 45, present", + "id 44, present" ], tag: [ - "id 22, present" + "id 26, present" ], branch: [ - "id 95, present" + "id 99, present" ], stage: [ - "id 40, present" + "id 43, present" + ] + }, + "id 115, present" + ], + commit: [ + { + _: "id 223, present", + build: [ + { + _: "id 118, present", + job: [ + "id 119, present" + ], + repository: [ + "id 47, present", + "id 46, present" + ], + tag: [ + "id 27, present" + ], + branch: [ + "id 100, present" + ], + stage: [ + "id 44, present" + ] + }, + "id 120, present" + ], + job: [ + { + _: "id 121, present", + log: [ + "id 43, present", + "id 44, present" + ], + annotation: [ + "id 43, present", + "id 44, present" + ], + queueable_job: [ + "id 43, present", + "id 44, present" + ] + }, + "id 122, present" + ], + request: [ + { + _: "id 23, present", + abuse: [ + "id 21, present", + "id 22, present" + ], + message: [ + "id 21, present", + "id 22, present" + ], + job: [ + { + _: "id 126, present", + log: [ + "id 45, present", + "id 46, present" + ], + annotation: [ + "id 45, present", + "id 46, present" + ], + queueable_job: [ + "id 45, present", + "id 46, present" + ] + }, + "id 127, present" + ], + build: [ + { + _: "id 123, present", + job: [ + "id 124, present" + ], + repository: [ + "id 49, present", + "id 48, present" + ], + tag: [ + "id 28, present" + ], + branch: [ + "id 101, present" + ], + stage: [ + "id 45, present" + ] + }, + "id 125, present" + ] + }, + "id 24, present" ] }, - "id 100, present" + "id 224, present" + ], + cron: [ + "id 5, present", + "id 6, present" ], job: [ { - _: "id 101, present", + _: "id 116, present", log: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ], annotation: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ], queueable_job: [ - "id 35, present", - "id 36, present" + "id 41, present", + "id 42, present" ] }, - "id 102, present" + "id 117, present" ], request: [ { - _: "id 19, present", + _: "id 25, present", abuse: [ - "id 17, present", - "id 18, present" + "id 23, present", + "id 24, present" ], message: [ - "id 17, present", - "id 18, present" + "id 23, present", + "id 24, present" ], job: [ { - _: "id 106, present", + _: "id 131, present", log: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ], annotation: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ], queueable_job: [ - "id 37, present", - "id 38, present" + "id 47, present", + "id 48, present" ] }, - "id 107, present" + "id 132, present" ], build: [ { - _: "id 103, present", + _: "id 128, present", job: [ - "id 104, present" + "id 129, present" ], repository: [ - "id 41, present", - "id 40, present" + "id 51, present", + "id 50, present" ], tag: [ - "id 23, present" + "id 29, present" ], branch: [ - "id 96, present" + "id 102, present" ], stage: [ - "id 41, present" + "id 46, present" ] }, - "id 105, present" + "id 130, present" ] }, - "id 20, present" + "id 26, present" ] }, - "id 222, present" + "id 103, present" + ], + stage: [ + { + _: "id 37, removed", + job: [ + "id 89, removed", + "id 90, removed" + ] + }, + { + _: "id 38, removed", + job: [ + "id 91, removed", + "id 92, removed" + ] + } + ] + }, + "id 137, removed" + ] + }, + "id 6, removed" + ], + tag: [ + { + _: "id 33, removed", + build: [ + { + _: "id 143, removed", + job: [ + "id 144, removed" + ], + repository: [ + "id 59, present", + "id 58, present" + ], + tag: [ + "id 34, present" + ], + branch: [ + "id 107, present" + ], + stage: [ + "id 48, removed" + ] + }, + "id 145, removed" + ], + commit: [ + { + _: "id 227, removed", + build: [ + { + _: "id 146, removed", + job: [ + "id 147, removed" + ], + repository: [ + "id 61, present", + "id 60, present" + ], + tag: [ + "id 35, present" + ], + branch: [ + "id 108, present" + ], + stage: [ + "id 49, removed" + ] + }, + "id 148, removed" + ], + job: [ + { + _: "id 149, removed", + log: [ + "id 51, removed", + "id 52, removed" + ], + annotation: [ + "id 51, removed", + "id 52, removed" + ], + queueable_job: [ + "id 51, removed", + "id 52, removed" + ] + }, + "id 150, removed" ], request: [ { - _: "id 21, present", + _: "id 31, removed", abuse: [ - "id 19, present", - "id 20, present" + "id 27, removed", + "id 28, removed" ], message: [ - "id 19, present", - "id 20, present" + "id 27, removed", + "id 28, removed" ], job: [ { - _: "id 111, present", + _: "id 154, removed", log: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ], annotation: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ], queueable_job: [ - "id 39, present", - "id 40, present" + "id 53, removed", + "id 54, removed" ] }, - "id 112, present" + "id 155, removed" ], build: [ { - _: "id 108, present", + _: "id 151, removed", job: [ - "id 109, present" + "id 152, removed" ], repository: [ - "id 43, present", - "id 42, present" + "id 63, present", + "id 62, present" ], tag: [ - "id 24, present" + "id 36, present" ], branch: [ - "id 97, present" + "id 109, present" ], stage: [ - "id 42, present" + "id 50, removed" ] }, - "id 110, present" + "id 153, removed" ] }, - "id 22, present" + "id 32, removed" ] }, - "id 25, present" + "id 228, removed" ], - branch: [ + request: [ { - _: "id 98, present", + _: "id 33, removed", + abuse: [ + "id 29, removed", + "id 30, removed" + ], + message: [ + "id 29, removed", + "id 30, removed" + ], + job: [ + { + _: "id 159, removed", + log: [ + "id 55, removed", + "id 56, removed" + ], + annotation: [ + "id 55, removed", + "id 56, removed" + ], + queueable_job: [ + "id 55, removed", + "id 56, removed" + ] + }, + "id 160, removed" + ], build: [ { - _: "id 113, present", + _: "id 156, removed", job: [ - "id 114, present" + "id 157, removed" ], repository: [ - "id 45, present", - "id 44, present" + "id 65, present", + "id 64, present" ], tag: [ - "id 26, present" + "id 37, present" ], branch: [ - "id 99, present" + "id 110, present" ], stage: [ - "id 43, present" + "id 51, removed" ] }, - "id 115, present" + "id 158, removed" + ] + }, + "id 34, removed" + ] + }, + "id 38, removed" + ] + } + ] + }, + { + _: "id 211, removed", + job: [ + { + _: "id 216, removed", + log: [ + "id 73, removed", + "id 74, removed" + ], + annotation: [ + "id 73, removed", + "id 74, removed" + ], + queueable_job: [ + "id 73, removed", + "id 74, removed" + ] + }, + "id 217, removed" + ], + repository: [ + { + _: "id 105, present", + build: [ + "id 258, present" + ], + request: [ + "id 54, present" + ], + job: [ + "id 259, present" + ], + branch: [ + "id 134, present" + ], + ssl_key: [ + "id 40, present" + ], + commit: [ + "id 240, present" + ], + permission: [ + "id 12, present" + ], + star: [ + "id 12, present" + ], + pull_request: [ + "id 10, present" + ], + tag: [ + "id 62, present" + ] + }, + "id 106, present", + { + _: "id 103, present", + build: [ + "id 256, present" + ], + request: [ + "id 53, present" + ], + job: [ + "id 257, present" + ], + branch: [ + "id 133, present" + ], + ssl_key: [ + "id 39, present" + ], + commit: [ + "id 239, present" + ], + permission: [ + "id 11, present" + ], + star: [ + "id 11, present" + ], + pull_request: [ + "id 9, present" + ], + tag: [ + "id 61, present" + ] + }, + "id 104, present" + ], + tag: [ + { + _: "id 51, present", + build: [ + { + _: "id 218, present", + job: [ + "id 219, present" + ], + repository: [ + "id 88, present", + "id 87, present" + ], + tag: [ + "id 52, present" + ], + branch: [ + "id 123, present" + ], + stage: [ + "id 64, present" + ] + }, + "id 220, present" + ], + commit: [ + { + _: "id 235, present", + build: [ + { + _: "id 221, present", + job: [ + "id 222, present" ], - commit: [ - { - _: "id 223, present", - build: [ - { - _: "id 118, present", - job: [ - "id 119, present" - ], - repository: [ - "id 47, present", - "id 46, present" - ], - tag: [ - "id 27, present" - ], - branch: [ - "id 100, present" - ], - stage: [ - "id 44, present" - ] - }, - "id 120, present" - ], - job: [ - { - _: "id 121, present", - log: [ - "id 43, present", - "id 44, present" - ], - annotation: [ - "id 43, present", - "id 44, present" - ], - queueable_job: [ - "id 43, present", - "id 44, present" - ] - }, - "id 122, present" - ], - request: [ - { - _: "id 23, present", - abuse: [ - "id 21, present", - "id 22, present" - ], - message: [ - "id 21, present", - "id 22, present" - ], - job: [ - { - _: "id 126, present", - log: [ - "id 45, present", - "id 46, present" - ], - annotation: [ - "id 45, present", - "id 46, present" - ], - queueable_job: [ - "id 45, present", - "id 46, present" - ] - }, - "id 127, present" - ], - build: [ - { - _: "id 123, present", - job: [ - "id 124, present" - ], - repository: [ - "id 49, present", - "id 48, present" - ], - tag: [ - "id 28, present" - ], - branch: [ - "id 101, present" - ], - stage: [ - "id 45, present" - ] - }, - "id 125, present" - ] - }, - "id 24, present" - ] - }, - "id 224, present" + repository: [ + "id 90, present", + "id 89, present" + ], + tag: [ + "id 53, present" + ], + branch: [ + "id 124, present" + ], + stage: [ + "id 65, present" + ] + }, + "id 223, present" + ], + job: [ + { + _: "id 224, present", + log: [ + "id 75, present", + "id 76, present" + ], + annotation: [ + "id 75, present", + "id 76, present" + ], + queueable_job: [ + "id 75, present", + "id 76, present" + ] + }, + "id 225, present" + ], + request: [ + { + _: "id 45, present", + abuse: [ + "id 39, present", + "id 40, present" ], - cron: [ - "id 5, present", - "id 6, present" + message: [ + "id 39, present", + "id 40, present" ], job: [ { - _: "id 116, present", + _: "id 229, present", log: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ], annotation: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ], queueable_job: [ - "id 41, present", - "id 42, present" + "id 77, present", + "id 78, present" ] }, - "id 117, present" + "id 230, present" ], - request: [ + build: [ { - _: "id 25, present", - abuse: [ - "id 23, present", - "id 24, present" + _: "id 226, present", + job: [ + "id 227, present" ], - message: [ - "id 23, present", - "id 24, present" + repository: [ + "id 92, present", + "id 91, present" ], - job: [ - { - _: "id 131, present", - log: [ - "id 47, present", - "id 48, present" - ], - annotation: [ - "id 47, present", - "id 48, present" - ], - queueable_job: [ - "id 47, present", - "id 48, present" - ] - }, - "id 132, present" + tag: [ + "id 54, present" ], - build: [ - { - _: "id 128, present", - job: [ - "id 129, present" - ], - repository: [ - "id 51, present", - "id 50, present" - ], - tag: [ - "id 29, present" - ], - branch: [ - "id 102, present" - ], - stage: [ - "id 46, present" - ] - }, - "id 130, present" + branch: [ + "id 125, present" + ], + stage: [ + "id 66, present" ] }, - "id 26, present" + "id 228, present" ] }, - "id 103, present" + "id 46, present" + ] + }, + "id 236, present" + ], + request: [ + { + _: "id 47, present", + abuse: [ + "id 41, present", + "id 42, present" ], - stage: [ + message: [ + "id 41, present", + "id 42, present" + ], + job: [ { - _: "id 37, removed", - job: [ - "id 89, removed", - "id 90, removed" + _: "id 234, present", + log: [ + "id 79, present", + "id 80, present" + ], + annotation: [ + "id 79, present", + "id 80, present" + ], + queueable_job: [ + "id 79, present", + "id 80, present" ] }, + "id 235, present" + ], + build: [ { - _: "id 38, removed", + _: "id 231, present", job: [ - "id 91, removed", - "id 92, removed" + "id 232, present" + ], + repository: [ + "id 94, present", + "id 93, present" + ], + tag: [ + "id 55, present" + ], + branch: [ + "id 126, present" + ], + stage: [ + "id 67, present" ] - } + }, + "id 233, present" ] }, - "id 137, removed" + "id 48, present" ] }, - "id 6, removed" + "id 56, present" ], - tag: [ + branch: [ { - _: "id 33, removed", + _: "id 127, present", build: [ { - _: "id 143, removed", + _: "id 236, present", job: [ - "id 144, removed" + "id 237, present" ], repository: [ - "id 59, present", - "id 58, present" + "id 96, present", + "id 95, present" ], tag: [ - "id 34, present" + "id 57, present" ], branch: [ - "id 107, present" + "id 128, present" ], stage: [ - "id 48, removed" + "id 68, present" ] }, - "id 145, removed" + "id 238, present" ], commit: [ { - _: "id 227, removed", + _: "id 237, present", build: [ { - _: "id 146, removed", + _: "id 241, present", job: [ - "id 147, removed" + "id 242, present" ], repository: [ - "id 61, present", - "id 60, present" + "id 98, present", + "id 97, present" ], tag: [ - "id 35, present" + "id 58, present" ], branch: [ - "id 108, present" + "id 129, present" ], stage: [ - "id 49, removed" + "id 69, present" ] }, - "id 148, removed" + "id 243, present" ], job: [ { - _: "id 149, removed", + _: "id 244, present", log: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ], annotation: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ], queueable_job: [ - "id 51, removed", - "id 52, removed" + "id 83, present", + "id 84, present" ] }, - "id 150, removed" + "id 245, present" ], request: [ { - _: "id 31, removed", + _: "id 49, present", abuse: [ - "id 27, removed", - "id 28, removed" + "id 43, present", + "id 44, present" ], message: [ - "id 27, removed", - "id 28, removed" + "id 43, present", + "id 44, present" ], job: [ { - _: "id 154, removed", + _: "id 249, present", log: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ], annotation: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ], queueable_job: [ - "id 53, removed", - "id 54, removed" + "id 85, present", + "id 86, present" ] }, - "id 155, removed" + "id 250, present" ], build: [ { - _: "id 151, removed", + _: "id 246, present", job: [ - "id 152, removed" + "id 247, present" ], repository: [ - "id 63, present", - "id 62, present" + "id 100, present", + "id 99, present" ], tag: [ - "id 36, present" + "id 59, present" ], branch: [ - "id 109, present" + "id 130, present" ], stage: [ - "id 50, removed" + "id 70, present" ] }, - "id 153, removed" + "id 248, present" ] }, - "id 32, removed" + "id 50, present" + ] + }, + "id 238, present" + ], + cron: [ + "id 9, present", + "id 10, present" + ], + job: [ + { + _: "id 239, present", + log: [ + "id 81, present", + "id 82, present" + ], + annotation: [ + "id 81, present", + "id 82, present" + ], + queueable_job: [ + "id 81, present", + "id 82, present" ] }, - "id 228, removed" + "id 240, present" ], request: [ { - _: "id 33, removed", + _: "id 51, present", abuse: [ - "id 29, removed", - "id 30, removed" + "id 45, present", + "id 46, present" ], message: [ - "id 29, removed", - "id 30, removed" + "id 45, present", + "id 46, present" ], job: [ { - _: "id 159, removed", + _: "id 254, present", log: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ], annotation: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ], queueable_job: [ - "id 55, removed", - "id 56, removed" + "id 87, present", + "id 88, present" ] }, - "id 160, removed" + "id 255, present" ], build: [ { - _: "id 156, removed", + _: "id 251, present", job: [ - "id 157, removed" + "id 252, present" ], repository: [ - "id 65, present", - "id 64, present" + "id 102, present", + "id 101, present" ], tag: [ - "id 37, present" + "id 60, present" ], branch: [ - "id 110, present" + "id 131, present" ], stage: [ - "id 51, removed" + "id 71, present" ] }, - "id 158, removed" + "id 253, present" ] }, - "id 34, removed" + "id 52, present" + ] + }, + "id 132, present" + ], + stage: [ + { + _: "id 62, removed", + job: [ + "id 212, removed", + "id 213, removed" ] }, - "id 38, removed" + { + _: "id 63, removed", + job: [ + "id 214, removed", + "id 215, removed" + ] + } ] }, + { + _: "id 260, removed", + repository: [ + "id 1, removed, duplicate" + ] + } + ], + repository: [ + "id 1, removed, duplicate", "id 66, removed" ], job: [ diff --git a/spec/support/expected_files/remove_repo_builds/annotation_1-61.json b/spec/support/expected_files/remove_repo_builds/annotation_1-61.json new file mode 100644 index 0000000..b2aca84 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/annotation_1-61.json @@ -0,0 +1,55 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 1, + "job_id": 6, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 2, + "job_id": 6, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 57, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 58, + "job_id": 166, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + }, + { + "id": 61, + "job_id": 180, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json b/spec/support/expected_files/remove_repo_builds/annotation_57-58.json deleted file mode 100644 index adaaceb..0000000 --- a/spec/support/expected_files/remove_repo_builds/annotation_57-58.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "table_name": "annotations", - "data": [ - { - "id": 57, - "job_id": 166, - "url": null, - "description": "some text", - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-03-17 21:29:24 UTC", - "annotation_provider_id": 0, - "status": null - }, - { - "id": 58, - "job_id": 166, - "url": null, - "description": "some text", - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-03-17 21:29:24 UTC", - "annotation_provider_id": 0, - "status": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/annotation_62-62.json b/spec/support/expected_files/remove_repo_builds/annotation_62-62.json new file mode 100644 index 0000000..f7e871a --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/annotation_62-62.json @@ -0,0 +1,15 @@ +{ + "table_name": "annotations", + "data": [ + { + "id": 62, + "job_id": 180, + "url": null, + "description": "some text", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "annotation_provider_id": 0, + "status": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/build_1-175.json b/spec/support/expected_files/remove_repo_builds/build_1-175.json new file mode 100644 index 0000000..67ad2a3 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/build_1-175.json @@ -0,0 +1,125 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 1, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 50, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 161, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 175, + "repository_id": 1, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_166-178.json b/spec/support/expected_files/remove_repo_builds/job_166-178.json new file mode 100644 index 0000000..887bca0 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_166-178.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 166, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 167, + "repository_id": null, + "commit_id": null, + "source_id": 161, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 176, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 56 + }, + { + "id": 177, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 56 + }, + { + "id": 178, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 57 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_167-167.json b/spec/support/expected_files/remove_repo_builds/job_167-167.json deleted file mode 100644 index ca7204d..0000000 --- a/spec/support/expected_files/remove_repo_builds/job_167-167.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "table_name": "jobs", - "data": [ - { - "id": 167, - "repository_id": null, - "commit_id": null, - "source_id": 161, - "source_type": "Build", - "queue": null, - "type": null, - "state": null, - "number": null, - "config": null, - "worker": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", - "tags": null, - "allow_failure": false, - "owner_id": null, - "owner_type": null, - "result": null, - "queued_at": null, - "canceled_at": null, - "received_at": null, - "debug_options": null, - "private": null, - "stage_number": null, - "stage_id": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_179-181.json b/spec/support/expected_files/remove_repo_builds/job_179-181.json new file mode 100644 index 0000000..8b48257 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_179-181.json @@ -0,0 +1,92 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 179, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 57 + }, + { + "id": 180, + "repository_id": null, + "commit_id": null, + "source_id": 175, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 181, + "repository_id": null, + "commit_id": null, + "source_id": 175, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_2-6.json b/spec/support/expected_files/remove_repo_builds/job_2-6.json new file mode 100644 index 0000000..3117f25 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/job_2-6.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 2, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 3, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 20 + }, + { + "id": 4, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 5, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 21 + }, + { + "id": 6, + "repository_id": null, + "commit_id": null, + "source_id": 1, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/job_162-166.json b/spec/support/expected_files/remove_repo_builds/job_7-165.json similarity index 85% rename from spec/support/expected_files/remove_repo_builds/job_162-166.json rename to spec/support/expected_files/remove_repo_builds/job_7-165.json index 6a366e3..46fc394 100644 --- a/spec/support/expected_files/remove_repo_builds/job_162-166.json +++ b/spec/support/expected_files/remove_repo_builds/job_7-165.json @@ -2,11 +2,11 @@ "table_name": "jobs", "data": [ { - "id": 162, + "id": 7, "repository_id": null, "commit_id": null, - "source_id": null, - "source_type": null, + "source_id": 1, + "source_type": "Build", "queue": null, "type": null, "state": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -28,10 +28,10 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 52 + "stage_id": null }, { - "id": 163, + "id": 162, "repository_id": null, "commit_id": null, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,7 +60,7 @@ "stage_id": 52 }, { - "id": 164, + "id": 163, "repository_id": null, "commit_id": null, "source_id": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -86,10 +86,10 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": 53 + "stage_id": 52 }, { - "id": 165, + "id": 164, "repository_id": null, "commit_id": null, "source_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,11 +118,11 @@ "stage_id": 53 }, { - "id": 166, + "id": 165, "repository_id": null, "commit_id": null, - "source_id": 161, - "source_type": "Build", + "source_id": null, + "source_type": null, "queue": null, "type": null, "state": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -144,7 +144,7 @@ "debug_options": null, "private": null, "stage_number": null, - "stage_id": null + "stage_id": 53 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_1-61.json b/spec/support/expected_files/remove_repo_builds/log_1-61.json new file mode 100644 index 0000000..81db380 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_1-61.json @@ -0,0 +1,75 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 1, + "job_id": 6, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 2, + "job_id": 6, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 57, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 58, + "job_id": 166, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + }, + { + "id": 61, + "job_id": 180, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_57-58.json b/spec/support/expected_files/remove_repo_builds/log_57-58.json deleted file mode 100644 index b4959cd..0000000 --- a/spec/support/expected_files/remove_repo_builds/log_57-58.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "table_name": "logs", - "data": [ - { - "id": 57, - "job_id": 166, - "content": "some log content", - "removed_by": 1, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-03-17 21:29:24 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true - }, - { - "id": 58, - "job_id": 166, - "content": "some log content", - "removed_by": 1, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-03-17 21:29:24 UTC", - "aggregated_at": null, - "archived_at": null, - "purged_at": null, - "removed_at": null, - "archiving": false, - "archive_verified": true - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/log_62-62.json b/spec/support/expected_files/remove_repo_builds/log_62-62.json new file mode 100644 index 0000000..f7cfef2 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/log_62-62.json @@ -0,0 +1,19 @@ +{ + "table_name": "logs", + "data": [ + { + "id": 62, + "job_id": 180, + "content": "some log content", + "removed_by": 1, + "created_at": "2021-04-12 09:15:56 UTC", + "updated_at": "2021-04-12 09:15:56 UTC", + "aggregated_at": null, + "archived_at": null, + "purged_at": null, + "removed_at": null, + "archiving": false, + "archive_verified": true + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json b/spec/support/expected_files/remove_repo_builds/queueable_job_1-61.json similarity index 51% rename from spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json rename to spec/support/expected_files/remove_repo_builds/queueable_job_1-61.json index 09971dd..6ba05a4 100644 --- a/spec/support/expected_files/remove_repo_builds/queueable_job_57-58.json +++ b/spec/support/expected_files/remove_repo_builds/queueable_job_1-61.json @@ -1,6 +1,14 @@ { "table_name": "queueable_jobs", "data": [ + { + "id": 1, + "job_id": 6 + }, + { + "id": 2, + "job_id": 6 + }, { "id": 57, "job_id": 166 @@ -8,6 +16,10 @@ { "id": 58, "job_id": 166 + }, + { + "id": 61, + "job_id": 180 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/queueable_job_62-62.json b/spec/support/expected_files/remove_repo_builds/queueable_job_62-62.json new file mode 100644 index 0000000..eb0ff8f --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/queueable_job_62-62.json @@ -0,0 +1,9 @@ +{ + "table_name": "queueable_jobs", + "data": [ + { + "id": 62, + "job_id": 180 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/stage_20-56.json b/spec/support/expected_files/remove_repo_builds/stage_20-56.json new file mode 100644 index 0000000..4f92879 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/stage_20-56.json @@ -0,0 +1,50 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 20, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 21, + "build_id": 1, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 52, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 53, + "build_id": 161, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 56, + "build_id": 175, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/stage_52-53.json b/spec/support/expected_files/remove_repo_builds/stage_52-53.json deleted file mode 100644 index bffd072..0000000 --- a/spec/support/expected_files/remove_repo_builds/stage_52-53.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "table_name": "stages", - "data": [ - { - "id": 52, - "build_id": 161, - "number": null, - "name": null, - "state": null, - "started_at": null, - "finished_at": null - }, - { - "id": 53, - "build_id": 161, - "number": null, - "name": null, - "state": null, - "started_at": null, - "finished_at": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/stage_57-57.json b/spec/support/expected_files/remove_repo_builds/stage_57-57.json new file mode 100644 index 0000000..c56685a --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/stage_57-57.json @@ -0,0 +1,14 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 57, + "build_id": 175, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/abuse_9-10.json b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json index 75c861e..d689dec 100644 --- a/spec/support/expected_files/remove_repo_requests/abuse_9-10.json +++ b/spec/support/expected_files/remove_repo_requests/abuse_9-10.json @@ -8,8 +8,8 @@ "request_id": 11, "level": 9, "reason": "some text", - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC" + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC" }, { "id": 10, @@ -18,8 +18,8 @@ "request_id": 11, "level": 10, "reason": "some text", - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC" + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/annotation_17-18.json b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json index 08019e8..c5e0599 100644 --- a/spec/support/expected_files/remove_repo_requests/annotation_17-18.json +++ b/spec/support/expected_files/remove_repo_requests/annotation_17-18.json @@ -6,8 +6,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "annotation_provider_id": 0, "status": null }, @@ -16,8 +16,8 @@ "job_id": 54, "url": null, "description": "some text", - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "annotation_provider_id": 0, "status": null } diff --git a/spec/support/expected_files/remove_repo_builds/build_50-161.json b/spec/support/expected_files/remove_repo_requests/build_51-53.json similarity index 79% rename from spec/support/expected_files/remove_repo_builds/build_50-161.json rename to spec/support/expected_files/remove_repo_requests/build_51-53.json index 0783c47..e6be7f9 100644 --- a/spec/support/expected_files/remove_repo_builds/build_50-161.json +++ b/spec/support/expected_files/remove_repo_requests/build_51-53.json @@ -2,16 +2,16 @@ "table_name": "builds", "data": [ { - "id": 50, - "repository_id": 1, + "id": 51, + "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:25 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 11, "state": null, "duration": null, "owner_id": null, @@ -32,16 +32,16 @@ "sender_type": null }, { - "id": 161, - "repository_id": 1, + "id": 53, + "repository_id": null, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-17 21:29:24 UTC", - "updated_at": "2021-10-17 20:29:26 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "config": null, "commit_id": null, - "request_id": null, + "request_id": 11, "state": null, "duration": null, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_requests/build_53-53.json b/spec/support/expected_files/remove_repo_requests/build_53-53.json deleted file mode 100644 index e11c3e5..0000000 --- a/spec/support/expected_files/remove_repo_requests/build_53-53.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "table_name": "builds", - "data": [ - { - "id": 53, - "repository_id": null, - "number": null, - "started_at": null, - "finished_at": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", - "config": null, - "commit_id": null, - "request_id": 11, - "state": null, - "duration": null, - "owner_id": null, - "owner_type": null, - "event_type": null, - "previous_state": null, - "pull_request_title": null, - "pull_request_number": null, - "branch": null, - "canceled_at": null, - "cached_matrix_ids": null, - "received_at": null, - "private": null, - "pull_request_id": null, - "branch_id": null, - "tag_id": null, - "sender_id": null, - "sender_type": null - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/job_54-55.json b/spec/support/expected_files/remove_repo_requests/job_52-55.json similarity index 58% rename from spec/support/expected_files/remove_repo_requests/job_54-55.json rename to spec/support/expected_files/remove_repo_requests/job_52-55.json index 8ae07cf..d848204 100644 --- a/spec/support/expected_files/remove_repo_requests/job_54-55.json +++ b/spec/support/expected_files/remove_repo_requests/job_52-55.json @@ -1,6 +1,35 @@ { "table_name": "jobs", "data": [ + { + "id": 52, + "repository_id": null, + "commit_id": null, + "source_id": 51, + "source_type": "Build", + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, { "id": 54, "repository_id": null, @@ -15,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -44,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_repo_requests/log_17-18.json b/spec/support/expected_files/remove_repo_requests/log_17-18.json index 9201781..6187f2c 100644 --- a/spec/support/expected_files/remove_repo_requests/log_17-18.json +++ b/spec/support/expected_files/remove_repo_requests/log_17-18.json @@ -6,8 +6,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, @@ -20,8 +20,8 @@ "job_id": 54, "content": "some log content", "removed_by": 1, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "aggregated_at": null, "archived_at": null, "purged_at": null, diff --git a/spec/support/expected_files/remove_repo_requests/message_9-10.json b/spec/support/expected_files/remove_repo_requests/message_9-10.json index fa7aa69..0bfd09c 100644 --- a/spec/support/expected_files/remove_repo_requests/message_9-10.json +++ b/spec/support/expected_files/remove_repo_requests/message_9-10.json @@ -9,8 +9,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC" + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC" }, { "id": 10, @@ -20,8 +20,8 @@ "key": null, "code": null, "args": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC" + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/request_11-12.json b/spec/support/expected_files/remove_repo_requests/request_11-35.json similarity index 58% rename from spec/support/expected_files/remove_repo_requests/request_11-12.json rename to spec/support/expected_files/remove_repo_requests/request_11-35.json index 30f67cb..f1e7a8f 100644 --- a/spec/support/expected_files/remove_repo_requests/request_11-12.json +++ b/spec/support/expected_files/remove_repo_requests/request_11-35.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,36 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-03-18 12:32:24 UTC", - "updated_at": "2021-03-18 12:32:24 UTC", + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 35, + "repository_id": 1, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-12 09:13:33 UTC", + "updated_at": "2021-04-12 09:13:33 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_repo_requests/stage_30-30.json b/spec/support/expected_files/remove_repo_requests/stage_30-30.json new file mode 100644 index 0000000..a8cc69d --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/stage_30-30.json @@ -0,0 +1,14 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 30, + "build_id": 51, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_id_trees/load_from_files.rb b/spec/support/expected_id_trees/load_from_files.rb new file mode 100644 index 0000000..4a729c4 --- /dev/null +++ b/spec/support/expected_id_trees/load_from_files.rb @@ -0,0 +1,118 @@ +class ExpectedIdTrees + def self.load_from_files + [ + { + job: [ + { + log: [ + 100, + 101 + ], + annotation: [ + 100, + 101 + ], + queueable_job: [ + 100, + 101 + ], + id: 105 + }, + 106 + ], + stage: [ + { + job: [ + 101, + 102 + ], + id: 100 + }, + { + job: [ + 103, + 104 + ], + id: 101 + } + ], + id: 100 + }, + 149, + { + job: [ + { + log: [ + 156, + 157 + ], + annotation: [ + 156, + 157 + ], + queueable_job: [ + 156, + 157 + ], + id: 265 + }, + 266 + ], + stage: [ + { + job: [ + 261, + 262 + ], + id: 132 + }, + { + job: [ + 263, + 264 + ], + id: 133 + } + ], + id: 260 + }, + { + job: [ + { + log: [ + 160, + 161 + ], + annotation: [ + 160, + 161 + ], + queueable_job: [ + 160, + 161 + ], + id: 279 + }, + 280 + ], + stage: [ + { + job: [ + 275, + 276 + ], + id: 136 + }, + { + job: [ + 277, + 278 + ], + id: 137 + } + ], + id: 274 + } + ] + end +end \ No newline at end of file diff --git a/spec/support/factories/repository.rb b/spec/support/factories/repository.rb index aad5d5d..7fe764f 100644 --- a/spec/support/factories/repository.rb +++ b/spec/support/factories/repository.rb @@ -152,6 +152,16 @@ created_at: repository.created_at, updated_at: repository.updated_at ) + create( + :request, + repository_id: repository.id, + created_at: repository.created_at, + updated_at: repository.updated_at + ) + create( + :request, + repository_id: repository.id + ) repository.update(last_build_id: last_build.id) end end diff --git a/spec/support/factories/request.rb b/spec/support/factories/request.rb index c960507..637407a 100644 --- a/spec/support/factories/request.rb +++ b/spec/support/factories/request.rb @@ -66,6 +66,7 @@ updated_at: request.updated_at ) end + factory :request_with_all_dependencies_and_sibling do after(:create) do |request| create(:request, request.attributes_without_id.symbolize_keys) From a16f25ba80a8a987c5a082d9f9e7ee352c1c526c Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Sun, 14 Nov 2021 13:10:24 +0100 Subject: [PATCH 75/88] merge done, process_ids_to_remove method --- lib/backup/remove_orphans.rb | 53 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index b81c5f9..b3929d2 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -18,48 +18,39 @@ def dry_run_report def run if @config.orphans_table - run_for_specified(@config.orphans_table) + check_specified(@config.orphans_table) else - run_for_all + check_all end + + process_ids_to_remove end - def run_for_all + def check_all cases.each do |model_block| - process_model_block(model_block) + check_model_block(model_block) end end - def run_for_specified(table_name) + def check_specified(table_name) model_block = cases.find { |c| c[:main_model] == Model.get_model_by_table_name(table_name) } - process_model_block(model_block) - end - - def add_builds_dependencies_to_dry_run_report(ids_for_delete) - repos_for_delete = Repository.where(current_build_id: ids_for_delete) - jobs_for_delete = Job.where(source_id: ids_for_delete) - @dry_run_reporter.add_to_report(:repositories, *repos_for_delete.map(&:id)) - @dry_run_reporter.add_to_report(:jobs, *jobs_for_delete.map(&:id)) + check_model_block(model_block) end - def process_model_block(model_block) + def check_model_block(model_block) model_block[:relations].each do |relation| - process_relationship( + check_relationship( main_model: model_block[:main_model], related_model: relation[:related_model], fk_name: relation[:fk_name], - method: model_block[:method], - dry_run_complement: model_block[:dry_run_complement] ) end end - def process_relationship(args) + def check_relationship(args) main_model = args[:main_model] related_model = args[:related_model] fk_name = args[:fk_name] - method = args[:method] || :delete_all - dry_run_complement = args[:dry_run_complement] main_table = main_model.table_name related_table = related_model.table_name @@ -74,14 +65,24 @@ def process_relationship(args) and b.id is null; }) - ids_for_delete = for_delete.map(&:id) + key = main_model.name.underscore.to_sym + ids = for_delete.map(&:id) + @ids_to_remove.add(key, *ids) + end - if config.dry_run - key = main_table.to_sym - @dry_run_reporter.add_to_report(key, *ids_for_delete) - dry_run_complement.call(ids_for_delete) if dry_run_complement + def process_ids_to_remove + if @config.dry_run + @dry_run_reporter.add_to_report(@ids_to_remove.with_table_symbols) else - main_model.where(id: ids_for_delete).send(method) + nullify_builds_dependencies + @ids_to_remove.remove_entries_from_db + end + end + + def nullify_builds_dependencies + @ids_to_remove[:build]&.each do |build_id| + build = Build.find_by(id: build_id) + build&.nullify_default_dependencies end end From f8d0f87069438053313f1eda5fcd7a76f026462c Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 15 Nov 2021 01:16:19 +0100 Subject: [PATCH 76/88] bug fixed --- lib/backup/remove_specified/remove_heavy_data.rb | 4 +--- spec/backup/remove_specified_spec.rb | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 292a9d5..8822878 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -45,9 +45,7 @@ def remove_repo_requests(repository) unless @config.dry_run requests_to_remove.each do |request| - hash_with_filtered = request.ids_of_all_dependencies_with_filtered(dependencies_to_filter) - filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } - filtered_builds&.each(&:nullify_default_dependencies) + nullify_filtered_dependencies(request) end end diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index d122f9c..6f21be3 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -75,7 +75,7 @@ def get_expected_files(directory, datetime) it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_builds(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-46) + }.to change { Model.sum_of_subclasses_rows }.by(-46) end it 'nullifies orphaned builds dependencies' do @@ -170,7 +170,7 @@ def get_expected_files(directory, datetime) it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_requests(repository) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-19) + }.to change { Model.sum_of_subclasses_rows }.by(-19) end it 'nullifies orphaned builds dependencies' do @@ -272,7 +272,7 @@ def get_expected_files(directory, datetime) it 'removes intended number of rows from the database' do expect { remove_specified.remove_user_with_dependencies(user.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-349) + }.to change { Model.sum_of_subclasses_rows }.by(-349) end it 'nullifies orphaned builds dependencies' do @@ -356,7 +356,7 @@ def get_expected_files(directory, datetime) it 'removes intended number of rows from the database' do expect { remove_specified.remove_org_with_dependencies(organization.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-339) + }.to change { Model.sum_of_subclasses_rows }.by(-339) end it 'nullifies orphaned builds dependencies' do @@ -439,7 +439,7 @@ def get_expected_files(directory, datetime) it 'removes intended number of rows from the database' do expect { remove_specified.remove_repo_with_dependencies(repository.id) - }.to change { Model.get_sum_of_rows_of_all_subclasses }.by(-239) + }.to change { Model.sum_of_subclasses_rows }.by(-239) end it 'nullifies orphaned builds dependencies' do From 3fad799ec9dfb354ae7e0519609bed8ec32eeb2a Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 15 Nov 2021 13:36:45 +0100 Subject: [PATCH 77/88] commented code removed --- lib/backup/remove_specified/remove_heavy_data.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 8822878..c23f3ff 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -21,8 +21,6 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me builds_to_remove = repository.builds.where('created_at < ?', threshold) builds_dependencies = builds_to_remove.map do |build| - # next if should_build_be_filtered?(build) - result = build.ids_of_all_dependencies(dependencies_to_filter, :without_parents) result.add(:build, build.id) result @@ -75,12 +73,6 @@ def time_for_subfolder Time.now.to_s.parameterize.underscore end - # def should_build_be_filtered?(build) - # dependencies_to_filter[:build].map do |association| - # build.send(association).to_a - # end.flatten.any? - # end - def dependencies_to_filter { build: [ From bd43fce1cf31d9b7c94d011325f644f7f8c319bd Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Mon, 15 Nov 2021 15:00:45 +0100 Subject: [PATCH 78/88] vision of backuping orphans in README, few minor changes --- README.md | 2 +- lib/backup/remove_orphans.rb | 4 ++-- lib/config.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 84180c0..85841b6 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ backup.run(repo_id: 1) Using `--move_logs` flag you can move all logs to database at `destination_db_url` URL (which is required in this case). When you run gem in this mode no files are created and no other tables are being touched. -Using `--remove_orphans` flag you can remove all orphaned data from the tables. You can pick a specific table using `--orphans_table` flag or, by leaving it undefined, let all tables to be processed in the removing orphans procedure. When you run gem in this mode no files are created. +Using `--remove_orphans` flag you can remove all orphaned data from the tables. You can pick a specific table using `--orphans_table` flag or, by leaving it undefined, let all tables to be processed in the removing orphans procedure. It can be combined with `--backup` flag in order to save removed data in files. Using `--user_id`, `--org_id` or `--repo_id` flag without setting `--threshold` results in removing the specified user/organization/repository with all its dependencies. It can be combined with `--backup` flag in order to save removed data in files. diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index b3929d2..c597c09 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -81,8 +81,8 @@ def process_ids_to_remove def nullify_builds_dependencies @ids_to_remove[:build]&.each do |build_id| - build = Build.find_by(id: build_id) - build&.nullify_default_dependencies + build = Build.find(build_id) + build.nullify_default_dependencies end end diff --git a/lib/config.rb b/lib/config.rb index 31b680c..d3b3d9c 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -129,7 +129,7 @@ def set_values(args) end def check_values - if !@move_logs && !@remove_orphans && !@threshold && !@user_id && !org_id && !repo_id && !load_from_files + if !@move_logs && !@remove_orphans && !@threshold && !@user_id && !@org_id && !@repo_id && !@load_from_files message = abort_message("Please provide the threshold argument. Data younger than it will be omitted. " + "Threshold defines number of months from now. Alternatively you can define user_id, org_id or repo_id " + "to remove whole user, organization or repository with all dependencies.") From 812f9a0d74cf15bdd69cb66c58a19ee10565438e Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 16 Nov 2021 10:52:12 +0100 Subject: [PATCH 79/88] saving nullified relationships while removing specified --- .../remove_specified/remove_heavy_data.rb | 161 +++++++++--------- .../remove_with_all_dependencies.rb | 77 ++++----- lib/backup/remove_specified/shared.rb | 24 +++ lib/backup/save_nullified_rels_to_file.rb | 29 ++++ lib/nullify_dependencies.rb | 14 +- spec/backup/remove_specified_spec.rb | 4 +- .../nullified_relationships/build_1.json | 35 ++++ .../nullified_relationships/build_10.json | 35 ++++ .../nullified_relationships/build_11.json | 35 ++++ .../nullified_relationships/build_12.json | 35 ++++ .../nullified_relationships/build_13.json | 35 ++++ .../nullified_relationships/build_14.json | 35 ++++ .../nullified_relationships/build_15.json | 35 ++++ .../nullified_relationships/build_16.json | 35 ++++ .../nullified_relationships/build_17.json | 35 ++++ .../nullified_relationships/build_18.json | 23 +++ .../nullified_relationships/build_2.json | 35 ++++ .../nullified_relationships/build_3.json | 35 ++++ .../nullified_relationships/build_4.json | 35 ++++ .../nullified_relationships/build_5.json | 35 ++++ .../nullified_relationships/build_6.json | 35 ++++ .../nullified_relationships/build_7.json | 35 ++++ .../nullified_relationships/build_8.json | 35 ++++ .../nullified_relationships/build_9.json | 35 ++++ .../nullified_relationships/build_1.json | 35 ++++ .../nullified_relationships/build_2.json | 29 ++++ .../nullified_relationships/build_1.json | 29 ++++ .../nullified_relationships/build_1.json | 35 ++++ .../nullified_relationships/build_10.json | 35 ++++ .../nullified_relationships/build_11.json | 35 ++++ .../nullified_relationships/build_12.json | 35 ++++ .../nullified_relationships/build_13.json | 29 ++++ .../nullified_relationships/build_2.json | 35 ++++ .../nullified_relationships/build_3.json | 35 ++++ .../nullified_relationships/build_4.json | 35 ++++ .../nullified_relationships/build_5.json | 35 ++++ .../nullified_relationships/build_6.json | 35 ++++ .../nullified_relationships/build_7.json | 35 ++++ .../nullified_relationships/build_8.json | 35 ++++ .../nullified_relationships/build_9.json | 35 ++++ .../nullified_relationships/build_1.json | 35 ++++ .../nullified_relationships/build_10.json | 35 ++++ .../nullified_relationships/build_11.json | 35 ++++ .../nullified_relationships/build_12.json | 35 ++++ .../nullified_relationships/build_13.json | 35 ++++ .../nullified_relationships/build_14.json | 35 ++++ .../nullified_relationships/build_15.json | 35 ++++ .../nullified_relationships/build_16.json | 35 ++++ .../nullified_relationships/build_17.json | 35 ++++ .../nullified_relationships/build_18.json | 23 +++ .../nullified_relationships/build_2.json | 35 ++++ .../nullified_relationships/build_3.json | 35 ++++ .../nullified_relationships/build_4.json | 35 ++++ .../nullified_relationships/build_5.json | 35 ++++ .../nullified_relationships/build_6.json | 35 ++++ .../nullified_relationships/build_7.json | 35 ++++ .../nullified_relationships/build_8.json | 35 ++++ .../nullified_relationships/build_9.json | 35 ++++ 58 files changed, 1956 insertions(+), 131 deletions(-) create mode 100644 lib/backup/remove_specified/shared.rb create mode 100644 lib/backup/save_nullified_rels_to_file.rb create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_10.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_11.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_12.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_13.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_14.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_15.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_16.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_17.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_18.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_2.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_3.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_4.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_5.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_6.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_7.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_8.json create mode 100644 spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_9.json create mode 100644 spec/support/expected_files/remove_repo_builds/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_repo_builds/nullified_relationships/build_2.json create mode 100644 spec/support/expected_files/remove_repo_requests/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_10.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_11.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_12.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_13.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_2.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_3.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_4.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_5.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_6.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_7.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_8.json create mode 100644 spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_9.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_10.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_11.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_12.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_13.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_14.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_15.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_16.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_17.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_18.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_2.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_3.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_4.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_5.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_6.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_7.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_8.json create mode 100644 spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_9.json diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index c23f3ff..1fe3ee9 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -1,106 +1,99 @@ # frozen_string_literal: true require 'backup/save_file' +require 'backup/remove_specified/shared' + +class Backup + class RemoveSpecified + module RemoveHeavyData + include SaveIdHashToFile + include SaveNullifiedRelsToFile + include Shared + + def remove_heavy_data_for_repos_owned_by(owner_id, owner_type) + Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| + remove_heavy_data_for_repo(repository) + end + end -module RemoveHeavyData - include SaveIdHashToFile - - def remove_heavy_data_for_repos_owned_by(owner_id, owner_type) - Repository.where('owner_id = ? and owner_type = ?', owner_id, owner_type).order(:id).each do |repository| - remove_heavy_data_for_repo(repository) - end - end - - def remove_heavy_data_for_repo(repository) - remove_repo_builds(repository) - remove_repo_requests(repository) - end - - def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength - threshold = @config.threshold.to_i.months.ago.to_datetime - builds_to_remove = repository.builds.where('created_at < ?', threshold) + def remove_heavy_data_for_repo(repository) + remove_repo_builds(repository) + remove_repo_requests(repository) + end - builds_dependencies = builds_to_remove.map do |build| - result = build.ids_of_all_dependencies(dependencies_to_filter, :without_parents) - result.add(:build, build.id) - result - end.compact + def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + threshold = @config.threshold.to_i.months.ago.to_datetime + builds_to_remove = repository.builds.where('created_at < ?', threshold) - builds_to_remove&.each(&:nullify_default_dependencies) unless @config.dry_run - ids_to_remove = IdHash.join(*builds_dependencies) - @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" - process_ids_to_remove(ids_to_remove) - end + builds_dependencies = builds_to_remove.map do |build| + result = build.ids_of_all_dependencies(dependencies_to_filter, :without_parents) + result.add(:build, build.id) + result + end.compact - def remove_repo_requests(repository) - threshold = @config.threshold.to_i.months.ago.to_datetime - requests_to_remove = repository.requests.where('created_at < ?', threshold) + ids_to_remove = IdHash.join(*builds_dependencies) + @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" - requests_dependencies = requests_to_remove.map do |request| - hash_with_filtered = request.ids_of_all_dependencies(dependencies_to_filter, :without_parents) - hash_with_filtered.add(:request, request.id) - end + unless @config.dry_run + nullified_rels = builds_to_remove&.map(&:nullify_default_dependencies)&.flatten + save_nullified_rels_to_file(build: nullified_rels) if @config.if_backup + end - unless @config.dry_run - requests_to_remove.each do |request| - nullify_filtered_dependencies(request) + process_ids_to_remove(ids_to_remove) end - end - ids_to_remove = IdHash.join(*(requests_dependencies)) - @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" - process_ids_to_remove(ids_to_remove) - end + def remove_repo_requests(repository) + threshold = @config.threshold.to_i.months.ago.to_datetime + requests_to_remove = repository.requests.where('created_at < ?', threshold) - private + requests_dependencies = requests_to_remove.map do |request| + hash_with_filtered = request.ids_of_all_dependencies(dependencies_to_filter, :without_parents) + hash_with_filtered.add(:request, request.id) + end - def process_ids_to_remove(ids_to_remove) - if @config.dry_run - @dry_run_reporter.add_to_report(ids_to_remove.with_table_symbols) - else - save_id_hash_to_file(ids_to_remove) if @config.if_backup - ids_to_remove.remove_entries_from_db - end - end + @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" - def nullify_filtered_dependencies(entry) - hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) - filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } - filtered_builds&.each(&:nullify_default_dependencies) - end + unless @config.dry_run + nullified_rels = requests_to_remove.map do |request| + nullify_filtered_dependencies(request) + end.flatten + save_nullified_rels_to_file(build: nullified_rels) if @config.if_backup + end - def time_for_subfolder - Time.now.to_s.parameterize.underscore - end + ids_to_remove = IdHash.join(*(requests_dependencies)) + process_ids_to_remove(ids_to_remove) + end - def dependencies_to_filter - { - build: [ - :repos_for_that_this_build_is_current, - :repos_for_that_this_build_is_last, - :tags_for_that_this_build_is_last, - :branches_for_that_this_build_is_last - ] - } - end + private - def save_and_destroy_requests_batch(requests_batch, repository) - requests_export = requests_batch.map(&:attributes) - file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" - pretty_json = JSON.pretty_generate(requests_export) - if save_file(file_name, pretty_json) - destroy_requests_batch(requests_batch) - end - requests_export - end + def process_ids_to_remove(ids_to_remove) + if @config.dry_run + @dry_run_reporter.add_to_report(ids_to_remove.with_table_symbols) + else + save_id_hash_to_file(ids_to_remove) if @config.if_backup + ids_to_remove.remove_entries_from_db + end + end - def destroy_requests_batch(requests_batch) - return destroy_requests_batch_dry(requests_batch) if @config.dry_run + def save_and_destroy_requests_batch(requests_batch, repository) + requests_export = requests_batch.map(&:attributes) + file_name = "repository_#{repository.id}_requests_#{requests_batch.first.id}-#{requests_batch.last.id}.json" + pretty_json = JSON.pretty_generate(requests_export) + if save_file(file_name, pretty_json) + destroy_requests_batch(requests_batch) + end + requests_export + end - requests_batch.each(&:destroy) - end + def destroy_requests_batch(requests_batch) + return destroy_requests_batch_dry(requests_batch) if @config.dry_run + + requests_batch.each(&:destroy) + end - def destroy_requests_batch_dry(requests_batch) - @dry_run_reporter.add_to_report(:requests, *requests_batch.map(&:id)) + def destroy_requests_batch_dry(requests_batch) + @dry_run_reporter.add_to_report(:requests, *requests_batch.map(&:id)) + end + end end end diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index acd03a8..d933908 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -1,56 +1,51 @@ # frozen_string_literal: true require 'backup/save_id_hash_to_file' +require 'backup/save_nullified_rels_to_file' require 'models/user' require 'models/repository' +require 'backup/remove_specified/shared' -module RemoveWithAllDependencies - include SaveIdHashToFile +class Backup + class RemoveSpecified + module RemoveWithAllDependencies + include SaveIdHashToFile + include SaveNullifiedRelsToFile + include Shared - def remove_user_with_dependencies(user_id) - remove_entry_with_dependencies(:user, user_id) - end + def remove_user_with_dependencies(user_id) + remove_entry_with_dependencies(:user, user_id) + end - def remove_org_with_dependencies(org_id) - remove_entry_with_dependencies(:organization, org_id) - end + def remove_org_with_dependencies(org_id) + remove_entry_with_dependencies(:organization, org_id) + end - def remove_repo_with_dependencies(repo_id) - remove_entry_with_dependencies(:repository, repo_id) - end + def remove_repo_with_dependencies(repo_id) + remove_entry_with_dependencies(:repository, repo_id) + end - private - - def remove_entry_with_dependencies(model_name, id) - @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" - entry = Model.get_model(model_name).find(id) - hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter, :without_parents) - ids_to_remove = hash_with_filtered[:main] - ids_to_remove.add(model_name, id) - - if @config.dry_run - @dry_run_reporter.add_to_report(ids_to_remove) - else - nullify_filtered_dependencies(entry) - save_id_hash_to_file(ids_to_remove) if @config.if_backup - ids_to_remove.remove_entries_from_db(as_last: [:build]) - # order important because of foreign key constraint between builds and repos - end - end + private - def nullify_filtered_dependencies(entry) - hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) - filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } - filtered_builds&.each(&:nullify_default_dependencies) - end + def remove_entry_with_dependencies(model_name, id) + @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" + entry = Model.get_model(model_name).find(id) + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter, :without_parents) + ids_to_remove = hash_with_filtered[:main] + ids_to_remove.add(model_name, id) - def time_for_subfolder - Time.now.to_s.parameterize.underscore - end + return @dry_run_reporter.add_to_report(ids_to_remove) if @config.dry_run + + nullified_rels = { build: nullify_filtered_dependencies(entry) || [] } - def dependencies_to_filter - { - build: Build.default_dependencies_symbols_to_nullify - } + if @config.if_backup + save_nullified_rels_to_file(nullified_rels) + save_id_hash_to_file(ids_to_remove) + end + + ids_to_remove.remove_entries_from_db(as_last: [:build]) + # order important because of foreign key constraint between builds and repos + end + end end end diff --git a/lib/backup/remove_specified/shared.rb b/lib/backup/remove_specified/shared.rb new file mode 100644 index 0000000..63260bf --- /dev/null +++ b/lib/backup/remove_specified/shared.rb @@ -0,0 +1,24 @@ +class Backup + class RemoveSpecified + module Shared + private + + def nullify_filtered_dependencies(entry) + hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter) + filtered_builds = hash_with_filtered[:filtered_out]&.[](:build)&.map { |id| Build.find(id) } + filtered_builds&.map(&:nullify_default_dependencies)&.flatten + end + + def time_for_subfolder + Time.now.to_s.parameterize.underscore + end + + def dependencies_to_filter + { + build: Build.default_dependencies_symbols_to_nullify + } + end + end + end +end + \ No newline at end of file diff --git a/lib/backup/save_nullified_rels_to_file.rb b/lib/backup/save_nullified_rels_to_file.rb new file mode 100644 index 0000000..bac8819 --- /dev/null +++ b/lib/backup/save_nullified_rels_to_file.rb @@ -0,0 +1,29 @@ +require 'backup/save_file' + +module SaveNullifiedRelsToFile + include SaveFile + + def save_nullified_rels_to_file(rels_hash) + @file_index = 1 + + rels_hash.each do |name, rels| + rels.compact.each_slice(@config.limit.to_i) do |rels_batch| + save_rels_batch_to_file(name, rels_batch) + end + end + end + + def save_rels_batch_to_file(name, rels_batch) + model = Model.get_model(name) + + export = {} + export[:table_name] = model.table_name + export[:nullified_relationships] = rels_batch + + content = JSON.pretty_generate(export) + file_name = "nullified_relationships/build_#{@file_index}.json" + @file_index += 1 + file_path = @subfolder.present? ? "#{@subfolder}/#{file_name}" : file_name + save_file(file_path, content) + end +end \ No newline at end of file diff --git a/lib/nullify_dependencies.rb b/lib/nullify_dependencies.rb index 7add18b..6f60041 100644 --- a/lib/nullify_dependencies.rb +++ b/lib/nullify_dependencies.rb @@ -1,15 +1,21 @@ # frozen_string_literal: true module NullifyDependencies - def nullify_dependencies(dependencies_to_nullify) - dependencies_to_nullify.each do |symbol| + def nullify_dependencies(dependencies_symbols_to_nullify) + dependencies_symbols_to_nullify.map do |symbol| dependencies = self.send(symbol) # e.g. build.tags_for_that_this_build_is_last - dependencies.each do |entry| + dependencies.map do |entry| foreign_key = self.class.reflect_on_association(symbol).foreign_key.to_sym entry.update(foreign_key => nil) # e.g. tag.update(last_build_id: nil) + { + related_table: entry.class.table_name, + foreign_key: foreign_key, + parent_id: self.id, + related_id: entry.id + } end - end + end.flatten end def nullify_default_dependencies diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 6f21be3..3b33bd7 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -18,7 +18,7 @@ describe Backup::RemoveSpecified do def get_expected_files(directory, datetime) - Dir["spec/support/expected_files/#{directory}/*.json"].map do |file_path| + Dir["spec/support/expected_files/#{directory}/**/*.json"].map do |file_path| content = File.read(file_path) content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") end @@ -210,7 +210,7 @@ def get_expected_files(directory, datetime) it 'creates needed folders' do path_regexp = Regexp.new("#{random_files_location}/.+") - expect(FileUtils).to receive(:mkdir_p).once.with(path_regexp).and_call_original + expect(FileUtils).to receive(:mkdir_p).with(path_regexp).and_call_original remove_specified.remove_repo_requests(repository) end end diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_1.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_1.json new file mode 100644 index 0000000..2d2b64a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_1.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 20 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 21 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 18 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 19 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 1 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_10.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_10.json new file mode 100644 index 0000000..101c4f1 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_10.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 56 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 32 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 106 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 143, + "related_id": 59 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 58 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_11.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_11.json new file mode 100644 index 0000000..b3dbda1 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_11.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 34 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 107 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 146, + "related_id": 61 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 60 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 35 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_12.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_12.json new file mode 100644 index 0000000..b73dca0 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_12.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 108 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 151, + "related_id": 63 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 62 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 36 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 109 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_13.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_13.json new file mode 100644 index 0000000..b0ab2c0 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_13.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 156, + "related_id": 65 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 64 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 37 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 110 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 161, + "related_id": 85 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_14.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_14.json new file mode 100644 index 0000000..a8b087e --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_14.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 161, + "related_id": 86 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 83 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 84 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 39 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 44 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_15.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_15.json new file mode 100644 index 0000000..90f0626 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_15.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 115 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 120 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 211, + "related_id": 105 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 211, + "related_id": 106 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 103 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_16.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_16.json new file mode 100644 index 0000000..98a736a --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_16.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 104 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 51 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 56 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 127 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 132 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_17.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_17.json new file mode 100644 index 0000000..d2e2aa9 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_17.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 261, + "related_id": 108 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 107 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 63 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 135 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 266, + "related_id": 110 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_18.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_18.json new file mode 100644 index 0000000..803d6f6 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_18.json @@ -0,0 +1,23 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 109 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 64 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 136 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_2.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_2.json new file mode 100644 index 0000000..be7794f --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_2.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 6 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 77 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 82 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 51, + "related_id": 23 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 22 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_3.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_3.json new file mode 100644 index 0000000..9187a39 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_3.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 13 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 85 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 58, + "related_id": 25 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 24 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 14 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_4.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_4.json new file mode 100644 index 0000000..0369249 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_4.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 87 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 63, + "related_id": 27 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 26 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 15 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 88 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_5.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_5.json new file mode 100644 index 0000000..c056257 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_5.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 68, + "related_id": 29 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 28 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 16 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 89 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 73, + "related_id": 31 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_6.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_6.json new file mode 100644 index 0000000..2b3a562 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_6.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 30 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 17 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 90 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 78, + "related_id": 33 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 32 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_7.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_7.json new file mode 100644 index 0000000..dda4205 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_7.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 18 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 92 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 83, + "related_id": 35 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 34 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 19 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_8.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_8.json new file mode 100644 index 0000000..33d14e6 --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_8.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 93 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 54 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 55 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 52 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 53 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_9.json b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_9.json new file mode 100644 index 0000000..2cff1ec --- /dev/null +++ b/spec/support/expected_files/remove_org_with_dependencies/nullified_relationships/build_9.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 20 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 25 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 98 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 103 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 138, + "related_id": 57 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_1.json b/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_1.json new file mode 100644 index 0000000..2d2b64a --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_1.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 20 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 21 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 18 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 19 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 1 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_2.json b/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_2.json new file mode 100644 index 0000000..9a558c9 --- /dev/null +++ b/spec/support/expected_files/remove_repo_builds/nullified_relationships/build_2.json @@ -0,0 +1,29 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 6 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 77 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 82 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 175, + "related_id": 1 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_requests/nullified_relationships/build_1.json b/spec/support/expected_files/remove_repo_requests/nullified_relationships/build_1.json new file mode 100644 index 0000000..ec0dac9 --- /dev/null +++ b/spec/support/expected_files/remove_repo_requests/nullified_relationships/build_1.json @@ -0,0 +1,29 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 51, + "related_id": 23 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 22 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 13 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 85 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_1.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_1.json new file mode 100644 index 0000000..2d2b64a --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_1.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 20 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 21 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 18 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 19 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 1 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_10.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_10.json new file mode 100644 index 0000000..101c4f1 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_10.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 56 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 32 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 106 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 143, + "related_id": 59 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 58 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_11.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_11.json new file mode 100644 index 0000000..b3dbda1 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_11.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 34 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 107 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 146, + "related_id": 61 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 60 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 35 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_12.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_12.json new file mode 100644 index 0000000..b73dca0 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_12.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 108 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 151, + "related_id": 63 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 62 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 36 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 109 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_13.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_13.json new file mode 100644 index 0000000..4dd99bc --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_13.json @@ -0,0 +1,29 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 156, + "related_id": 65 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 64 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 37 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 110 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_2.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_2.json new file mode 100644 index 0000000..be7794f --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_2.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 6 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 77 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 82 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 51, + "related_id": 23 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 22 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_3.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_3.json new file mode 100644 index 0000000..9187a39 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_3.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 13 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 85 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 58, + "related_id": 25 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 24 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 14 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_4.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_4.json new file mode 100644 index 0000000..0369249 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_4.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 87 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 63, + "related_id": 27 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 26 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 15 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 88 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_5.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_5.json new file mode 100644 index 0000000..c056257 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_5.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 68, + "related_id": 29 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 28 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 16 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 89 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 73, + "related_id": 31 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_6.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_6.json new file mode 100644 index 0000000..2b3a562 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_6.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 30 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 17 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 90 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 78, + "related_id": 33 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 32 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_7.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_7.json new file mode 100644 index 0000000..dda4205 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_7.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 18 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 92 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 83, + "related_id": 35 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 34 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 19 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_8.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_8.json new file mode 100644 index 0000000..33d14e6 --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_8.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 93 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 54 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 55 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 52 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 53 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_9.json b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_9.json new file mode 100644 index 0000000..2cff1ec --- /dev/null +++ b/spec/support/expected_files/remove_repo_with_dependencies/nullified_relationships/build_9.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 20 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 25 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 98 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 103 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 138, + "related_id": 57 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_1.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_1.json new file mode 100644 index 0000000..2d2b64a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_1.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 20 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 1, + "related_id": 21 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 18 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 19 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 1 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_10.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_10.json new file mode 100644 index 0000000..101c4f1 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_10.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 56 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 32 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 138, + "related_id": 106 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 143, + "related_id": 59 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 58 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_11.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_11.json new file mode 100644 index 0000000..b3dbda1 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_11.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 34 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 143, + "related_id": 107 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 146, + "related_id": 61 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 60 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 35 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_12.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_12.json new file mode 100644 index 0000000..b73dca0 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_12.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 146, + "related_id": 108 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 151, + "related_id": 63 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 62 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 36 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 151, + "related_id": 109 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_13.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_13.json new file mode 100644 index 0000000..b0ab2c0 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_13.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 156, + "related_id": 65 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 64 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 37 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 156, + "related_id": 110 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 161, + "related_id": 85 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_14.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_14.json new file mode 100644 index 0000000..a8b087e --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_14.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 161, + "related_id": 86 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 83 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 84 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 39 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 44 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_15.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_15.json new file mode 100644 index 0000000..90f0626 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_15.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 115 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 161, + "related_id": 120 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 211, + "related_id": 105 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 211, + "related_id": 106 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 103 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_16.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_16.json new file mode 100644 index 0000000..98a736a --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_16.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 104 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 51 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 56 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 127 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 211, + "related_id": 132 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_17.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_17.json new file mode 100644 index 0000000..d2e2aa9 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_17.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 261, + "related_id": 108 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 107 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 63 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 261, + "related_id": 135 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 266, + "related_id": 110 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_18.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_18.json new file mode 100644 index 0000000..803d6f6 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_18.json @@ -0,0 +1,23 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 109 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 64 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 266, + "related_id": 136 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_2.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_2.json new file mode 100644 index 0000000..be7794f --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_2.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 6 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 77 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 1, + "related_id": 82 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 51, + "related_id": 23 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 22 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_3.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_3.json new file mode 100644 index 0000000..9187a39 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_3.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 13 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 51, + "related_id": 85 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 58, + "related_id": 25 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 24 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 14 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_4.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_4.json new file mode 100644 index 0000000..0369249 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_4.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 58, + "related_id": 87 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 63, + "related_id": 27 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 26 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 15 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 63, + "related_id": 88 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_5.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_5.json new file mode 100644 index 0000000..c056257 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_5.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 68, + "related_id": 29 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 28 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 16 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 68, + "related_id": 89 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 73, + "related_id": 31 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_6.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_6.json new file mode 100644 index 0000000..2b3a562 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_6.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 30 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 17 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 73, + "related_id": 90 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 78, + "related_id": 33 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 32 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_7.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_7.json new file mode 100644 index 0000000..dda4205 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_7.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 18 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 78, + "related_id": 92 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 83, + "related_id": 35 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 34 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 19 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_8.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_8.json new file mode 100644 index 0000000..33d14e6 --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_8.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 83, + "related_id": 93 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 54 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 88, + "related_id": 55 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 52 + }, + { + "related_table": "repositories", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 53 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_9.json b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_9.json new file mode 100644 index 0000000..2cff1ec --- /dev/null +++ b/spec/support/expected_files/remove_user_with_dependencies/nullified_relationships/build_9.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 20 + }, + { + "related_table": "tags", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 25 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 98 + }, + { + "related_table": "branches", + "foreign_key": "last_build_id", + "parent_id": 88, + "related_id": 103 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 138, + "related_id": 57 + } + ] +} \ No newline at end of file From 0eeec4f39866dce1a6013e557f4e50134509fa54 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 16 Nov 2021 13:25:29 +0100 Subject: [PATCH 80/88] saving data during removing orphans, bugs fixed --- lib/backup/load_from_files.rb | 6 ++--- lib/backup/remove_orphans.rb | 24 ++++++++++++++----- .../remove_specified/remove_heavy_data.rb | 4 ++-- .../remove_with_all_dependencies.rb | 2 +- lib/backup/remove_specified/shared.rb | 4 ---- lib/backup/save_file.rb | 4 ++++ lib/backup/save_nullified_rels_to_file.rb | 2 +- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index 9fcc7f6..fead102 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -106,7 +106,7 @@ def load_data_with_offsets repository_entries = @repository_files.map do |data_file| load_file(Repository, data_file) - end.flatten + end.flatten.compact @loaded_entries.concat(repository_entries) end @@ -114,7 +114,7 @@ def load_data_with_offsets def load_file(model, data_file) @touched_models << model - data_file.data_hash.map do |entry_hash| + data_file.data_hash&.map do |entry_hash| load_entry(model, entry_hash) end end @@ -160,7 +160,7 @@ def find_lowest_ids_from_files files.each do |data_file| table_name = data_file.table_name_sym min_id = data_file.lowest_id - @lowest_ids_from_files.add(table_name, min_id) + @lowest_ids_from_files.add(table_name, min_id) if min_id end @lowest_ids_from_files = @lowest_ids_from_files.map { |k, arr| [k, arr.min] }.to_h diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index c597c09..3a332ee 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -1,9 +1,14 @@ # frozen_string_literal: true require 'byebug' +require 'backup/save_id_hash_to_file' +require 'backup/save_nullified_rels_to_file' class Backup class RemoveOrphans + include SaveIdHashToFile + include SaveNullifiedRelsToFile + attr_reader :config def initialize(config, dry_run_reporter=nil) @@ -71,19 +76,26 @@ def check_relationship(args) end def process_ids_to_remove - if @config.dry_run - @dry_run_reporter.add_to_report(@ids_to_remove.with_table_symbols) - else - nullify_builds_dependencies - @ids_to_remove.remove_entries_from_db + return @dry_run_reporter.add_to_report(@ids_to_remove.with_table_symbols) if @config.dry_run + + nullified_rels = nullify_builds_dependencies + + if @config.if_backup + @subfolder = "remove_orphans_#{current_time_for_subfolder}" + save_nullified_rels_to_file(build: nullified_rels) + save_id_hash_to_file(@ids_to_remove) end + + @ids_to_remove.remove_entries_from_db end def nullify_builds_dependencies - @ids_to_remove[:build]&.each do |build_id| + nullified = @ids_to_remove[:build]&.map do |build_id| build = Build.find(build_id) build.nullify_default_dependencies end + + nullified&.flatten || [] end def cases diff --git a/lib/backup/remove_specified/remove_heavy_data.rb b/lib/backup/remove_specified/remove_heavy_data.rb index 1fe3ee9..632a9c2 100644 --- a/lib/backup/remove_specified/remove_heavy_data.rb +++ b/lib/backup/remove_specified/remove_heavy_data.rb @@ -32,7 +32,7 @@ def remove_repo_builds(repository) # rubocop:disable Metrics/AbcSize, Metrics/Me end.compact ids_to_remove = IdHash.join(*builds_dependencies) - @subfolder = "repository_#{repository.id}_old_builds_#{time_for_subfolder}" + @subfolder = "repository_#{repository.id}_old_builds_#{current_time_for_subfolder}" unless @config.dry_run nullified_rels = builds_to_remove&.map(&:nullify_default_dependencies)&.flatten @@ -51,7 +51,7 @@ def remove_repo_requests(repository) hash_with_filtered.add(:request, request.id) end - @subfolder = "repository_#{repository.id}_old_requests_#{time_for_subfolder}" + @subfolder = "repository_#{repository.id}_old_requests_#{current_time_for_subfolder}" unless @config.dry_run nullified_rels = requests_to_remove.map do |request| diff --git a/lib/backup/remove_specified/remove_with_all_dependencies.rb b/lib/backup/remove_specified/remove_with_all_dependencies.rb index d933908..adf986c 100644 --- a/lib/backup/remove_specified/remove_with_all_dependencies.rb +++ b/lib/backup/remove_specified/remove_with_all_dependencies.rb @@ -28,7 +28,7 @@ def remove_repo_with_dependencies(repo_id) private def remove_entry_with_dependencies(model_name, id) - @subfolder = "#{model_name}_#{id}_#{time_for_subfolder}" + @subfolder = "#{model_name}_#{id}_#{current_time_for_subfolder}" entry = Model.get_model(model_name).find(id) hash_with_filtered = entry.ids_of_all_dependencies_with_filtered(dependencies_to_filter, :without_parents) ids_to_remove = hash_with_filtered[:main] diff --git a/lib/backup/remove_specified/shared.rb b/lib/backup/remove_specified/shared.rb index 63260bf..1ff26ad 100644 --- a/lib/backup/remove_specified/shared.rb +++ b/lib/backup/remove_specified/shared.rb @@ -9,10 +9,6 @@ def nullify_filtered_dependencies(entry) filtered_builds&.map(&:nullify_default_dependencies)&.flatten end - def time_for_subfolder - Time.now.to_s.parameterize.underscore - end - def dependencies_to_filter { build: Build.default_dependencies_symbols_to_nullify diff --git a/lib/backup/save_file.rb b/lib/backup/save_file.rb index 39ea579..9ca4e4a 100644 --- a/lib/backup/save_file.rb +++ b/lib/backup/save_file.rb @@ -19,6 +19,10 @@ def save_file(file_path, content) # rubocop:disable Metrics/MethodLength saved end + def current_time_for_subfolder + Time.now.to_s.parameterize.underscore + end + def ensure_path(file_path) path = folder_path(file_path) diff --git a/lib/backup/save_nullified_rels_to_file.rb b/lib/backup/save_nullified_rels_to_file.rb index bac8819..a92c510 100644 --- a/lib/backup/save_nullified_rels_to_file.rb +++ b/lib/backup/save_nullified_rels_to_file.rb @@ -7,7 +7,7 @@ def save_nullified_rels_to_file(rels_hash) @file_index = 1 rels_hash.each do |name, rels| - rels.compact.each_slice(@config.limit.to_i) do |rels_batch| + rels&.compact&.each_slice(@config.limit.to_i) do |rels_batch| save_rels_batch_to_file(name, rels_batch) end end From db7d6e9b4e13de8f1e4cd7a15c7666e6614da2a2 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 16 Nov 2021 14:45:07 +0100 Subject: [PATCH 81/88] saving data during removing orphans tests wip --- spec/backup/remove_orphans_spec.rb | 426 ++++++++++++++---- spec/backup/remove_specified_spec.rb | 7 - .../remove_orphans/branch_3-6.json | 41 ++ .../remove_orphans/build_805-813.json | 155 +++++++ .../remove_orphans/build_814-822.json | 155 +++++++ .../remove_orphans/build_825-826.json | 65 +++ .../remove_orphans/commit_12-12.json | 23 + .../remove_orphans/commit_3-11.json | 95 ++++ .../remove_orphans/cron_3-4.json | 25 + .../remove_orphans/job_829-837.json | 150 ++++++ .../remove_orphans/job_838-838.json | 34 ++ .../nullified_relationships/build_1.json | 35 ++ .../nullified_relationships/build_2.json | 35 ++ .../nullified_relationships/build_3.json | 17 + .../remove_orphans/pull_request_3-4.json | 29 ++ .../remove_orphans/repository_3-8.json | 113 +++++ .../remove_orphans/request_12-16.json | 89 ++++ .../remove_orphans/request_3-11.json | 145 ++++++ .../remove_orphans/stage_3-4.json | 23 + .../remove_orphans/tag_3-8.json | 41 ++ spec/support/utils.rb | 9 +- 21 files changed, 1617 insertions(+), 95 deletions(-) create mode 100644 spec/support/expected_files/remove_orphans/branch_3-6.json create mode 100644 spec/support/expected_files/remove_orphans/build_805-813.json create mode 100644 spec/support/expected_files/remove_orphans/build_814-822.json create mode 100644 spec/support/expected_files/remove_orphans/build_825-826.json create mode 100644 spec/support/expected_files/remove_orphans/commit_12-12.json create mode 100644 spec/support/expected_files/remove_orphans/commit_3-11.json create mode 100644 spec/support/expected_files/remove_orphans/cron_3-4.json create mode 100644 spec/support/expected_files/remove_orphans/job_829-837.json create mode 100644 spec/support/expected_files/remove_orphans/job_838-838.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json create mode 100644 spec/support/expected_files/remove_orphans/pull_request_3-4.json create mode 100644 spec/support/expected_files/remove_orphans/repository_3-8.json create mode 100644 spec/support/expected_files/remove_orphans/request_12-16.json create mode 100644 spec/support/expected_files/remove_orphans/request_3-11.json create mode 100644 spec/support/expected_files/remove_orphans/stage_3-4.json create mode 100644 spec/support/expected_files/remove_orphans/tag_3-8.json diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index 3ccd2f2..0cdd70c 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -10,6 +10,7 @@ require 'pry' require 'database_cleaner/active_record' require 'byebug' +require 'support/utils' describe Backup::RemoveOrphans do before(:all) do @@ -20,6 +21,7 @@ let!(:config) { Config.new(files_location: files_location, limit: 5) } let!(:db_helper) { DbHelper.new(config) } let!(:remove_orphans) { Backup::RemoveOrphans.new(config, DryRunReporter.new) } + let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } describe 'run' do before(:each) do @@ -29,105 +31,355 @@ let!(:data) { db_helper.do_without_triggers do - FactoryBot.create_list(:repository, 2) - FactoryBot.create_list(:build, 2) - FactoryBot.create_list(:job, 2) - FactoryBot.create_list(:branch, 2, repository_id: 1) - FactoryBot.create_list(:tag, 2) - FactoryBot.create_list(:commit, 2) - FactoryBot.create_list(:cron, 2) - FactoryBot.create_list(:pull_request, 2) - FactoryBot.create_list(:request, 2) - FactoryBot.create_list(:stage, 2) - FactoryBot.create_list(:repository_orphaned_on_current_build_id, 2) - FactoryBot.create_list(:repository_with_current_build_id, 2) - FactoryBot.create_list(:repository_orphaned_on_last_build_id, 2) - FactoryBot.create_list(:repository_with_last_build_id, 2) - FactoryBot.create_list(:build_orphaned_on_repository_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_repository_id, 2) - FactoryBot.create_list(:build_orphaned_on_commit_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_commit_id, 2) - FactoryBot.create_list(:build_orphaned_on_request_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_request_id, 2) - FactoryBot.create_list(:build_orphaned_on_pull_request_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_pull_request_id, 2) - FactoryBot.create_list(:build_orphaned_on_branch_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_branch_id, 2) - FactoryBot.create_list(:build_orphaned_on_tag_id_with_mutually_related_repo, 2) - FactoryBot.create_list(:build_with_tag_id, 2) - FactoryBot.create_list(:job_orphaned_on_repository_id, 2) - FactoryBot.create_list(:job_with_repository_id, 2) - FactoryBot.create_list(:job_orphaned_on_commit_id, 2) - FactoryBot.create_list(:job_with_commit_id, 2) - FactoryBot.create_list(:job_orphaned_on_stage_id, 2) - FactoryBot.create_list(:job_with_stage_id, 2) - FactoryBot.create_list(:branch_orphaned_on_repository_id, 2) - FactoryBot.create_list(:branch_orphaned_on_last_build_id, 2) - FactoryBot.create_list(:branch_with_last_build_id, 2) - FactoryBot.create_list(:tag_orphaned_on_repository_id, 2) - FactoryBot.create_list(:tag_with_repository_id, 2) - FactoryBot.create_list(:tag_orphaned_on_last_build_id, 2) - FactoryBot.create_list(:tag_with_last_build_id, 2) - FactoryBot.create_list(:commit_orphaned_on_repository_id, 2) - FactoryBot.create_list(:commit_with_repository_id, 2) - FactoryBot.create_list(:commit_orphaned_on_branch_id, 2) - FactoryBot.create_list(:commit_with_branch_id, 2) - FactoryBot.create_list(:commit_orphaned_on_tag_id, 2) - FactoryBot.create_list(:commit_with_tag_id, 2) - FactoryBot.create_list(:cron_orphaned_on_branch_id, 2) - FactoryBot.create_list(:cron_with_branch_id, 2) - FactoryBot.create_list(:pull_request_orphaned_on_repository_id, 2) - FactoryBot.create_list(:pull_request_with_repository_id, 2) - FactoryBot.create_list(:request_orphaned_on_commit_id, 2) - FactoryBot.create_list(:request_with_commit_id, 2) - FactoryBot.create_list(:request_orphaned_on_pull_request_id, 2) - FactoryBot.create_list(:request_with_pull_request_id, 2) - FactoryBot.create_list(:request_orphaned_on_branch_id, 2) - FactoryBot.create_list(:request_with_branch_id, 2) - FactoryBot.create_list(:request_orphaned_on_tag_id, 2) - FactoryBot.create_list(:request_with_tag_id, 2) - FactoryBot.create_list(:stage_orphaned_on_build_id, 2) - FactoryBot.create_list(:stage_with_build_id, 2) + FactoryBot.create_list( + :repository, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :branch, 2, + repository_id: 1, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :tag, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :cron, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :pull_request, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :stage, 2 + ) + FactoryBot.create_list( + :repository_orphaned_on_current_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :repository_with_current_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :repository_orphaned_on_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :repository_with_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_repository_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_commit_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_commit_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_request_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_request_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_pull_request_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_pull_request_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_branch_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_orphaned_on_tag_id_with_mutually_related_repo, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :build_with_tag_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_orphaned_on_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_with_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_orphaned_on_commit_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_with_commit_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_orphaned_on_stage_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :job_with_stage_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :branch_orphaned_on_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :branch_orphaned_on_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :branch_with_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :tag_orphaned_on_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :tag_with_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :tag_orphaned_on_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :tag_with_last_build_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_orphaned_on_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_with_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_orphaned_on_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_with_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_orphaned_on_tag_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :commit_with_tag_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :cron_orphaned_on_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :cron_with_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :pull_request_orphaned_on_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :pull_request_with_repository_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_orphaned_on_commit_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_with_commit_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_orphaned_on_pull_request_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_with_pull_request_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_orphaned_on_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_with_branch_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_orphaned_on_tag_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :request_with_tag_id, 2, + created_at: datetime, + updated_at: datetime + ) + FactoryBot.create_list( + :stage_orphaned_on_build_id, 2 + ) + FactoryBot.create_list( + :stage_with_build_id, 2 + ) end } - it 'removes orphaned repositories' do - expect { remove_orphans.run }.to change { Repository.all.size }.by -4 - end + shared_context 'removing orphans' do + it 'removes orphaned repositories' do + expect { remove_orphans.run }.to change { Repository.all.size }.by -4 + end - it 'removes orphaned builds' do - expect { remove_orphans.run }.to change { Build.all.size }.by -12 - end + it 'removes orphaned builds' do + expect { remove_orphans.run }.to change { Build.all.size }.by -12 + end - it 'removes orphaned jobs' do - expect { remove_orphans.run }.to change { Job.all.size }.by -6 - end + it 'removes orphaned jobs' do + expect { remove_orphans.run }.to change { Job.all.size }.by -6 + end - it 'removes orphaned branches' do - expect { remove_orphans.run }.to change { Branch.all.size }.by -4 - end + it 'removes orphaned branches' do + expect { remove_orphans.run }.to change { Branch.all.size }.by -4 + end - it 'removes orphaned tags' do - expect { remove_orphans.run }.to change { Tag.all.size }.by -4 - end + it 'removes orphaned tags' do + expect { remove_orphans.run }.to change { Tag.all.size }.by -4 + end - it 'removes orphaned commits' do - expect { remove_orphans.run }.to change { Commit.all.size }.by -6 - end + it 'removes orphaned commits' do + expect { remove_orphans.run }.to change { Commit.all.size }.by -6 + end - it 'removes orphaned crons' do - expect { remove_orphans.run }.to change { Cron.all.size }.by -2 - end + it 'removes orphaned crons' do + expect { remove_orphans.run }.to change { Cron.all.size }.by -2 + end - it 'removes orphaned pull requests' do - expect { remove_orphans.run }.to change { PullRequest.all.size }.by -2 - end + it 'removes orphaned pull requests' do + expect { remove_orphans.run }.to change { PullRequest.all.size }.by -2 + end - it 'removes orphaned requests' do - expect { remove_orphans.run }.to change { Request.all.size }.by -8 + it 'removes orphaned requests' do + expect { remove_orphans.run }.to change { Request.all.size }.by -8 + end + + it 'removes orphaned stages' do + expect { remove_orphans.run }.to change { Stage.all.size }.by -2 + end end - it 'removes orphaned stages' do - expect { remove_orphans.run }.to change { Stage.all.size }.by -2 + it_behaves_like 'removing orphans' + + context 'when if_backup config is set to true' do + it_behaves_like 'removing orphans' + + it 'saves removed data to files in proper format' do + expect_method_calls_on( + File, :write, + get_expected_files('remove_orphans', datetime), + allow_instances: true, + arguments_to_check: :first + ) do + remove_orphans.run + end + end end context 'when dry run mode is on' do diff --git a/spec/backup/remove_specified_spec.rb b/spec/backup/remove_specified_spec.rb index 3b33bd7..8f7d586 100644 --- a/spec/backup/remove_specified_spec.rb +++ b/spec/backup/remove_specified_spec.rb @@ -17,13 +17,6 @@ require 'byebug' describe Backup::RemoveSpecified do - def get_expected_files(directory, datetime) - Dir["spec/support/expected_files/#{directory}/**/*.json"].map do |file_path| - content = File.read(file_path) - content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") - end - end - before(:all) do BeforeTests.new.run end diff --git a/spec/support/expected_files/remove_orphans/branch_3-6.json b/spec/support/expected_files/remove_orphans/branch_3-6.json new file mode 100644 index 0000000..dc2b84f --- /dev/null +++ b/spec/support/expected_files/remove_orphans/branch_3-6.json @@ -0,0 +1,41 @@ +{ + "table_name": "branches", + "data": [ + { + "id": 3, + "repository_id": 2000000000, + "last_build_id": null, + "name": "branch_163", + "exists_on_github": true, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 4, + "repository_id": 2000000000, + "last_build_id": null, + "name": "branch_164", + "exists_on_github": true, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 5, + "repository_id": 1, + "last_build_id": 2000000000, + "name": "branch_165", + "exists_on_github": true, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 6, + "repository_id": 1, + "last_build_id": 2000000000, + "name": "branch_166", + "exists_on_github": true, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_805-813.json b/spec/support/expected_files/remove_orphans/build_805-813.json new file mode 100644 index 0000000..0ff6e70 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/build_805-813.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 805, + "repository_id": 2000000000, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 806, + "repository_id": 2000000000, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 809, + "repository_id": 13, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:53 UTC", + "config": null, + "commit_id": 2000000000, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 810, + "repository_id": 14, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:53 UTC", + "config": null, + "commit_id": 2000000000, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 813, + "repository_id": 15, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": 2000000000, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_814-822.json b/spec/support/expected_files/remove_orphans/build_814-822.json new file mode 100644 index 0000000..1995b34 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/build_814-822.json @@ -0,0 +1,155 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 814, + "repository_id": 16, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": 2000000000, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 817, + "repository_id": 17, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": 2000000000, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 818, + "repository_id": 18, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": 2000000000, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 821, + "repository_id": 19, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 2000000000, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 822, + "repository_id": 20, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": 2000000000, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_825-826.json b/spec/support/expected_files/remove_orphans/build_825-826.json new file mode 100644 index 0000000..ff2d07f --- /dev/null +++ b/spec/support/expected_files/remove_orphans/build_825-826.json @@ -0,0 +1,65 @@ +{ + "table_name": "builds", + "data": [ + { + "id": 825, + "repository_id": 21, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 2000000000, + "sender_id": null, + "sender_type": null + }, + { + "id": 826, + "repository_id": 22, + "number": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-11-16 13:16:54 UTC", + "config": null, + "commit_id": null, + "request_id": null, + "state": null, + "duration": null, + "owner_id": null, + "owner_type": null, + "event_type": null, + "previous_state": null, + "pull_request_title": null, + "pull_request_number": null, + "branch": null, + "canceled_at": null, + "cached_matrix_ids": null, + "received_at": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 2000000000, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/commit_12-12.json b/spec/support/expected_files/remove_orphans/commit_12-12.json new file mode 100644 index 0000000..7862cdb --- /dev/null +++ b/spec/support/expected_files/remove_orphans/commit_12-12.json @@ -0,0 +1,23 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 12, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": null, + "tag_id": 2000000000 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/commit_3-11.json b/spec/support/expected_files/remove_orphans/commit_3-11.json new file mode 100644 index 0000000..c8a942c --- /dev/null +++ b/spec/support/expected_files/remove_orphans/commit_3-11.json @@ -0,0 +1,95 @@ +{ + "table_name": "commits", + "data": [ + { + "id": 3, + "repository_id": 2000000000, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": null, + "tag_id": null + }, + { + "id": 4, + "repository_id": 2000000000, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": null, + "tag_id": null + }, + { + "id": 7, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": 2000000000, + "tag_id": null + }, + { + "id": 8, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": 2000000000, + "tag_id": null + }, + { + "id": 11, + "repository_id": null, + "commit": null, + "ref": null, + "branch": null, + "message": null, + "compare_url": null, + "committed_at": null, + "committer_name": null, + "committer_email": null, + "author_name": null, + "author_email": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "branch_id": null, + "tag_id": 2000000000 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/cron_3-4.json b/spec/support/expected_files/remove_orphans/cron_3-4.json new file mode 100644 index 0000000..eaad39f --- /dev/null +++ b/spec/support/expected_files/remove_orphans/cron_3-4.json @@ -0,0 +1,25 @@ +{ + "table_name": "crons", + "data": [ + { + "id": 3, + "branch_id": 2000000000, + "interval": "test", + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false + }, + { + "id": 4, + "branch_id": 2000000000, + "interval": "test", + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "next_run": null, + "last_run": null, + "dont_run_if_recent_build_exists": false + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/job_829-837.json b/spec/support/expected_files/remove_orphans/job_829-837.json new file mode 100644 index 0000000..4e27164 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/job_829-837.json @@ -0,0 +1,150 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 829, + "repository_id": 2000000000, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 830, + "repository_id": 2000000000, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 833, + "repository_id": null, + "commit_id": 2000000000, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 834, + "repository_id": null, + "commit_id": 2000000000, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": null + }, + { + "id": 837, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 2000000000 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/job_838-838.json b/spec/support/expected_files/remove_orphans/job_838-838.json new file mode 100644 index 0000000..553ddca --- /dev/null +++ b/spec/support/expected_files/remove_orphans/job_838-838.json @@ -0,0 +1,34 @@ +{ + "table_name": "jobs", + "data": [ + { + "id": 838, + "repository_id": null, + "commit_id": null, + "source_id": null, + "source_type": null, + "queue": null, + "type": null, + "state": null, + "number": null, + "config": null, + "worker": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "tags": null, + "allow_failure": false, + "owner_id": null, + "owner_type": null, + "result": null, + "queued_at": null, + "canceled_at": null, + "received_at": null, + "debug_options": null, + "private": null, + "stage_number": null, + "stage_id": 2000000000 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json new file mode 100644 index 0000000..d5e1358 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 805, + "related_id": 11 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 806, + "related_id": 12 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 809, + "related_id": 13 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 810, + "related_id": 14 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 813, + "related_id": 15 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json new file mode 100644 index 0000000..4f6da14 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 814, + "related_id": 16 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 817, + "related_id": 17 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 818, + "related_id": 18 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 821, + "related_id": 19 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 822, + "related_id": 20 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json new file mode 100644 index 0000000..9f2b5e9 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json @@ -0,0 +1,17 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 825, + "related_id": 21 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 826, + "related_id": 22 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/pull_request_3-4.json b/spec/support/expected_files/remove_orphans/pull_request_3-4.json new file mode 100644 index 0000000..0476f27 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/pull_request_3-4.json @@ -0,0 +1,29 @@ +{ + "table_name": "pull_requests", + "data": [ + { + "id": 3, + "repository_id": 2000000000, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 4, + "repository_id": 2000000000, + "number": null, + "title": null, + "state": null, + "head_repo_github_id": null, + "head_repo_slug": null, + "head_ref": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/repository_3-8.json b/spec/support/expected_files/remove_orphans/repository_3-8.json new file mode 100644 index 0000000..0829989 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/repository_3-8.json @@ -0,0 +1,113 @@ +{ + "table_name": "repositories", + "data": [ + { + "id": 3, + "name": null, + "url": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": 2000000000 + }, + { + "id": 4, + "name": null, + "url": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "last_build_id": null, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": 2000000000 + }, + { + "id": 7, + "name": null, + "url": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "last_build_id": 2000000000, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null + }, + { + "id": 8, + "name": null, + "url": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "last_build_id": 2000000000, + "last_build_number": null, + "last_build_started_at": null, + "last_build_finished_at": null, + "owner_name": null, + "owner_email": null, + "active": null, + "description": null, + "last_build_duration": null, + "owner_id": null, + "owner_type": null, + "private": false, + "last_build_state": null, + "github_id": null, + "default_branch": null, + "github_language": null, + "settings": null, + "next_build_number": null, + "invalidated_at": null, + "current_build_id": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/request_12-16.json b/spec/support/expected_files/remove_orphans/request_12-16.json new file mode 100644 index 0000000..0b33761 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/request_12-16.json @@ -0,0 +1,89 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 12, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 2000000000, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 15, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 2000000000, + "sender_id": null, + "sender_type": null + }, + { + "id": 16, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": 2000000000, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/request_3-11.json b/spec/support/expected_files/remove_orphans/request_3-11.json new file mode 100644 index 0000000..8ab4809 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/request_3-11.json @@ -0,0 +1,145 @@ +{ + "table_name": "requests", + "data": [ + { + "id": 3, + "repository_id": null, + "commit_id": 2000000000, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 4, + "repository_id": null, + "commit_id": 2000000000, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 7, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 2000000000, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 8, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": 2000000000, + "branch_id": null, + "tag_id": null, + "sender_id": null, + "sender_type": null + }, + { + "id": 11, + "repository_id": null, + "commit_id": null, + "state": null, + "source": null, + "payload": null, + "token": null, + "config": null, + "started_at": null, + "finished_at": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC", + "event_type": null, + "comments_url": null, + "base_commit": null, + "head_commit": null, + "owner_id": null, + "owner_type": null, + "result": null, + "message": null, + "private": null, + "pull_request_id": null, + "branch_id": 2000000000, + "tag_id": null, + "sender_id": null, + "sender_type": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/stage_3-4.json b/spec/support/expected_files/remove_orphans/stage_3-4.json new file mode 100644 index 0000000..65b5362 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/stage_3-4.json @@ -0,0 +1,23 @@ +{ + "table_name": "stages", + "data": [ + { + "id": 3, + "build_id": 2000000000, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + }, + { + "id": 4, + "build_id": 2000000000, + "number": null, + "name": null, + "state": null, + "started_at": null, + "finished_at": null + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/tag_3-8.json b/spec/support/expected_files/remove_orphans/tag_3-8.json new file mode 100644 index 0000000..1f39adc --- /dev/null +++ b/spec/support/expected_files/remove_orphans/tag_3-8.json @@ -0,0 +1,41 @@ +{ + "table_name": "tags", + "data": [ + { + "id": 3, + "repository_id": 2000000000, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 4, + "repository_id": 2000000000, + "name": null, + "last_build_id": null, + "exists_on_github": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 7, + "repository_id": null, + "name": null, + "last_build_id": 2000000000, + "exists_on_github": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + }, + { + "id": 8, + "repository_id": null, + "name": null, + "last_build_id": 2000000000, + "exists_on_github": null, + "created_at": "2021-04-16 12:16:53 UTC", + "updated_at": "2021-04-16 12:16:53 UTC" + } + ] +} \ No newline at end of file diff --git a/spec/support/utils.rb b/spec/support/utils.rb index 9276c65..f0aef6e 100644 --- a/spec/support/utils.rb +++ b/spec/support/utils.rb @@ -44,4 +44,11 @@ def nullifies_all_orphaned_builds_dependencies? build_ids_to_check.compact! referenced_builds = build_ids_to_check.map { |id| Build.find_by(id: id) } !referenced_builds.include?(nil) -end \ No newline at end of file +end + +def get_expected_files(directory, datetime) + Dir["spec/support/expected_files/#{directory}/**/*.json"].map do |file_path| + content = File.read(file_path) + content.gsub(/"[^"]+ UTC"/, "\"#{datetime.to_s}\"") + end +end From 67bbfc778f3e5d614401ed9e904a58842e946f11 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 16 Nov 2021 14:59:32 +0100 Subject: [PATCH 82/88] wip --- spec/backup/remove_orphans_spec.rb | 12 +++--- .../remove_orphans/branch_3-6.json | 41 ------------------- .../remove_orphans/branch_75-78.json | 41 +++++++++++++++++++ .../{build_814-822.json => build_14-22.json} | 30 +++++++------- .../{build_825-826.json => build_25-26.json} | 12 +++--- .../{build_805-813.json => build_5-13.json} | 30 +++++++------- .../{commit_3-11.json => commit_213-221.json} | 30 +++++++------- ...{commit_12-12.json => commit_222-222.json} | 6 +-- .../remove_orphans/cron_3-4.json | 8 ++-- .../{job_829-837.json => job_29-37.json} | 30 +++++++------- .../{job_838-838.json => job_38-38.json} | 6 +-- .../nullified_relationships/build_1.json | 10 ++--- .../nullified_relationships/build_2.json | 10 ++--- .../nullified_relationships/build_3.json | 4 +- .../remove_orphans/pull_request_3-4.json | 8 ++-- .../remove_orphans/repository_3-8.json | 16 ++++---- .../remove_orphans/request_12-16.json | 12 +++--- .../remove_orphans/request_3-11.json | 20 ++++----- .../{stage_3-4.json => stage_22-23.json} | 4 +- .../remove_orphans/tag_3-8.json | 16 ++++---- 20 files changed, 174 insertions(+), 172 deletions(-) delete mode 100644 spec/support/expected_files/remove_orphans/branch_3-6.json create mode 100644 spec/support/expected_files/remove_orphans/branch_75-78.json rename spec/support/expected_files/remove_orphans/{build_814-822.json => build_14-22.json} (86%) rename spec/support/expected_files/remove_orphans/{build_825-826.json => build_25-26.json} (86%) rename spec/support/expected_files/remove_orphans/{build_805-813.json => build_5-13.json} (86%) rename spec/support/expected_files/remove_orphans/{commit_3-11.json => commit_213-221.json} (76%) rename spec/support/expected_files/remove_orphans/{commit_12-12.json => commit_222-222.json} (78%) rename spec/support/expected_files/remove_orphans/{job_829-837.json => job_29-37.json} (84%) rename spec/support/expected_files/remove_orphans/{job_838-838.json => job_38-38.json} (85%) rename spec/support/expected_files/remove_orphans/{stage_3-4.json => stage_22-23.json} (91%) diff --git a/spec/backup/remove_orphans_spec.rb b/spec/backup/remove_orphans_spec.rb index 0cdd70c..b937f7d 100644 --- a/spec/backup/remove_orphans_spec.rb +++ b/spec/backup/remove_orphans_spec.rb @@ -13,7 +13,7 @@ require 'support/utils' describe Backup::RemoveOrphans do - before(:all) do + before(:each) do BeforeTests.new.run end @@ -24,13 +24,15 @@ let(:datetime) { (Config.new.threshold + 1).months.ago.to_time.utc } describe 'run' do - before(:each) do - DatabaseCleaner.strategy = :truncation - DatabaseCleaner.clean - end + # before(:each) do + # DatabaseCleaner.strategy = :truncation + # DatabaseCleaner.clean + # end let!(:data) { db_helper.do_without_triggers do + FactoryBot.rewind_sequences + FactoryBot.create_list( :repository, 2, created_at: datetime, diff --git a/spec/support/expected_files/remove_orphans/branch_3-6.json b/spec/support/expected_files/remove_orphans/branch_3-6.json deleted file mode 100644 index dc2b84f..0000000 --- a/spec/support/expected_files/remove_orphans/branch_3-6.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "table_name": "branches", - "data": [ - { - "id": 3, - "repository_id": 2000000000, - "last_build_id": null, - "name": "branch_163", - "exists_on_github": true, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" - }, - { - "id": 4, - "repository_id": 2000000000, - "last_build_id": null, - "name": "branch_164", - "exists_on_github": true, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" - }, - { - "id": 5, - "repository_id": 1, - "last_build_id": 2000000000, - "name": "branch_165", - "exists_on_github": true, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" - }, - { - "id": 6, - "repository_id": 1, - "last_build_id": 2000000000, - "name": "branch_166", - "exists_on_github": true, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" - } - ] -} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/branch_75-78.json b/spec/support/expected_files/remove_orphans/branch_75-78.json new file mode 100644 index 0000000..38864c1 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/branch_75-78.json @@ -0,0 +1,41 @@ +{ + "table_name": "branches", + "data": [ + { + "id": 75, + "repository_id": 2000000000, + "last_build_id": null, + "name": "branch_3", + "exists_on_github": true, + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" + }, + { + "id": 76, + "repository_id": 2000000000, + "last_build_id": null, + "name": "branch_4", + "exists_on_github": true, + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" + }, + { + "id": 77, + "repository_id": 1, + "last_build_id": 2000000000, + "name": "branch_5", + "exists_on_github": true, + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" + }, + { + "id": 78, + "repository_id": 1, + "last_build_id": 2000000000, + "name": "branch_6", + "exists_on_github": true, + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_814-822.json b/spec/support/expected_files/remove_orphans/build_14-22.json similarity index 86% rename from spec/support/expected_files/remove_orphans/build_814-822.json rename to spec/support/expected_files/remove_orphans/build_14-22.json index 1995b34..4cbdc0d 100644 --- a/spec/support/expected_files/remove_orphans/build_814-822.json +++ b/spec/support/expected_files/remove_orphans/build_14-22.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 814, + "id": 14, "repository_id": 16, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": 2000000000, @@ -32,13 +32,13 @@ "sender_type": null }, { - "id": 817, + "id": 17, "repository_id": 17, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -62,13 +62,13 @@ "sender_type": null }, { - "id": 818, + "id": 18, "repository_id": 18, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -92,13 +92,13 @@ "sender_type": null }, { - "id": 821, + "id": 21, "repository_id": 19, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -122,13 +122,13 @@ "sender_type": null }, { - "id": 822, + "id": 22, "repository_id": 20, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_825-826.json b/spec/support/expected_files/remove_orphans/build_25-26.json similarity index 86% rename from spec/support/expected_files/remove_orphans/build_825-826.json rename to spec/support/expected_files/remove_orphans/build_25-26.json index ff2d07f..284a4a3 100644 --- a/spec/support/expected_files/remove_orphans/build_825-826.json +++ b/spec/support/expected_files/remove_orphans/build_25-26.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 825, + "id": 25, "repository_id": 21, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -32,13 +32,13 @@ "sender_type": null }, { - "id": 826, + "id": 26, "repository_id": 22, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_805-813.json b/spec/support/expected_files/remove_orphans/build_5-13.json similarity index 86% rename from spec/support/expected_files/remove_orphans/build_805-813.json rename to spec/support/expected_files/remove_orphans/build_5-13.json index 0ff6e70..9f88aba 100644 --- a/spec/support/expected_files/remove_orphans/build_805-813.json +++ b/spec/support/expected_files/remove_orphans/build_5-13.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 805, + "id": 5, "repository_id": 2000000000, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -32,13 +32,13 @@ "sender_type": null }, { - "id": 806, + "id": 6, "repository_id": 2000000000, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "config": null, "commit_id": null, "request_id": null, @@ -62,13 +62,13 @@ "sender_type": null }, { - "id": 809, + "id": 9, "repository_id": 13, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -92,13 +92,13 @@ "sender_type": null }, { - "id": 810, + "id": 10, "repository_id": 14, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -122,13 +122,13 @@ "sender_type": null }, { - "id": 813, + "id": 13, "repository_id": 15, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-11-16 13:16:54 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-11-16 13:58:17 UTC", "config": null, "commit_id": null, "request_id": 2000000000, diff --git a/spec/support/expected_files/remove_orphans/commit_3-11.json b/spec/support/expected_files/remove_orphans/commit_213-221.json similarity index 76% rename from spec/support/expected_files/remove_orphans/commit_3-11.json rename to spec/support/expected_files/remove_orphans/commit_213-221.json index c8a942c..8099953 100644 --- a/spec/support/expected_files/remove_orphans/commit_3-11.json +++ b/spec/support/expected_files/remove_orphans/commit_213-221.json @@ -2,7 +2,7 @@ "table_name": "commits", "data": [ { - "id": 3, + "id": 213, "repository_id": 2000000000, "commit": null, "ref": null, @@ -14,13 +14,13 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": null, "tag_id": null }, { - "id": 4, + "id": 214, "repository_id": 2000000000, "commit": null, "ref": null, @@ -32,13 +32,13 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": null, "tag_id": null }, { - "id": 7, + "id": 217, "repository_id": null, "commit": null, "ref": null, @@ -50,13 +50,13 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": 2000000000, "tag_id": null }, { - "id": 8, + "id": 218, "repository_id": null, "commit": null, "ref": null, @@ -68,13 +68,13 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": 2000000000, "tag_id": null }, { - "id": 11, + "id": 221, "repository_id": null, "commit": null, "ref": null, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/commit_12-12.json b/spec/support/expected_files/remove_orphans/commit_222-222.json similarity index 78% rename from spec/support/expected_files/remove_orphans/commit_12-12.json rename to spec/support/expected_files/remove_orphans/commit_222-222.json index 7862cdb..31bd76f 100644 --- a/spec/support/expected_files/remove_orphans/commit_12-12.json +++ b/spec/support/expected_files/remove_orphans/commit_222-222.json @@ -2,7 +2,7 @@ "table_name": "commits", "data": [ { - "id": 12, + "id": 222, "repository_id": null, "commit": null, "ref": null, @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/cron_3-4.json b/spec/support/expected_files/remove_orphans/cron_3-4.json index eaad39f..a83fd95 100644 --- a/spec/support/expected_files/remove_orphans/cron_3-4.json +++ b/spec/support/expected_files/remove_orphans/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_orphans/job_829-837.json b/spec/support/expected_files/remove_orphans/job_29-37.json similarity index 84% rename from spec/support/expected_files/remove_orphans/job_829-837.json rename to spec/support/expected_files/remove_orphans/job_29-37.json index 4e27164..25dbe4c 100644 --- a/spec/support/expected_files/remove_orphans/job_829-837.json +++ b/spec/support/expected_files/remove_orphans/job_29-37.json @@ -2,7 +2,7 @@ "table_name": "jobs", "data": [ { - "id": 829, + "id": 29, "repository_id": 2000000000, "commit_id": null, "source_id": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 830, + "id": 30, "repository_id": 2000000000, "commit_id": null, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,7 +60,7 @@ "stage_id": null }, { - "id": 833, + "id": 33, "repository_id": null, "commit_id": 2000000000, "source_id": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,7 +89,7 @@ "stage_id": null }, { - "id": 834, + "id": 34, "repository_id": null, "commit_id": 2000000000, "source_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,7 +118,7 @@ "stage_id": null }, { - "id": 837, + "id": 37, "repository_id": null, "commit_id": null, "source_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/job_838-838.json b/spec/support/expected_files/remove_orphans/job_38-38.json similarity index 85% rename from spec/support/expected_files/remove_orphans/job_838-838.json rename to spec/support/expected_files/remove_orphans/job_38-38.json index 553ddca..b6bfa90 100644 --- a/spec/support/expected_files/remove_orphans/job_838-838.json +++ b/spec/support/expected_files/remove_orphans/job_38-38.json @@ -2,7 +2,7 @@ "table_name": "jobs", "data": [ { - "id": 838, + "id": 38, "repository_id": null, "commit_id": null, "source_id": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json index d5e1358..cdaf98f 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json @@ -4,31 +4,31 @@ { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 805, + "parent_id": 5, "related_id": 11 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 806, + "parent_id": 6, "related_id": 12 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 809, + "parent_id": 9, "related_id": 13 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 810, + "parent_id": 10, "related_id": 14 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 813, + "parent_id": 13, "related_id": 15 } ] diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json index 4f6da14..b651986 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json @@ -4,31 +4,31 @@ { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 814, + "parent_id": 14, "related_id": 16 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 817, + "parent_id": 17, "related_id": 17 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 818, + "parent_id": 18, "related_id": 18 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 821, + "parent_id": 21, "related_id": 19 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 822, + "parent_id": 22, "related_id": 20 } ] diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json index 9f2b5e9..aa75288 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json @@ -4,13 +4,13 @@ { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 825, + "parent_id": 25, "related_id": 21 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 826, + "parent_id": 26, "related_id": 22 } ] diff --git a/spec/support/expected_files/remove_orphans/pull_request_3-4.json b/spec/support/expected_files/remove_orphans/pull_request_3-4.json index 0476f27..91a30ce 100644 --- a/spec/support/expected_files/remove_orphans/pull_request_3-4.json +++ b/spec/support/expected_files/remove_orphans/pull_request_3-4.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" }, { "id": 4, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/repository_3-8.json b/spec/support/expected_files/remove_orphans/repository_3-8.json index 0829989..c2aafde 100644 --- a/spec/support/expected_files/remove_orphans/repository_3-8.json +++ b/spec/support/expected_files/remove_orphans/repository_3-8.json @@ -5,8 +5,8 @@ "id": 3, "name": null, "url": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -32,8 +32,8 @@ "id": 4, "name": null, "url": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -59,8 +59,8 @@ "id": 7, "name": null, "url": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, @@ -86,8 +86,8 @@ "id": 8, "name": null, "url": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_orphans/request_12-16.json b/spec/support/expected_files/remove_orphans/request_12-16.json index 0b33761..5b6114b 100644 --- a/spec/support/expected_files/remove_orphans/request_12-16.json +++ b/spec/support/expected_files/remove_orphans/request_12-16.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/request_3-11.json b/spec/support/expected_files/remove_orphans/request_3-11.json index 8ab4809..d408fae 100644 --- a/spec/support/expected_files/remove_orphans/request_3-11.json +++ b/spec/support/expected_files/remove_orphans/request_3-11.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC", + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/stage_3-4.json b/spec/support/expected_files/remove_orphans/stage_22-23.json similarity index 91% rename from spec/support/expected_files/remove_orphans/stage_3-4.json rename to spec/support/expected_files/remove_orphans/stage_22-23.json index 65b5362..b3db832 100644 --- a/spec/support/expected_files/remove_orphans/stage_3-4.json +++ b/spec/support/expected_files/remove_orphans/stage_22-23.json @@ -2,7 +2,7 @@ "table_name": "stages", "data": [ { - "id": 3, + "id": 22, "build_id": 2000000000, "number": null, "name": null, @@ -11,7 +11,7 @@ "finished_at": null }, { - "id": 4, + "id": 23, "build_id": 2000000000, "number": null, "name": null, diff --git a/spec/support/expected_files/remove_orphans/tag_3-8.json b/spec/support/expected_files/remove_orphans/tag_3-8.json index 1f39adc..d9e2f39 100644 --- a/spec/support/expected_files/remove_orphans/tag_3-8.json +++ b/spec/support/expected_files/remove_orphans/tag_3-8.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" }, { "id": 4, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" }, { "id": 7, @@ -25,8 +25,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" }, { "id": 8, @@ -34,8 +34,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 12:16:53 UTC", - "updated_at": "2021-04-16 12:16:53 UTC" + "created_at": "2021-04-16 12:58:17 UTC", + "updated_at": "2021-04-16 12:58:17 UTC" } ] } \ No newline at end of file From 03bc1d04d88a8dc4c51b106055bb0ec19fcd4f98 Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Tue, 16 Nov 2021 19:22:46 +0100 Subject: [PATCH 83/88] bug fixed --- .../remove_orphans/branch_75-78.json | 16 +++++++-------- .../remove_orphans/build_14-22.json | 20 +++++++++---------- .../remove_orphans/build_25-26.json | 8 ++++---- .../remove_orphans/build_5-13.json | 20 +++++++++---------- .../remove_orphans/commit_213-221.json | 20 +++++++++---------- .../remove_orphans/commit_222-222.json | 4 ++-- .../remove_orphans/cron_3-4.json | 8 ++++---- .../remove_orphans/job_29-37.json | 20 +++++++++---------- .../remove_orphans/job_38-38.json | 4 ++-- .../remove_orphans/pull_request_3-4.json | 8 ++++---- .../remove_orphans/repository_3-8.json | 16 +++++++-------- .../remove_orphans/request_12-16.json | 12 +++++------ .../remove_orphans/request_3-11.json | 20 +++++++++---------- .../remove_orphans/tag_3-8.json | 16 +++++++-------- spec/support/factories/build.rb | 3 +++ 15 files changed, 99 insertions(+), 96 deletions(-) diff --git a/spec/support/expected_files/remove_orphans/branch_75-78.json b/spec/support/expected_files/remove_orphans/branch_75-78.json index 38864c1..bf32b5f 100644 --- a/spec/support/expected_files/remove_orphans/branch_75-78.json +++ b/spec/support/expected_files/remove_orphans/branch_75-78.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_3", "exists_on_github": true, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 76, @@ -16,8 +16,8 @@ "last_build_id": null, "name": "branch_4", "exists_on_github": true, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 77, @@ -25,8 +25,8 @@ "last_build_id": 2000000000, "name": "branch_5", "exists_on_github": true, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 78, @@ -34,8 +34,8 @@ "last_build_id": 2000000000, "name": "branch_6", "exists_on_github": true, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_14-22.json b/spec/support/expected_files/remove_orphans/build_14-22.json index 4cbdc0d..2cef9a7 100644 --- a/spec/support/expected_files/remove_orphans/build_14-22.json +++ b/spec/support/expected_files/remove_orphans/build_14-22.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": 2000000000, @@ -37,8 +37,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -67,8 +67,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -97,8 +97,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_25-26.json b/spec/support/expected_files/remove_orphans/build_25-26.json index 284a4a3..8070c51 100644 --- a/spec/support/expected_files/remove_orphans/build_25-26.json +++ b/spec/support/expected_files/remove_orphans/build_25-26.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -37,8 +37,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_5-13.json b/spec/support/expected_files/remove_orphans/build_5-13.json index 9f88aba..f713f7c 100644 --- a/spec/support/expected_files/remove_orphans/build_5-13.json +++ b/spec/support/expected_files/remove_orphans/build_5-13.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -37,8 +37,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": null, @@ -67,8 +67,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -97,8 +97,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -127,8 +127,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-11-16 13:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "config": null, "commit_id": null, "request_id": 2000000000, diff --git a/spec/support/expected_files/remove_orphans/commit_213-221.json b/spec/support/expected_files/remove_orphans/commit_213-221.json index 8099953..68bc968 100644 --- a/spec/support/expected_files/remove_orphans/commit_213-221.json +++ b/spec/support/expected_files/remove_orphans/commit_213-221.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": null, "tag_id": null }, @@ -32,8 +32,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": null, "tag_id": null }, @@ -50,8 +50,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": 2000000000, "tag_id": null }, @@ -68,8 +68,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": 2000000000, "tag_id": null }, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/commit_222-222.json b/spec/support/expected_files/remove_orphans/commit_222-222.json index 31bd76f..c3a8aa2 100644 --- a/spec/support/expected_files/remove_orphans/commit_222-222.json +++ b/spec/support/expected_files/remove_orphans/commit_222-222.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/cron_3-4.json b/spec/support/expected_files/remove_orphans/cron_3-4.json index a83fd95..30104b3 100644 --- a/spec/support/expected_files/remove_orphans/cron_3-4.json +++ b/spec/support/expected_files/remove_orphans/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_orphans/job_29-37.json b/spec/support/expected_files/remove_orphans/job_29-37.json index 25dbe4c..3c4ff08 100644 --- a/spec/support/expected_files/remove_orphans/job_29-37.json +++ b/spec/support/expected_files/remove_orphans/job_29-37.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/job_38-38.json b/spec/support/expected_files/remove_orphans/job_38-38.json index b6bfa90..6b3c460 100644 --- a/spec/support/expected_files/remove_orphans/job_38-38.json +++ b/spec/support/expected_files/remove_orphans/job_38-38.json @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/pull_request_3-4.json b/spec/support/expected_files/remove_orphans/pull_request_3-4.json index 91a30ce..e6e596f 100644 --- a/spec/support/expected_files/remove_orphans/pull_request_3-4.json +++ b/spec/support/expected_files/remove_orphans/pull_request_3-4.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 4, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/repository_3-8.json b/spec/support/expected_files/remove_orphans/repository_3-8.json index c2aafde..0c038aa 100644 --- a/spec/support/expected_files/remove_orphans/repository_3-8.json +++ b/spec/support/expected_files/remove_orphans/repository_3-8.json @@ -5,8 +5,8 @@ "id": 3, "name": null, "url": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -32,8 +32,8 @@ "id": 4, "name": null, "url": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -59,8 +59,8 @@ "id": 7, "name": null, "url": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, @@ -86,8 +86,8 @@ "id": 8, "name": null, "url": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_orphans/request_12-16.json b/spec/support/expected_files/remove_orphans/request_12-16.json index 5b6114b..f022103 100644 --- a/spec/support/expected_files/remove_orphans/request_12-16.json +++ b/spec/support/expected_files/remove_orphans/request_12-16.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/request_3-11.json b/spec/support/expected_files/remove_orphans/request_3-11.json index d408fae..8efece9 100644 --- a/spec/support/expected_files/remove_orphans/request_3-11.json +++ b/spec/support/expected_files/remove_orphans/request_3-11.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC", + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/tag_3-8.json b/spec/support/expected_files/remove_orphans/tag_3-8.json index d9e2f39..5056719 100644 --- a/spec/support/expected_files/remove_orphans/tag_3-8.json +++ b/spec/support/expected_files/remove_orphans/tag_3-8.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 4, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 7, @@ -25,8 +25,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" }, { "id": 8, @@ -34,8 +34,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 12:58:17 UTC", - "updated_at": "2021-04-16 12:58:17 UTC" + "created_at": "2021-04-16 13:58:07 UTC", + "updated_at": "2021-04-16 13:58:07 UTC" } ] } \ No newline at end of file diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 6a88407..27fe7a0 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -49,8 +49,11 @@ created_at: build.created_at, updated_at: build.updated_at ) + Build.record_timestamps = false build.repository_id = repo.id build.save! + Build.record_timestamps = true + build end factory :build_orphaned_on_commit_id_with_mutually_related_repo do From f202adf9c14fd6314d9731abb15a1a651e4c166f Mon Sep 17 00:00:00 2001 From: Karol Selak Date: Wed, 17 Nov 2021 01:25:15 +0100 Subject: [PATCH 84/88] nullifying all dependencies during removing build orphans --- lib/backup/remove_orphans.rb | 2 +- lib/ids_of_all_dependencies.rb | 12 +++++++ lib/nullify_dependencies.rb | 4 +++ .../remove_orphans/branch_75-78.json | 16 ++++----- .../{build_14-22.json => build_20-36.json} | 30 ++++++++-------- .../{build_25-26.json => build_41-44.json} | 12 +++---- .../{build_5-13.json => build_5-17.json} | 24 ++++++------- .../remove_orphans/commit_213-221.json | 20 +++++------ .../remove_orphans/commit_222-222.json | 4 +-- .../remove_orphans/cron_3-4.json | 8 ++--- .../{job_29-37.json => job_49-57.json} | 30 ++++++++-------- .../{job_38-38.json => job_58-58.json} | 6 ++-- .../nullified_relationships/build_1.json | 18 +++++----- .../nullified_relationships/build_2.json | 36 +++++++++---------- .../nullified_relationships/build_3.json | 24 +++++++++++-- .../nullified_relationships/build_4.json | 35 ++++++++++++++++++ .../nullified_relationships/build_5.json | 35 ++++++++++++++++++ .../nullified_relationships/build_6.json | 35 ++++++++++++++++++ .../nullified_relationships/build_7.json | 17 +++++++++ .../remove_orphans/pull_request_3-4.json | 8 ++--- .../remove_orphans/repository_3-8.json | 16 ++++----- .../remove_orphans/request_12-16.json | 12 +++---- .../remove_orphans/request_3-11.json | 20 +++++------ .../remove_orphans/tag_3-8.json | 16 ++++----- spec/support/factories/build.rb | 8 +++++ 25 files changed, 306 insertions(+), 142 deletions(-) rename spec/support/expected_files/remove_orphans/{build_14-22.json => build_20-36.json} (86%) rename spec/support/expected_files/remove_orphans/{build_25-26.json => build_41-44.json} (86%) rename spec/support/expected_files/remove_orphans/{build_5-13.json => build_5-17.json} (87%) rename spec/support/expected_files/remove_orphans/{job_29-37.json => job_49-57.json} (84%) rename spec/support/expected_files/remove_orphans/{job_38-38.json => job_58-58.json} (85%) create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_4.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_5.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_6.json create mode 100644 spec/support/expected_files/remove_orphans/nullified_relationships/build_7.json diff --git a/lib/backup/remove_orphans.rb b/lib/backup/remove_orphans.rb index 3a332ee..bebee7a 100644 --- a/lib/backup/remove_orphans.rb +++ b/lib/backup/remove_orphans.rb @@ -92,7 +92,7 @@ def process_ids_to_remove def nullify_builds_dependencies nullified = @ids_to_remove[:build]&.map do |build_id| build = Build.find(build_id) - build.nullify_default_dependencies + build.nullify_all_dependencies end nullified&.flatten || [] diff --git a/lib/ids_of_all_dependencies.rb b/lib/ids_of_all_dependencies.rb index 48cac25..9f145f9 100644 --- a/lib/ids_of_all_dependencies.rb +++ b/lib/ids_of_all_dependencies.rb @@ -1,6 +1,18 @@ require 'id_hash' +module SymbolsOfAllDirectDependencies + def symbols_of_all_direct_dependencies + self.class.reflect_on_all_associations.map do |association| + next if association.macro == :belongs_to + + association.name + end.compact + end +end + module IdsOfAllDirectDependencies + include SymbolsOfAllDirectDependencies + def ids_of_all_direct_dependencies result = IdHash.new diff --git a/lib/nullify_dependencies.rb b/lib/nullify_dependencies.rb index 6f60041..31b1e40 100644 --- a/lib/nullify_dependencies.rb +++ b/lib/nullify_dependencies.rb @@ -17,6 +17,10 @@ def nullify_dependencies(dependencies_symbols_to_nullify) end end.flatten end + + def nullify_all_dependencies + nullify_dependencies(symbols_of_all_direct_dependencies) + end def nullify_default_dependencies nullify_dependencies(default_dependencies_symbols_to_nullify) diff --git a/spec/support/expected_files/remove_orphans/branch_75-78.json b/spec/support/expected_files/remove_orphans/branch_75-78.json index bf32b5f..50612c0 100644 --- a/spec/support/expected_files/remove_orphans/branch_75-78.json +++ b/spec/support/expected_files/remove_orphans/branch_75-78.json @@ -7,8 +7,8 @@ "last_build_id": null, "name": "branch_3", "exists_on_github": true, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 76, @@ -16,8 +16,8 @@ "last_build_id": null, "name": "branch_4", "exists_on_github": true, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 77, @@ -25,8 +25,8 @@ "last_build_id": 2000000000, "name": "branch_5", "exists_on_github": true, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 78, @@ -34,8 +34,8 @@ "last_build_id": 2000000000, "name": "branch_6", "exists_on_github": true, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/build_14-22.json b/spec/support/expected_files/remove_orphans/build_20-36.json similarity index 86% rename from spec/support/expected_files/remove_orphans/build_14-22.json rename to spec/support/expected_files/remove_orphans/build_20-36.json index 2cef9a7..5c8dd4f 100644 --- a/spec/support/expected_files/remove_orphans/build_14-22.json +++ b/spec/support/expected_files/remove_orphans/build_20-36.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 14, + "id": 20, "repository_id": 16, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": 2000000000, @@ -32,13 +32,13 @@ "sender_type": null }, { - "id": 17, + "id": 25, "repository_id": 17, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -62,13 +62,13 @@ "sender_type": null }, { - "id": 18, + "id": 28, "repository_id": 18, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -92,13 +92,13 @@ "sender_type": null }, { - "id": 21, + "id": 33, "repository_id": 19, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -122,13 +122,13 @@ "sender_type": null }, { - "id": 22, + "id": 36, "repository_id": 20, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_25-26.json b/spec/support/expected_files/remove_orphans/build_41-44.json similarity index 86% rename from spec/support/expected_files/remove_orphans/build_25-26.json rename to spec/support/expected_files/remove_orphans/build_41-44.json index 8070c51..04bfba4 100644 --- a/spec/support/expected_files/remove_orphans/build_25-26.json +++ b/spec/support/expected_files/remove_orphans/build_41-44.json @@ -2,13 +2,13 @@ "table_name": "builds", "data": [ { - "id": 25, + "id": 41, "repository_id": 21, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -32,13 +32,13 @@ "sender_type": null }, { - "id": 26, + "id": 44, "repository_id": 22, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, diff --git a/spec/support/expected_files/remove_orphans/build_5-13.json b/spec/support/expected_files/remove_orphans/build_5-17.json similarity index 87% rename from spec/support/expected_files/remove_orphans/build_5-13.json rename to spec/support/expected_files/remove_orphans/build_5-17.json index f713f7c..c9d8d8e 100644 --- a/spec/support/expected_files/remove_orphans/build_5-13.json +++ b/spec/support/expected_files/remove_orphans/build_5-17.json @@ -7,8 +7,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -37,8 +37,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": null, @@ -67,8 +67,8 @@ "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -92,13 +92,13 @@ "sender_type": null }, { - "id": 10, + "id": 12, "repository_id": 14, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": 2000000000, "request_id": null, @@ -122,13 +122,13 @@ "sender_type": null }, { - "id": 13, + "id": 17, "repository_id": 15, "number": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "config": null, "commit_id": null, "request_id": 2000000000, diff --git a/spec/support/expected_files/remove_orphans/commit_213-221.json b/spec/support/expected_files/remove_orphans/commit_213-221.json index 68bc968..e55ef26 100644 --- a/spec/support/expected_files/remove_orphans/commit_213-221.json +++ b/spec/support/expected_files/remove_orphans/commit_213-221.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": null, "tag_id": null }, @@ -32,8 +32,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": null, "tag_id": null }, @@ -50,8 +50,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": 2000000000, "tag_id": null }, @@ -68,8 +68,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": 2000000000, "tag_id": null }, @@ -86,8 +86,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/commit_222-222.json b/spec/support/expected_files/remove_orphans/commit_222-222.json index c3a8aa2..f7226aa 100644 --- a/spec/support/expected_files/remove_orphans/commit_222-222.json +++ b/spec/support/expected_files/remove_orphans/commit_222-222.json @@ -14,8 +14,8 @@ "committer_email": null, "author_name": null, "author_email": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "branch_id": null, "tag_id": 2000000000 } diff --git a/spec/support/expected_files/remove_orphans/cron_3-4.json b/spec/support/expected_files/remove_orphans/cron_3-4.json index 30104b3..f986850 100644 --- a/spec/support/expected_files/remove_orphans/cron_3-4.json +++ b/spec/support/expected_files/remove_orphans/cron_3-4.json @@ -5,8 +5,8 @@ "id": 3, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false @@ -15,8 +15,8 @@ "id": 4, "branch_id": 2000000000, "interval": "test", - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "next_run": null, "last_run": null, "dont_run_if_recent_build_exists": false diff --git a/spec/support/expected_files/remove_orphans/job_29-37.json b/spec/support/expected_files/remove_orphans/job_49-57.json similarity index 84% rename from spec/support/expected_files/remove_orphans/job_29-37.json rename to spec/support/expected_files/remove_orphans/job_49-57.json index 3c4ff08..f2aa081 100644 --- a/spec/support/expected_files/remove_orphans/job_29-37.json +++ b/spec/support/expected_files/remove_orphans/job_49-57.json @@ -2,7 +2,7 @@ "table_name": "jobs", "data": [ { - "id": 29, + "id": 49, "repository_id": 2000000000, "commit_id": null, "source_id": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -31,7 +31,7 @@ "stage_id": null }, { - "id": 30, + "id": 50, "repository_id": 2000000000, "commit_id": null, "source_id": null, @@ -44,8 +44,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -60,7 +60,7 @@ "stage_id": null }, { - "id": 33, + "id": 53, "repository_id": null, "commit_id": 2000000000, "source_id": null, @@ -73,8 +73,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -89,7 +89,7 @@ "stage_id": null }, { - "id": 34, + "id": 54, "repository_id": null, "commit_id": 2000000000, "source_id": null, @@ -102,8 +102,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, @@ -118,7 +118,7 @@ "stage_id": null }, { - "id": 37, + "id": 57, "repository_id": null, "commit_id": null, "source_id": null, @@ -131,8 +131,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/job_38-38.json b/spec/support/expected_files/remove_orphans/job_58-58.json similarity index 85% rename from spec/support/expected_files/remove_orphans/job_38-38.json rename to spec/support/expected_files/remove_orphans/job_58-58.json index 6b3c460..8bbf4f3 100644 --- a/spec/support/expected_files/remove_orphans/job_38-38.json +++ b/spec/support/expected_files/remove_orphans/job_58-58.json @@ -2,7 +2,7 @@ "table_name": "jobs", "data": [ { - "id": 38, + "id": 58, "repository_id": null, "commit_id": null, "source_id": null, @@ -15,8 +15,8 @@ "worker": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "tags": null, "allow_failure": false, "owner_id": null, diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json index cdaf98f..b2828ff 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_1.json @@ -14,22 +14,22 @@ "related_id": 12 }, { - "related_table": "repositories", - "foreign_key": "current_build_id", + "related_table": "jobs", + "foreign_key": "source_id", "parent_id": 9, - "related_id": 13 + "related_id": 10 }, { - "related_table": "repositories", - "foreign_key": "current_build_id", - "parent_id": 10, - "related_id": 14 + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 9, + "related_id": 11 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 13, - "related_id": 15 + "parent_id": 9, + "related_id": 13 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json index b651986..93f928f 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_2.json @@ -2,34 +2,34 @@ "table_name": "builds", "nullified_relationships": [ { - "related_table": "repositories", - "foreign_key": "current_build_id", - "parent_id": 14, - "related_id": 16 + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 12, + "related_id": 13 }, { - "related_table": "repositories", - "foreign_key": "current_build_id", - "parent_id": 17, - "related_id": 17 + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 12, + "related_id": 14 }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 18, - "related_id": 18 + "parent_id": 12, + "related_id": 14 }, { - "related_table": "repositories", - "foreign_key": "current_build_id", - "parent_id": 21, - "related_id": 19 + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 17, + "related_id": 18 }, { - "related_table": "repositories", - "foreign_key": "current_build_id", - "parent_id": 22, - "related_id": 20 + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 17, + "related_id": 19 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json index aa75288..9197655 100644 --- a/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_3.json @@ -4,14 +4,32 @@ { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 25, + "parent_id": 17, + "related_id": 15 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 20, "related_id": 21 }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 20, + "related_id": 22 + }, { "related_table": "repositories", "foreign_key": "current_build_id", - "parent_id": 26, - "related_id": 22 + "parent_id": 20, + "related_id": 16 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 25, + "related_id": 26 } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_4.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_4.json new file mode 100644 index 0000000..2d23780 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_4.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 25, + "related_id": 27 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 25, + "related_id": 17 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 28, + "related_id": 29 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 28, + "related_id": 30 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 28, + "related_id": 18 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_5.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_5.json new file mode 100644 index 0000000..6fef289 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_5.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 33, + "related_id": 34 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 33, + "related_id": 35 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 33, + "related_id": 19 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 36, + "related_id": 37 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 36, + "related_id": 38 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_6.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_6.json new file mode 100644 index 0000000..f0ca499 --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_6.json @@ -0,0 +1,35 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 36, + "related_id": 20 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 41, + "related_id": 42 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 41, + "related_id": 43 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 41, + "related_id": 21 + }, + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 44, + "related_id": 45 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/nullified_relationships/build_7.json b/spec/support/expected_files/remove_orphans/nullified_relationships/build_7.json new file mode 100644 index 0000000..9b961bf --- /dev/null +++ b/spec/support/expected_files/remove_orphans/nullified_relationships/build_7.json @@ -0,0 +1,17 @@ +{ + "table_name": "builds", + "nullified_relationships": [ + { + "related_table": "jobs", + "foreign_key": "source_id", + "parent_id": 44, + "related_id": 46 + }, + { + "related_table": "repositories", + "foreign_key": "current_build_id", + "parent_id": 44, + "related_id": 22 + } + ] +} \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/pull_request_3-4.json b/spec/support/expected_files/remove_orphans/pull_request_3-4.json index e6e596f..7caa2e9 100644 --- a/spec/support/expected_files/remove_orphans/pull_request_3-4.json +++ b/spec/support/expected_files/remove_orphans/pull_request_3-4.json @@ -10,8 +10,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 4, @@ -22,8 +22,8 @@ "head_repo_github_id": null, "head_repo_slug": null, "head_ref": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" } ] } \ No newline at end of file diff --git a/spec/support/expected_files/remove_orphans/repository_3-8.json b/spec/support/expected_files/remove_orphans/repository_3-8.json index 0c038aa..46e721b 100644 --- a/spec/support/expected_files/remove_orphans/repository_3-8.json +++ b/spec/support/expected_files/remove_orphans/repository_3-8.json @@ -5,8 +5,8 @@ "id": 3, "name": null, "url": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -32,8 +32,8 @@ "id": 4, "name": null, "url": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "last_build_id": null, "last_build_number": null, "last_build_started_at": null, @@ -59,8 +59,8 @@ "id": 7, "name": null, "url": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, @@ -86,8 +86,8 @@ "id": 8, "name": null, "url": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "last_build_id": 2000000000, "last_build_number": null, "last_build_started_at": null, diff --git a/spec/support/expected_files/remove_orphans/request_12-16.json b/spec/support/expected_files/remove_orphans/request_12-16.json index f022103..bd38518 100644 --- a/spec/support/expected_files/remove_orphans/request_12-16.json +++ b/spec/support/expected_files/remove_orphans/request_12-16.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/request_3-11.json b/spec/support/expected_files/remove_orphans/request_3-11.json index 8efece9..0cd4d87 100644 --- a/spec/support/expected_files/remove_orphans/request_3-11.json +++ b/spec/support/expected_files/remove_orphans/request_3-11.json @@ -12,8 +12,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -40,8 +40,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -68,8 +68,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -96,8 +96,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, @@ -124,8 +124,8 @@ "config": null, "started_at": null, "finished_at": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC", + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC", "event_type": null, "comments_url": null, "base_commit": null, diff --git a/spec/support/expected_files/remove_orphans/tag_3-8.json b/spec/support/expected_files/remove_orphans/tag_3-8.json index 5056719..fbd8538 100644 --- a/spec/support/expected_files/remove_orphans/tag_3-8.json +++ b/spec/support/expected_files/remove_orphans/tag_3-8.json @@ -7,8 +7,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 4, @@ -16,8 +16,8 @@ "name": null, "last_build_id": null, "exists_on_github": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 7, @@ -25,8 +25,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" }, { "id": 8, @@ -34,8 +34,8 @@ "name": null, "last_build_id": 2000000000, "exists_on_github": null, - "created_at": "2021-04-16 13:58:07 UTC", - "updated_at": "2021-04-16 13:58:07 UTC" + "created_at": "2021-04-16 23:00:38 UTC", + "updated_at": "2021-04-16 23:00:38 UTC" } ] } \ No newline at end of file diff --git a/spec/support/factories/build.rb b/spec/support/factories/build.rb index 27fe7a0..1fb3a20 100644 --- a/spec/support/factories/build.rb +++ b/spec/support/factories/build.rb @@ -49,6 +49,14 @@ created_at: build.created_at, updated_at: build.updated_at ) + create_list( + :job, 2, + repository: build.repository, + source_type: 'Build', + source_id: build.id, + created_at: build.created_at, + updated_at: build.updated_at + ) Build.record_timestamps = false build.repository_id = repo.id build.save! From ae879ad9a2f7eb929f8bcec5570d1bdbb5565166 Mon Sep 17 00:00:00 2001 From: Karol Selak Travis Date: Thu, 9 Dec 2021 04:46:24 +0100 Subject: [PATCH 85/88] all models required in travis-backup.rb --- lib/travis-backup.rb | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/travis-backup.rb b/lib/travis-backup.rb index e8a2ca3..e30d8e5 100644 --- a/lib/travis-backup.rb +++ b/lib/travis-backup.rb @@ -5,16 +5,37 @@ require 'config' require 'db_helper' require 'dry_run_reporter' +require 'models/abuse' +require 'models/annotation' require 'models/repository' -require 'models/log' require 'models/branch' -require 'models/tag' +require 'models/broadcast' +require 'models/build' require 'models/commit' require 'models/cron' +require 'models/email' +require 'models/invoice' +require 'models/job' +require 'models/log' +require 'models/membership' +require 'models/message' +require 'models/organization' +require 'models/owner_group' +require 'models/permission' require 'models/pull_request' -require 'models/ssl_key' +require 'models/queueable_job' +require 'models/repository' require 'models/request' +require 'models/ssl_key' require 'models/stage' +require 'models/star' +require 'models/subscription' +require 'models/tag' +require 'models/token' +require 'models/trial_allowance' +require 'models/trial' +require 'models/user_beta_feature' +require 'models/user' require 'backup/move_logs' require 'backup/remove_orphans' require 'backup/load_from_files' From 7fc47bcf115bf8f56fd7c1dd7e628f131e6c63a1 Mon Sep 17 00:00:00 2001 From: Karol Selak Travis Date: Thu, 9 Dec 2021 15:08:53 +0100 Subject: [PATCH 86/88] bugs fixed --- lib/models/build.rb | 2 +- lib/models/commit.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/build.rb b/lib/models/build.rb index 129a2f1..1afa328 100644 --- a/lib/models/build.rb +++ b/lib/models/build.rb @@ -9,7 +9,7 @@ class Build < Model belongs_to :repository belongs_to :owner, polymorphic: true belongs_to :sender, polymorphic: true - belongs_to :branch + belongs_to :related_branch, foreign_key: :branch_id, class_name: 'Branch' belongs_to :commit belongs_to :pull_request belongs_to :tag diff --git a/lib/models/commit.rb b/lib/models/commit.rb index 0631246..77dc4b8 100644 --- a/lib/models/commit.rb +++ b/lib/models/commit.rb @@ -3,7 +3,7 @@ require 'model' class Commit < Model - belongs_to :branch + belongs_to :related_branch, foreign_key: :branch_id, class_name: 'Branch' belongs_to :repository belongs_to :tag has_many :builds From bef7f6509bd0f7871f5649ab72a3ec31a91ad758 Mon Sep 17 00:00:00 2001 From: Karol Selak Travis Date: Thu, 9 Dec 2021 19:05:51 +0100 Subject: [PATCH 87/88] load_nullified_relationships --- lib/backup/load_from_files.rb | 70 ++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index fead102..80622b0 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -4,11 +4,17 @@ class Backup class LoadFromFiles + class JsonContent < String + def hash + @hash ||= JSON.parse(self).symbolize_keys + end + end + class DataFile attr_accessor :content - def initialize(content) - @content = content + def initialize(json_content) + @content = json_content end def table_name @@ -19,6 +25,12 @@ def table_name_sym table_name.to_sym end + def full_hash + @content.hash + end + end + + class EntryFile < DataFile def ids @content.scan(/"id":\s?(\d+)/).flatten.map(&:to_i) end @@ -27,12 +39,14 @@ def lowest_id ids.min end - def full_hash - @full_hash ||= JSON.parse(@content).symbolize_keys + def entries + full_hash[:data] end + end - def data_hash - full_hash[:data] + class RelationshipFile < DataFile + def relationships + full_hash[:nullified_relationships] end end @@ -47,10 +61,25 @@ def run load_data_with_offsets cancel_offset_for_foreign_data set_id_sequences + load_nullified_relationships end private + def load_nullified_relationships + relationship_files.each do |file| + file.relationships.each do |rel| + offset = @id_offsets[file.table_name.to_sym] + + ActiveRecord::Base.connection.execute(%{ + update #{rel.related_table} + set #{foreign_key}" = #{parent_id.to_i + offset} + where id = #{related_id.to_i}; + }) + end + end + end + def set_id_sequences @touched_models.each do |model| value = model.last.id + 1 @@ -93,7 +122,7 @@ def cancel_offset_for_foreign_data def load_data_with_offsets @repository_files = [] - @loaded_entries = files.map do |data_file| + @loaded_entries = entry_files.map do |data_file| model = Model.get_model_by_table_name(data_file.table_name) if model == Repository @@ -114,7 +143,7 @@ def load_data_with_offsets def load_file(model, data_file) @touched_models << model - data_file.data_hash&.map do |entry_hash| + data_file.entries&.map do |entry_hash| load_entry(model, entry_hash) end end @@ -147,17 +176,32 @@ def get_table_name(entry_hash, association) Model.get_model(class_name).table_name end - def files - @files ||= Dir["#{@config.files_location}/**/*.json"].map do |file_path| - content = File.read(file_path) - DataFile.new(content) + def file_contents + @file_contents ||= Dir["#{@config.files_location}/**/*.json"].map do |file_path| + JsonContent.new(File.read(file_path)) end end + def entry_files + @entry_files ||= file_contents.map do |content| + next unless content.hash[:data] + + EntryFile.new(content) + end.compact + end + + def relationship_files + @relationship_files ||= file_contents.map do |content| + next if content.hash[:data] + + RelationshipFile.new(content) + end.compact + end + def find_lowest_ids_from_files @lowest_ids_from_files = HashOfArrays.new - files.each do |data_file| + entry_files.each do |data_file| table_name = data_file.table_name_sym min_id = data_file.lowest_id @lowest_ids_from_files.add(table_name, min_id) if min_id From 70c08b554790ebe9ed9922a9ec04497cf8f559b2 Mon Sep 17 00:00:00 2001 From: Karol Selak Travis Date: Thu, 9 Dec 2021 21:42:45 +0100 Subject: [PATCH 88/88] fix --- lib/backup/load_from_files.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/backup/load_from_files.rb b/lib/backup/load_from_files.rb index 80622b0..2a33091 100644 --- a/lib/backup/load_from_files.rb +++ b/lib/backup/load_from_files.rb @@ -46,7 +46,9 @@ def entries class RelationshipFile < DataFile def relationships - full_hash[:nullified_relationships] + @relationships ||= full_hash[:nullified_relationships].map do |rel| + rel.symbolize_keys + end end end @@ -72,9 +74,9 @@ def load_nullified_relationships offset = @id_offsets[file.table_name.to_sym] ActiveRecord::Base.connection.execute(%{ - update #{rel.related_table} - set #{foreign_key}" = #{parent_id.to_i + offset} - where id = #{related_id.to_i}; + update #{rel[:related_table]} + set #{rel[:foreign_key]} = #{rel[:parent_id].to_i + offset} + where id = #{rel[:related_id].to_i}; }) end end