Add Packages::Debian::GenerateDistributionService
What does this MR do?
This is item 3.1.4 of #5835 (comment 414103286).
Queries
For projects
@distribution.package_files
.preload_debian_file_metadata
.with_debian_component_name(component.name)
.with_debian_architecture_name(architecture.name)
.with_debian_file_type(package_file_type).to_sql
With component.name=main
, architecture.name==amd64
and package_file_type=deb (4)
.
SELECT
"packages_package_files".*
FROM
"packages_package_files"
INNER JOIN "packages_packages" ON "packages_package_files"."package_id" = "packages_packages"."id"
INNER JOIN "packages_debian_publications" ON "packages_packages"."id" = "packages_debian_publications"."package_id"
INNER JOIN "packages_debian_file_metadata" ON "packages_debian_file_metadata"."package_file_id" = "packages_package_files"."id"
WHERE
"packages_debian_publications"."distribution_id" = 2
AND "packages_packages"."package_type" = 9
AND "packages_packages"."version" IS NOT NULL
AND "packages_debian_file_metadata"."component" = 'main'
AND "packages_debian_file_metadata"."architecture" = 'amd64'
AND "packages_debian_file_metadata"."file_type" = 4
Explain : https://explain.depesz.com/s/xQZs
For groups
@distribution.package_files
.preload_debian_file_metadata
.with_debian_component_name(component.name)
.with_debian_architecture_name(architecture.name)
.with_debian_file_type(package_file_type).to_sql
With component.name=main
, architecture.name==amd64
and package_file_type=deb (4)
.
SELECT
"packages_package_files".*
FROM
"packages_package_files"
INNER JOIN "packages_debian_file_metadata" ON "packages_debian_file_metadata"."package_file_id" = "packages_package_files"."id"
WHERE
"packages_package_files"."package_id" IN (
SELECT
"packages_packages"."id"
FROM
"packages_packages"
INNER JOIN "packages_debian_publications" ON "packages_debian_publications"."package_id" = "packages_packages"."id"
INNER JOIN "packages_debian_project_distributions" ON "packages_debian_project_distributions"."id" = "packages_debian_publications"."distribution_id"
WHERE
"packages_packages"."project_id" IN (
SELECT
"projects"."id"
FROM
"projects"
WHERE
"projects"."namespace_id" IN (
SELECT
"namespaces"."id"
FROM
"namespaces"
WHERE (traversal_ids @> ('{10}')))
AND "projects"."visibility_level" = 20)
AND "packages_packages"."package_type" = 9
AND "packages_debian_project_distributions"."codename" = 'unstable')
AND "packages_debian_file_metadata"."component" = 'main'
AND "packages_debian_file_metadata"."architecture" = 'amd64'
AND "packages_debian_file_metadata"."file_type" = 4
Explain: https://explain.depesz.com/s/WBlh
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Mathieu Parent