Commit Graph

509 Commits

Author SHA1 Message Date
Chenxiong Qi
db4dbe3b25 Remove unused parameter session
_get_mmds_from_requires does not do anything against db.session. Hence,
remove parameter session from it and
get_mmds_required_by_module_recursively.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-22 11:48:04 +08:00
Chenxiong Qi
20de3d2e94 Make _make_module reusable
TestUtilsModuleStreamExpansion._make_module is moved to
tests/__init__.py so that other tests could reuse this to create a
module build.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-19 15:58:47 +08:00
Jan Kaluza
192eaae012 Support Virtual Streams in MMDResolver.
Modularity team needs to be able to define multiple streams for single "platform"
module. They need it to express that "platform:el8.1.0" also provides "platform:el8".

This needs changes in a way how MMDResolver resolves dependencies between modules.

For example, if we are building module against platform:el8.1.0, the MMDResolver must
not return buildrequired module built against platform > el8.1.0, but it can for example
return (cherry-pick) buildrequired module from platform:el8.0.0 if there is no such
module built for platform:el8.1.0.

The way how it is implemented is following:

  - MMDResolver reads list of virtual streams from xmd["mbs"]["virtual_streams"] when
    creating Solvable from MMD and adds additional Provides for these virtual streams.
    We expect these to be set mainly on base modules. The versions of such provides
    are based on "stream version" number, so we can compare them.
  - The base module ("platform") buildrequires of MMDs added to MMDResolver are overriden
    to mark particular platform "stream version". For example, if module "foo" buildrequires
    "platform:el8" in MMD file, but was in fact built against platform:el8.1.0, it will
    be treated as if it would really buildrequire "platform:el8.1.0". This is needed
    to not include buildrequired modules built against newer platform than what we want.
  - MMDResolver resolves all the valid combinations of buildrequires, but we are only
    interested in the one with latest versions of buildrequired module. Therefore the
    solve() method is changed to find out combinations which have the latest versions
    for each alternative name:stream buildrequires.
2018-10-18 15:06:04 +02:00
mprahl
599c881714 Add the ability to query by the base modules a module build buildrequires
Future use cases will require the ability to find compatible module builds
to buildrequire based on the base module the module used to build. This
commit adds an association table that will contain module build IDs
and the base module they buildrequire.

Addresses FACTORY-3353
2018-10-17 07:47:31 -04:00
mprahl
4f9fffff3b Move some of the logic in get_prefixed_version to a ModuleBuild static method
The logic used to parse the stream version will need to be reused elsewhere
to support the filtering and ordering of a base module stream version.
2018-10-16 10:26:39 -04:00
Valerij Maljulin
8ee7168017 get_reusable_component now checks the architecture
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2018-10-16 13:44:18 +02:00
Jan Kaluža
2c29d9095e Merge #1040 Fix wrong inclusion of non-multilib packages in final MMD. 2018-10-16 07:10:33 +00:00
Jan Kaluza
bcb104a16a Fix wrong inclusion of non-multilib packages in final MMD.
The original Pungi code, on which MBS code is based on, always passed only RPMs
with valid architectures to further decide if their subset should end up in a
final modulemd file.

In MBS, we pass RPMs with all architecture and there was no code to actually filter
out the RPMs which are from architectures which should never end up in a final MMD.

This commit checks that RPMs for completely different architectures will never
be considered to be included in a final MMD.
2018-10-16 09:08:14 +02:00
Valerij Maljulin
7f60db545a renaming koji_arches to arches
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2018-10-15 15:29:50 +02:00
Valerij Maljulin
924a0951fb add architectures support for format_mmd 2018-10-15 15:29:50 +02:00
mprahl
117791ee16 Prefix the component disttag with the platform stream 2018-10-04 07:19:07 -04:00
mprahl
cfb75b4d0f Prefix the module version based on the platform it buildrequires 2018-10-04 07:19:07 -04:00
Matt Prahl
456ab29c8e Merge #1031 Fix filtering noarch RPMs 2018-10-02 16:58:54 +00:00
Jan Kaluza
4d0d0cb0df Add test for filtering noarch RPMs with excludearch and multilib. 2018-10-02 07:38:55 +02:00
Jan Kaluža
d5747b19eb Merge #1026 Add singleton system_resolver 2018-10-01 14:11:33 +00:00
Chenxiong Qi
0a15989f88 Add koji_tag into resolved buildrequires
This is useful for an issue I'm working on, for which I need to get
platform module's koji_tag.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-28 12:09:07 +08:00
Chenxiong Qi
520a979d3d Add singleton system_resolver
system_resolver is created based on loaded configuration, which could
avoid calls like `GenericResolver.create(conf)` repeatedly in the code.

However, if some cases need to create a specific resolver explicitly,
`GenericResolver.create` could be called with addition argument, for
example db or mbs is passed to argument backend in tests.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-28 11:00:52 +08:00
Jan Kaluza
f0cdb5030d Set modulemd 'arch' field in arch-specific modulemd files imported to CG build. 2018-09-24 09:45:43 +02:00
Chenxiong Qi
2d162b97a1 Replace dup_nsvc() in test_mbs.py
dup_nsvc prints version in hexadecimal instead of integer. This is found
in libmodulemd 1.6.2 f28 build. This bug has been fixed in upstream but
not release yet. Before the release, this patch formats NSVC manually to
workaround it.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-13 11:41:20 +08:00
Jan Kaluza
410f65ac3c Get the RPM license headers from Koji and use it to fill the MMD content licenses field. 2018-09-12 07:45:46 +02:00
Jan Kaluza
0d66adbc17 Add list of built RPMs to architecture specific modulemd files in CG builds. 2018-09-12 07:45:46 +02:00
Jan Kaluza
19e9febec9 Attach architecture specific mmd files to content generator build, for now without arch-specific data. 2018-09-12 07:45:46 +02:00
mprahl
586767e59e Fix the unit tests 2018-09-11 09:26:01 -04:00
Filip Valder
598347e1b6 Import module API 2018-09-07 17:12:01 +02:00
Ralph Bean
e7089d7be0 Rename this to be PDC-agnostic. 2018-09-04 09:51:56 -04:00
Ralph Bean
0aff640ef3 Optionally, block building modules with EOL streams.
Requested by @mboddu in:

- https://pagure.io/fm-orchestrator/issue/960
- https://pagure.io/modularity/issue/102
2018-08-31 15:23:04 -04:00
Martin Curlej
5a3d3d99d3 ISSUE-991: Added a method to the producer that will move stuck builds into 'failed' state
Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2018-08-30 16:02:24 +02:00
Jan Kaluza
dad03d3742 Copy the buildrequires which are not in requires list to expanded MMD. 2018-08-28 15:15:58 +02:00
Jan Kaluza
56fe201c33 Fill in the 'filterer_rpms' in backend to not access Koji from frontend. 2018-08-21 07:58:52 +02:00
Jan Kaluza
f0b35be067 Add BASE_MODULE_KOJI_ARCHES to override default Koji arches. 2018-08-14 13:18:56 +02:00
mprahl
d54422adeb Don't filter RPMs of reused components from a module that depends on itself
If a module has filters set and it buildrequires itself, issues occur
during component reuse. In that event, the filtered RPMs from the
previous module build will not be available in the buildroot because the NVRs
in the filters will match the RPMs from the reused component.

