@@ -49,10 +49,6 @@ class Packages::Package < ApplicationRecord
49
49
has_many :nuget_symbols , inverse_of : :package , class_name : 'Packages::Nuget::Symbol'
50
50
has_one :npm_metadatum , inverse_of : :package , class_name : 'Packages::Npm::Metadatum'
51
51
52
- # TODO: Remove with the rollout of the FF terraform_extract_terraform_package_model
53
- # https://gitlab.com/gitlab-org/gitlab/-/issues/490007
54
- has_one :terraform_module_metadatum , inverse_of : :package , class_name : 'Packages::TerraformModule::Metadatum'
55
-
56
52
has_many :build_infos , inverse_of : :package
57
53
has_many :pipelines , through : :build_infos , disable_joins : true
58
54
has_many :matching_package_protection_rules , -> ( package ) { where ( package_type : package . package_type ) . for_package_name ( package . name ) } , through : :project , source : :package_protection_rules
@@ -76,17 +72,11 @@ class Packages::Package < ApplicationRecord
76
72
validates :name , format : { with : Gitlab ::Regex . npm_package_name_regex , message : Gitlab ::Regex . npm_package_name_regex_message } , if : :npm?
77
73
validates :name , format : { with : Gitlab ::Regex . nuget_package_name_regex } , if : :nuget?
78
74
79
- # TODO: Remove with the rollout of the FF terraform_extract_terraform_package_model
80
- # https://gitlab.com/gitlab-org/gitlab/-/issues/490007
81
- validates :name , format : { with : Gitlab ::Regex . terraform_module_package_name_regex } , if : :terraform_module?
82
-
83
75
validates :version , format : { with : Gitlab ::Regex . nuget_version_regex } , if : :nuget?
84
76
validates :version , format : { with : Gitlab ::Regex . maven_version_regex } , if : -> { version? && maven? }
85
77
86
- # TODO: Remove `terraform_module?` condition with the rollout of the FF terraform_extract_terraform_package_model
87
- # https://gitlab.com/gitlab-org/gitlab/-/issues/490007
88
78
validates :version , format : { with : Gitlab ::Regex . semver_regex , message : Gitlab ::Regex . semver_regex_message } ,
89
- if : -> { npm? || terraform_module? }
79
+ if : -> { npm? }
90
80
91
81
scope :for_projects , -> ( project_ids ) { where ( project_id : project_ids ) }
92
82
scope :with_name , -> ( name ) { where ( name : name ) }
@@ -177,7 +167,7 @@ class Packages::Package < ApplicationRecord
177
167
def self . inheritance_column = 'package_type'
178
168
179
169
def self . inheritance_column_to_class_map
180
- hash = {
170
+ {
181
171
ml_model : 'Packages::MlModel::Package' ,
182
172
golang : 'Packages::Go::Package' ,
183
173
rubygems : 'Packages::Rubygems::Package' ,
@@ -187,14 +177,9 @@ def self.inheritance_column_to_class_map
187
177
composer : 'Packages::Composer::Package' ,
188
178
helm : 'Packages::Helm::Package' ,
189
179
generic : 'Packages::Generic::Package' ,
190
- pypi : 'Packages::Pypi::Package'
191
- }
192
-
193
- if Feature . enabled? ( :terraform_extract_terraform_package_model , Feature . current_request )
194
- hash [ :terraform_module ] = 'Packages::TerraformModule::Package'
195
- end
196
-
197
- hash
180
+ pypi : 'Packages::Pypi::Package' ,
181
+ terraform_module : 'Packages::TerraformModule::Package'
182
+ } . freeze
198
183
end
199
184
200
185
def self . only_maven_packages_with_path ( path , use_cte : false )
0 commit comments