Commit Graph

1979 Commits

Author SHA1 Message Date
Chenxiong Qi
ec28f9aa00 Remove unused parameter scm from submit_module_build
submit_module_build creates new module build and set parameter url to
ModuleBuild.scmurl. It looks scm.url could be passed to scmurl as well,
but scm is not used through out whole method. url is enough for the
purpose, hence scm is removed.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-22 16:51:03 +08:00
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
Matt Prahl
a33e082646 Merge #1038 Add the ability to query by the base modules a module build buildrequires 2018-10-17 13:58:55 +00: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
mprahl
7a2ea6f366 Correct the docstrings for resolve_requires 2018-10-16 09:32:50 -04:00
Matt Prahl
8ef445c0b2 Merge #1041 get_reusable_component now checks the architecture 2018-10-16 13:24:09 +00: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
Matt Prahl
e7c3427e3b Merge #1042 Fix a comment according to relative code 2018-10-16 11:20:56 +00:00
Chenxiong Qi
f6740c4867 Fix a comment according to relative code
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-16 17:11:49 +08: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
f27add3659 Release v2.7.0 v2.7.0 2018-10-12 07:41:33 -04:00
Matt Prahl
8f79c2f45c Merge #1035 MBSResolver: only return the latest version for get_module_modulemds() 2018-10-12 11:29:13 +00:00
Ralph Bean
f54073ebf7 Minor adjustments. 2018-10-10 16:34:20 -04:00
Jan Kaluza
fd0fb5520c Add doc describing how mbs works internally when building modules. 2018-10-10 16:34:20 -04:00
mprahl
a42dd0d58d Merge "MockModuleBuilder: Don't run the final createrepo if the module build failed" 2018-10-10 08:00:31 -04:00
Owen W. Taylor
b31fb65cef MockModuleBuilder: Don't run the final createrepo if the module build failed
The build steps assume that the the repository for the build is non-modular,
so after the final createrepo is run with include_module_yaml=True, it's
impossible to repeat a build steps. Running mock -c <failed_config> build is
quite useful for debugging a failed build (even though it's hard to find the
right config) - skipping the final createrepo step for failed module builds
makes it work as expected.
2018-10-06 10:33:37 -04:00
Owen W. Taylor
3d3e4121cc MBSResolver: only return the latest version for get_module_modulemds()
get_module_modulemds() was documented to return only the latest version,
but actually returned all versions. Because this wasn't anticipated in
the libsolv usage for module resolution, a more-or-less arbitrary version
would be picked to build local builds against instead of the latest one.
2018-10-05 15:42:31 -04: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
mprahl
54c1ed7166 Change the config base_module_names to be a list instead of a set to allow ordering by the admin 2018-10-04 07:19:07 -04:00
mprahl
ac400fafcf Set the default base_module_names config option to be platform 2018-10-03 10:11:34 -04:00
mprahl
314688f170 Correct the docstrings referring to the old modulemd type 2018-10-02 12:59:36 -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
Lubomír Sedlář
388b31b693 Fix filtering noarch RPMs
The list of arches we compare against should not include multilib
arches. Otherwise excluding does not behave correctly.

Example:
A build has ExcludeArch: i686 (because it only works on 64 bit arches).
A noarch package is built there, but it would be excluded from x86_64.

Relates: https://pagure.io/pungi/pull-request/1050
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2018-09-27 15:12:03 +02:00
Chenxiong Qi
2c58471630 Fix and reword some docstrings again
During I'm reading through the code base to learn MBS, I found out some
typos and minor issues in some other docstrings, and I also found some
docstrings with extra informative description could make it easier to
understand the code.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-26 14:12:39 +08:00
Jan Kaluza
4eb3fa8fee 2.6.2 v2.6.2 2018-09-24 14:27:30 +02: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
e606840c47 Fix and reword some docstrings
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-14 21:44:25 +08:00
Matt Prahl
e180ad88bf Merge #1018 Replace dup_nsvc() in test_mbs.py 2018-09-13 13:06:56 +00: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
Chenxiong Qi
cf4e5f47c0 Avoid repeating default context with literal text
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-09-13 10:08:17 +08:00
Jan Kaluza
f7557283ec 2.6.1 v2.6.1 2018-09-12 08:35:36 +02: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
Ralph Bean
cfbe031218 Fix bug breaking local builds.
This bug was reported by @nphilipp here https://bodhi.fedoraproject.org/updates/FEDORA-2018-c9c3a37d96

The issue is that the `record_filtered_rpms` method returns a new xmd
buildrequires block, but whole buildrequires entries were omitted in the return
value for local builds.  This one-liner includes them again.
2018-09-10 20:53:29 -04:00
Ralph Bean
63e4d4aac7 2.6.0 v2.6.0 2018-09-07 13:56:03 -04:00
Filip Valder
598347e1b6 Import module API 2018-09-07 17:12:01 +02:00
Ralph Bean
cfe32afcd0 Rename LocalBuilder to SRPMBuilder and change type detection.
First, rename LocalBuilder to SRPMBuilder.  Reading the manpage for mock tells
me that the `--rebuild` option is specifically for rebuilding a given srpm.
The class was just named poorly (imo).

Second, change the type detection.  The bug I'm trying to fix is if you try to
pass a string for the `repository:` in your modulemd like
`file:///home/user/repos/libfoo/`.  The old logic here would assume that it is
an srpm since it didn't start with "git" or "http", but that's not correct.  We
have people who want to experiment with building modules with components that
are not publicly accessible over the network - which are only local.  This
change allows that.
2018-09-07 09:23:11 -04:00