Commit Graph

22 Commits

Author SHA1 Message Date
Brendan Reilly
23f77986e2 Add authentication for product pages 2025-04-29 10:01:31 -04:00
Mike McLean
1236fed8b8 bugfix 2022-11-08 14:39:24 -05:00
Mike McLean
879e3befae combine code for noting params in xmd 2022-11-08 14:39:24 -05:00
Brendan Reilly
6cd10004c8 Add default branch configuration option
Fixes: #1735
2022-04-13 10:42:53 -04:00
Mike McLean
85e5b9c738 don't filter runtime deps for packagerV3 case
Fixes: https://pagure.io/fm-orchestrator/issue/1714
2021-08-26 15:54:10 -04:00
Jan Kaluza
bfd9a13205 Allow overriding RPM components refs while submitting the module build.
There is a need to rebuild the module builds done in CentOS 9 Stream
internally in MBS to include them in RHEL. This is currenly a hard task,
because the RPM components included in a module are usually
taken from HEAD of the branch defined by their `ref` value.

For the rebuild task, it means we would have to ensure that the HEAD
of all RPM components points to right commit hash right before we start
rebuilding CentOS 9 Stream module in internal MBS. This is very hard
and fragile thing to do, especially if there are two different modules
using the RPM component from the same branch. This is prone to race
condition and makes the rebuilds quite complex and in some cases
not possible to do without force pushes to RPM component repositories
which is not acceptable by internal dist-git policy.

This commit fixes it by allowing overriding the commit hash while
submitting the module build. This helps in the mentioned situation,
because we can keep internal RPM components branches in 1:1 sync with
CentOS 9 Stream branches and HEAD can always point to the same commit
in both internal and CentOS 9 Stream repositories.

When the module rebuild is submitted in internal MBS,
we can use this new feature to override the `ref` for each RPM component
so it points to particular commit and the requirement for HEAD to point
to this commit is no longer there.

The `ref` is overriden only internally in MBS (but it is recorded in logs
and in XMD section), so the input modulemd file is not altered. This is
the same logic as used for other overrides (`buildrequire_overrides` or
`side_tag`).

This does not bring any security problem, because it is already possible
to use commit hash in `ref`, so the package maintainer can already change
the commit hash to any particular commit by using this `ref` value.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2021-07-28 08:48:12 +02:00
Martin Curlej
71a44bdfb6 Fixed scratch build suffix bug
When building a scratch build of a module with static context
the scratch suffix was added twice.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-06-16 12:06:14 -04:00
Mike McLean
a8adfd4f74 defer commit of module entry until we set the context and validate 2021-05-13 11:36:53 -04:00
Mike McLean
76e30dd8ad enforce allow_dashes_in_svc at module creation 2021-05-06 12:05:07 -04:00
Mike McLean
42f5f82a89 allow setting multiple schedule task names for product pages
this adds a new setting, product_pages_schedule_task_names, which
is the list version of product_pages_schedule_task_name.
2021-04-22 15:52:19 -04:00
Brendan Reilly
d0579a16c1 Fix mmd.copy calls to support PackagerV3
Fixes #1685
2021-03-10 15:00:42 -05:00
Mike McLean
2115d54030 note side tag in xmd if option is passed 2021-03-10 12:53:44 -05:00
Martin Curlej
7976b1f084 Added the support for the new libmodulemd v3 packager format.
This will enable building modules from the new libmodulemd v3 format.
This format fixes major issue with modularity which enables clear
upgrade paths for multicontext modules.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-03-03 13:01:50 +01:00
Brendan Reilly
a5ea3033ba Handle Product Pages 404s gracefully
Fixes: #1663
2020-12-01 12:16:51 -05:00
Martin Curlej
c139e4cb60 Added the ability to build modules with static contexts
This is a fix and feature in one. This patch enables to use static
contexts instead of module stream expansion. This fixes the issue with
upgrade path issue in dnf.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2020-09-03 09:22:08 +02:00
Brendan Reilly
88597a7c92 Check schedule date when adding new streams 2020-03-05 16:28:42 -05:00
Chenxiong Qi
1c0715662a Cleanup module_build_service/__init__.py
Most of the code are moved to dedicated subpackages, but some others
can't due to the cycle dependencies.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:48 -05:00
Chenxiong Qi
b70c632a70 Send module build state change message after commit to database
In MBS, there are two cases to send a message when a module build moves
to a new state. One is to create a new module build, with
ModuleBuild.create particularly, when user submit a module build.
Another one is to transition a module build to a new state with
ModuleBuild.transition. This commit handles these two cases in a little
different ways.

For the former, existing code is refactored by moving the publish call
outside ModuleBuild.create.

For the latter, message is sent in a hook of SQLAlchemy ORM event
after_commit rather than immediately inside the ModuleBuild.transition.

Both of these changes ensure the message is sent after the changes are
committed into database successfully. Then, the backend can have
confidence that the database has the module build data when receive a
message.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
mprahl
81f2bffdda Rearrange the imports to meet the style guide
This also includes `from __future__ import absolute_import`
in every file so that the imports are consistent in Python 2 and 3.
The Python 2 tests fail without this.
2020-03-03 14:48:47 -05:00
mprahl
9ddb35b8d3 Move models.py to common/models.py and views.py to web/views.py 2020-03-03 14:48:47 -05:00
mprahl
d9f32bff9d Move errors.py to common/errors.py 2020-03-03 14:48:47 -05:00
mprahl
96b0c85927 Split utils/submit.py
This moves the code used by the backend and API to common/submit.py,
the code used just by the API to web/submit.py, and the code used
just by the backend to scheduler/submit.py.
2020-03-03 14:48:47 -05:00