Files
fm-orchestrator/module_build_service/migrations/versions/bf861b6af29a_.py
Jan Kaluza bf0bcaff57 Take the list of arches for -build Koji tag from buildrequired modules.
Currently, we are using just `conf.arches` and `conf.base_module_arches`
to define the list of arches for which the RPMs in a submitted module are
built. This is not enough, because RCM needs to generate modules based
on the base modules which should use different arches.

This commit changes the MBS to take the list of arches from the buildrequired
module build. It checks the buildrequires for "privileged" module or base
module and if it finds such module, it queries the Koji to find out the list
of arches to set for the module.

The "privileged" module is a module which can override base module arches
or disttag. Previously, these modules have been defined by
`allowed_disttag_marking_module_names` config option. In this commit,
this has been renamed to `allowed_privileged_module_names`.

The list of arches are stored per module build in new table represented
by ModuleArch class and are m:n mapped to ModuleBuild.
2019-06-07 13:16:31 +02:00

37 lines
1.1 KiB
Python

"""Add module_arches and module_builds_to_arches tables.
Revision ID: bf861b6af29a
Revises: 65ad4fcdbce6
Create Date: 2019-06-03 13:33:40.540567
"""
# revision identifiers, used by Alembic.
revision = 'bf861b6af29a'
down_revision = '65ad4fcdbce6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('module_arches',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('module_builds_to_arches',
sa.Column('module_build_id', sa.Integer(), nullable=False),
sa.Column('module_arch_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['module_arch_id'], ['module_arches.id'], ),
sa.ForeignKeyConstraint(['module_build_id'], ['module_builds.id'], ),
sa.UniqueConstraint('module_build_id', 'module_arch_id', name='unique_module_to_arch')
)
def downgrade():
op.drop_table('module_builds_to_arches')
op.drop_table('module_arches')