Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0b03771a
Commit
0b03771a
authored
Oct 01, 2021
by
Shinya Maeda
Committed by
Lin Jen-Shin
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Delegator Override Validator does not work without DB
parent
02ad2733
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
.gitlab/ci/static-analysis.gitlab-ci.yml
.gitlab/ci/static-analysis.gitlab-ci.yml
+11
-0
lib/gitlab/utils/delegator_override/validator.rb
lib/gitlab/utils/delegator_override/validator.rb
+7
-1
lib/tasks/lint.rake
lib/tasks/lint.rake
+7
-0
No files found.
.gitlab/ci/static-analysis.gitlab-ci.yml
View file @
0b03771a
...
...
@@ -35,6 +35,17 @@ static-analysis:
paths
:
-
tmp/feature_flags/
static-analysis-with-database
:
extends
:
-
.static-analysis-base
-
.static-analysis:rules:ee-and-foss
-
.use-pg12
stage
:
test
script
:
-
bundle exec rake lint:static_verification_with_database
variables
:
SETUP_DB
:
"
true"
static-analysis as-if-foss
:
extends
:
-
static-analysis
...
...
lib/gitlab/utils/delegator_override/validator.rb
View file @
0b03771a
...
...
@@ -51,7 +51,13 @@ module Gitlab
# Workaround to fully load the instance methods in the target class.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69823#note_678887402
target_classes
.
map
(
&
:new
)
rescue
nil
begin
target_classes
.
map
(
&
:new
)
rescue
ArgumentError
# Some models might raise ArgumentError here, but it's fine in this case,
# because this is enough to force ActiveRecord to generate the methods we
# need to verify, so it's safe to ignore it.
end
(
delegator_class
.
instance_methods
-
allowlist
).
each
do
|
method_name
|
target_classes
.
each
do
|
target_class
|
...
...
lib/tasks/lint.rake
View file @
0b03771a
...
...
@@ -12,6 +12,13 @@ unless Rails.env.production?
dev:load
]
do
Gitlab
::
Utils
::
Override
.
verify!
end
desc
"GitLab | Lint | Static verification with database"
task
static_verification_with_database:
%w[
lint:static_verification_env
dev:load
]
do
Gitlab
::
Utils
::
DelegatorOverride
.
verify!
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment