Skip to content

Debian component files

Mathieu Parent requested to merge sathieu/gitlab:debian_component_files into master

What does this MR do?

Debian Group and Project Distribution Component Files.

This is item 2.4.7 of #5835 (comment 414103286)

We allow several component files for the same (component_id, file_type, architecture) tuple, to allow future support for Acquire-By-Hash. The current component file for a given tuple is the latest created (no need for an outdated column).

Repository format is documented at https://wiki.debian.org/DebianRepository/Format.

Database

Migrations

Up

== 20201204111400 CreatePackagesDebianProjectComponentFiles: migrating ========
-- table_exists?(:packages_debian_project_component_files)
   -> 0.0006s
-- create_table(:packages_debian_project_component_files, {})
   -> 0.0221s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE packages_debian_project_component_files\nADD CONSTRAINT check_e5af03fa2d\nCHECK ( char_length(file) <= 255 )\nNOT VALID;\n")
   -> 0.0006s
-- current_schema()
   -> 0.0002s
-- execute("SET statement_timeout TO 0")
   -> 0.0002s
-- execute("ALTER TABLE packages_debian_project_component_files VALIDATE CONSTRAINT check_e5af03fa2d;")
   -> 0.0006s
-- execute("RESET ALL")
   -> 0.0002s
== 20201204111400 CreatePackagesDebianProjectComponentFiles: migrated (0.0371s)

== 20201204111500 CreatePackagesDebianGroupComponentFiles: migrating ==========
-- table_exists?(:packages_debian_group_component_files)
   -> 0.0006s
-- create_table(:packages_debian_group_component_files, {})
   -> 0.0232s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0003s
-- execute("ALTER TABLE packages_debian_group_component_files\nADD CONSTRAINT check_839e1685bc\nCHECK ( char_length(file) <= 255 )\nNOT VALID;\n")
   -> 0.0007s
-- current_schema()
   -> 0.0004s
-- execute("SET statement_timeout TO 0")
   -> 0.0002s
-- execute("ALTER TABLE packages_debian_group_component_files VALIDATE CONSTRAINT check_839e1685bc;")
   -> 0.0007s
-- execute("RESET ALL")
   -> 0.0003s
== 20201204111500 CreatePackagesDebianGroupComponentFiles: migrated (0.0368s) =

Down

== 20201204111500 CreatePackagesDebianGroupComponentFiles: reverting ==========
-- drop_table(:packages_debian_group_component_files)
   -> 0.0083s
== 20201204111500 CreatePackagesDebianGroupComponentFiles: reverted (0.0085s) =

== 20201204111400 CreatePackagesDebianProjectComponentFiles: reverting ========
-- drop_table(:packages_debian_project_component_files)
   -> 0.0132s
== 20201204111400 CreatePackagesDebianProjectComponentFiles: reverted (0.0133s)

Queries

See !52885 (comment 497319081) for explain plans and explanation. See https://gitlab.com/gitlab-org/gitlab/-/blob/e640d0d05a75a7969b06458bfa785aa3c739317a/lib/api/concerns/packages/debian_endpoints.rb#L235-257 for the API endpoint (to be in upcoming MR) where this query will be used.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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 Steve Abrams

Merge request reports