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
81c759fb
Commit
81c759fb
authored
Sep 21, 2021
by
Fabio Pitino
Committed by
Dylan Griffith
Sep 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cross-database joins in job token scope code
parent
0c4ab31a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
app/models/ci/job_token/project_scope_link.rb
app/models/ci/job_token/project_scope_link.rb
+1
-1
app/models/ci/job_token/scope.rb
app/models/ci/job_token/scope.rb
+7
-4
spec/support/database/cross-join-allowlist.yml
spec/support/database/cross-join-allowlist.yml
+0
-1
No files found.
app/models/ci/job_token/project_scope_link.rb
View file @
81c759fb
...
...
@@ -5,7 +5,7 @@
module
Ci
module
JobToken
class
ProjectScopeLink
<
ApplicationRecord
class
ProjectScopeLink
<
Ci
::
ApplicationRecord
self
.
table_name
=
'ci_job_token_project_scope_links'
belongs_to
:source_project
,
class_name:
'Project'
...
...
app/models/ci/job_token/scope.rb
View file @
81c759fb
...
...
@@ -32,12 +32,15 @@ module Ci
def
all_projects
Project
.
from_union
([
Project
.
id_in
(
source_project
),
Project
.
where_exists
(
Ci
::
JobToken
::
ProjectScopeLink
.
from_project
(
source_project
)
.
where
(
'projects.id = ci_job_token_project_scope_links.target_project_id'
))
Project
.
id_in
(
target_project_ids
)
],
remove_duplicates:
false
)
end
private
def
target_project_ids
Ci
::
JobToken
::
ProjectScopeLink
.
from_project
(
source_project
).
pluck
(
:target_project_id
)
end
end
end
end
spec/support/database/cross-join-allowlist.yml
View file @
81c759fb
...
...
@@ -121,7 +121,6 @@
-
"
./spec/migrations/schedule_migrate_security_scans_spec.rb"
-
"
./spec/models/ci/build_spec.rb"
-
"
./spec/models/ci/job_artifact_spec.rb"
-
"
./spec/models/ci/job_token/scope_spec.rb"
-
"
./spec/models/ci/pipeline_spec.rb"
-
"
./spec/models/ci/runner_spec.rb"
-
"
./spec/models/clusters/applications/runner_spec.rb"
...
...
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