Co-authored-by: Jan Kaluza <jkaluza@redhat.com>
2018-08-13 11:13:40 -04:00
Jan Kaluza
6d2e4bbffa Fix filters generation 2018-08-09 15:16:13 +02:00
mprahl
5197eb4912 Revert "Use the libmodulemd API properly when setting values on existing objects"
This reverts commit 8173040ea6. Since it didn't
provide any real benefit after talking with sgallagh, it seems like we'd better
off not introduce more risk to the next deployment.
2018-08-07 12:03:44 -04:00
mprahl
f08135352a Use the NVR instead of the component name when responding to a tag message
This addresses an issue when a module contains builds that have different
names in their NVR than the component name in MBS. This happens with
SCLs for instance. MBS wouldn't be able to find the component to mark
as tagged in the database since it was searching by the wrong name, so the
build would just stall. This uses the NVR now to find the correct build
in the database.
2018-08-07 11:54:28 -04:00
mprahl
8a54b26fd7 Expose the NVR of component builds in the API to help future debugging 2018-08-07 10:33:14 -04:00
mprahl
a78c564073 Revert "Store the component's build ID and use that to identify the build when acting on a tag message"
This reverts commit 9bd16beeef.
2018-08-07 10:32:50 -04:00
mprahl
9bd16beeef Store the component's build ID and use that to identify the build when acting on a tag message
This resolves an issue where the component name is different than the
package being tagged due to a macro such as those used for SCLs.
2018-08-03 20:45:00 -04:00
mprahl
8173040ea6 Use the libmodulemd API properly when setting values on existing objects
MBS has been using the libmodulemd API incorrectly by assuming that
methods like `get_rpm_components` return the actual object in memory
and not a copy. This has been true but wasn't something sgallagh
intended. We found this out after he had me test his new version of
libmodulemd. This PR removes those assumptions.
2018-07-17 09:00:42 -04:00
mprahl
1ec9849960 Fix the unit tests for TestMBSModule 2018-07-16 17:57:08 -04:00
Martin Curlej
dfe7660519 Removed PDC dependency from MBS and replaced it with MBS prod instance.
Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Removed pdc from comments.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Adding missing files.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Updated PR according to review.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Local modules builds now

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Removed copr from config

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Fixed bugs

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2018-07-04 10:13:18 +02:00
Mikolaj Izdebski
0d29633da9 Make repo_include_all setting configurable in xmd
Previously MBS configured all Koji build tags with
repo_include_all=True extra option.  But for some modules it was
desired to be able to have tags with repo_include_all=False.

Fixes #957
2018-06-29 17:06:58 +02:00
mprahl
36a9026ca8 Remove references to COPR 2018-06-28 10:00:06 -04:00
Matt Prahl
6e075951b8 Merge #962 Support the modulemd buildopts.rpms.whitelist option 2018-06-27 11:42:49 +00:00
mprahl
74e4c99984 Support the modulemd buildopts.rpms.whitelist option 2018-06-27 07:05:06 -04:00
Martin Curlej
0aa9f014ce Added search for modules by binary rpm.
Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Updated PR according to review.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Searching by multiple koji tags + tests

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2018-06-26 15:52:37 +02:00
Ralph Bean
6981449853 Fix local builds.
I discovered that local builds have been broken by recent (good) changes in
dnf.  At the end of every batch, we regenerate the local repo with createrepo
and we also call modifyrepo to include the modulemd file as we progress.  This
was added in #467.

What we really want, is for the modulemd file to be present at the *end* of the
build.

Recently, dnf started respecting the modulemd file natively, such that builds
we built in batch0 would not show up in batch1.  They would be present in the
repo, but they would be marked as belonging to a module which was not enabled,
and so could not be pulled in.  Every module build would fail because
module-srpm-macros was in a disabled module (the module being built at the
time).

This change makes it so that the module metadata is only added to the repo at
the very end of the build.  I moved it into a `finalize` method on the builder
which the copr builder was using, and for symmetry's sake I moved the koji
content generator code to the same method on that builder.

There was a circular import issue to solve between the koji module builder and
the koji content generator modules that generated a larger diff, but is mostly
cosmetic and mock changes.
2018-06-25 17:05:22 -04:00
Mikolaj Izdebski
a22f663d4a Add reproducer for #954 2018-06-18 14:17:13 +02:00
Matt Prahl
5e12152acd Merge #952 Get buildrequired modules for koji tag inheritance using NSVC, not just NSV. 2018-06-15 00:38:46 +00:00
Matt Prahl
764c467c1d Merge #950 New: Support querying of modules/components with multiple state value filtering 2018-06-15 00:36:33 +00:00
Jan Kaluza
ddbeb0aca7 Get buildrequired modules for koji tag inheritance using NSVC, not just NSV. 2018-06-14 11:37:52 +02:00