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
3e709662
Commit
3e709662
authored
Oct 19, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Pipeline.environments for cross-db query
parent
05c38cf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
spec/support/database/cross-join-allowlist.yml
spec/support/database/cross-join-allowlist.yml
+0
-2
No files found.
app/models/ci/pipeline.rb
View file @
3e709662
...
...
@@ -71,7 +71,7 @@ module Ci
has_many
:trigger_requests
,
dependent: :destroy
,
foreign_key: :commit_id
# rubocop:disable Cop/ActiveRecordDependent
has_many
:variables
,
class_name:
'Ci::PipelineVariable'
has_many
:deployments
,
through: :builds
has_many
:environments
,
->
{
distinct
},
through: :deployments
has_many
:environments
,
->
{
distinct
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/338658'
)
},
through: :deployments
has_many
:latest_builds
,
->
{
latest
.
with_project_and_metadata
},
foreign_key: :commit_id
,
inverse_of: :pipeline
,
class_name:
'Ci::Build'
has_many
:downloadable_artifacts
,
->
do
not_expired
.
or
(
where_exists
(
::
Ci
::
Pipeline
.
artifacts_locked
.
where
(
'ci_pipelines.id = ci_builds.commit_id'
))).
downloadable
.
with_job
...
...
spec/support/database/cross-join-allowlist.yml
View file @
3e709662
...
...
@@ -50,8 +50,6 @@
-
"
./spec/requests/api/graphql/packages/pypi_spec.rb"
-
"
./spec/requests/api/graphql/project/packages_spec.rb"
-
"
./spec/requests/api/package_files_spec.rb"
-
"
./spec/services/environments/stop_service_spec.rb"
-
"
./spec/services/merge_requests/post_merge_service_spec.rb"
-
"
./spec/services/packages/conan/create_package_file_service_spec.rb"
-
"
./spec/services/packages/create_package_file_service_spec.rb"
-
"
./spec/services/packages/generic/create_package_file_service_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