diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-18 03:08:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-18 03:08:34 +0300 |
commit | d963ae70e2b8520f22733351e76b3845035ec755 (patch) | |
tree | efeedd53f1e922c71cb25be2fac09642264e9de8 /db | |
parent | 9613d93025008a5326ddb624e2909feaa87e7977 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/docs/software_license_policies.yml | 2 | ||||
-rw-r--r-- | db/docs/software_licenses.yml | 2 | ||||
-rw-r--r-- | db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb | 25 | ||||
-rw-r--r-- | db/post_migrate/20220517144749_remove_vulnerability_approval_rules.rb | 29 | ||||
-rw-r--r-- | db/schema_migrations/20220517144749 | 1 |
5 files changed, 33 insertions, 26 deletions
diff --git a/db/docs/software_license_policies.yml b/db/docs/software_license_policies.yml index 7da6a69651c..478c68d8c59 100644 --- a/db/docs/software_license_policies.yml +++ b/db/docs/software_license_policies.yml @@ -4,6 +4,6 @@ classes: - SoftwareLicensePolicy feature_categories: - license_compliance -description: TODO +description: Allows user to approve or deny the use certain software licenses in their project. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6246 milestone: '11.2' diff --git a/db/docs/software_licenses.yml b/db/docs/software_licenses.yml index 26780aa5ef9..48e78c8ca02 100644 --- a/db/docs/software_licenses.yml +++ b/db/docs/software_licenses.yml @@ -4,6 +4,6 @@ classes: - SoftwareLicense feature_categories: - license_compliance -description: TODO +description: Normalized software licenses to use in conjunction with License Compliance features (like software license policies) introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6246 milestone: '11.2' diff --git a/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb b/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb index 64db4729b3b..f9ad2ba4f0c 100644 --- a/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb +++ b/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb @@ -4,37 +4,14 @@ # for more information on how to write migrations for GitLab. class MigrateVulnerabilityApprovalRules < Gitlab::Database::Migration[2.0] - disable_ddl_transaction! - restrict_gitlab_migration gitlab_schema: :gitlab_main - WORKER_DELAY = 30.seconds - - class ApprovalProjectRule < ActiveRecord::Base - self.table_name = 'approval_project_rules' - end - def up - return unless Gitlab.ee? - - return unless generate_scan_finding_rule_worker - - ApprovalProjectRule.reset_column_information - - # Based on enum report_type: { vulnerability: 1, license_scanning: 2, code_coverage: 3, scan_finding: 4 } - ApprovalProjectRule.where(report_type: 1).find_each.each_with_index do |rule, index| - generate_scan_finding_rule_worker.perform_in(WORKER_DELAY * index, rule.id) - end + # no-op end def down # no-op # Vulnerability-Check feature has been removed as part of 15.0 end - - private - - def generate_scan_finding_rule_worker - @generate_scan_finding_rule_worker ||= "Security::GenerateScanFindingRulesWorker".safe_constantize - end end diff --git a/db/post_migrate/20220517144749_remove_vulnerability_approval_rules.rb b/db/post_migrate/20220517144749_remove_vulnerability_approval_rules.rb new file mode 100644 index 00000000000..83e3784c3aa --- /dev/null +++ b/db/post_migrate/20220517144749_remove_vulnerability_approval_rules.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveVulnerabilityApprovalRules < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class ApprovalProjectRule < MigrationRecord + self.table_name = 'approval_project_rules' + + enum report_type: { vulnerability: 1, license_scanning: 2, code_coverage: 3, scan_finding: 4 } + end + + def up + return unless Gitlab.ee? + + ApprovalProjectRule.reset_column_information + + ApprovalProjectRule.vulnerability.delete_all + end + + def down + # no-op + # Vulnerability-Check feature has been removed as part of 15.0 + end +end diff --git a/db/schema_migrations/20220517144749 b/db/schema_migrations/20220517144749 new file mode 100644 index 00000000000..99f5bf6730a --- /dev/null +++ b/db/schema_migrations/20220517144749 @@ -0,0 +1 @@ +437e4ddcf1e6071a37ab1d407108c98fedd4f93ed1d975d2306440318f67c996
\ No newline at end of file |