Skip to content

Debian file metadatum

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

What does this MR do?

This is 2.4.2 of #5835 (comment 414103286), on top of !49217 (merged).

We need to support different Debian file types (see spec/fixtures/packages/debian of !44029 (merged) for an example):

  • .deb files: the most common package files
  • .udeb files: lightened .deb files, used for debian-installer
  • .tar.{gz,bz2,xz,...}: Source files
  • .dsc: Source metadata, and list of source files (with hashes)
  • .buildinfo: Used for Reproducible builds
  • .changes: Upload metadata, and list of uploaded files (all the above)

In a future MR, uploading with dput will send those files, one at a time (a different HTTP request for each), finishing by the changes file. Just-uploaded package files are put in the incoming package. They'll be moved to the target source package once the .changes file is processed.

Please note that component and architecture column type is :text. This ensure we can separate upload and publication.

Database

Migrations

Up Migration

== 20201204105300 CreatePackagesDebianFileMetadata: migrating =================
-- table_exists?(:packages_debian_file_metadata)
   -> 0.0015s
-- create_table(:packages_debian_file_metadata, {})
   -> 0.0457s
-- transaction_open?()
   -> 0.0001s
-- current_schema()
   -> 0.0007s
-- execute("ALTER TABLE packages_debian_file_metadata\nADD CONSTRAINT check_2ebedda4b6\nCHECK ( char_length(component) <= 255 )\nNOT VALID;\n")
   -> 0.0021s
-- current_schema()
   -> 0.0006s
-- execute("SET statement_timeout TO 0")
   -> 0.0013s
-- execute("ALTER TABLE packages_debian_file_metadata VALIDATE CONSTRAINT check_2ebedda4b6;")
   -> 0.0045s
-- execute("RESET ALL")
   -> 0.0016s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0006s
-- execute("ALTER TABLE packages_debian_file_metadata\nADD CONSTRAINT check_e6e1fffcca\nCHECK ( char_length(architecture) <= 255 )\nNOT VALID;\n")
   -> 0.0020s
-- current_schema()
   -> 0.0005s
-- execute("ALTER TABLE packages_debian_file_metadata VALIDATE CONSTRAINT check_e6e1fffcca;")
   -> 0.0039s
== 20201204105300 CreatePackagesDebianFileMetadata: migrated (0.1046s) ========

Down Migration

== 20201204105300 CreatePackagesDebianFileMetadata: reverting =================
-- drop_table(:packages_debian_file_metadata)
   -> 0.0132s
== 20201204105300 CreatePackagesDebianFileMetadata: reverted (0.0134s) ========

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 Mathieu Parent

Merge request reports