Commit Graph

2239 Commits

Author SHA1 Message Date
mprahl
00daedccfd Allow the virtual streams of a base module to be queryable in the database and API 2019-04-25 13:15:27 -04:00
mprahl
16091b7d86 Revert "Allow getting the latest stream of base module."
This reverts commit bc4a019e7d.

The approach taken causes MBS to submit module builds for every platform
stream, which is incorrect.
2019-04-25 13:04:18 -04:00
mprahl
d0aea40788 Support the stream_version_lte filter in the API 2019-04-25 08:12:49 -04:00
Chenxiong Qi
1146bb3043 Reuse function load_mmd
GenericResolver.extract_modulemd is not removed, but deprecated. Call of it
will result in a deprecation message printed. Any new code should call
load_mmd.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-25 17:05:43 +08:00
Chenxiong Qi
808b7beec8 Refactor code style of code creating test data
This patch proposes another code style to create module builds and associated
component builds. The major purpose to make this refactor is to make it easier
to follow up the lines of code and understand the test data and the
relationship between module builds and component builds.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-24 17:06:38 +08:00
mprahl
0217496d1f Refactor the API ordering to accept multiple order keyword arguments of the same direction
This also improves how a column is determined to be valid for ordering.
2019-04-23 08:37:12 -04:00
mprahl
3a7786c01b Make _get_module consistent across resolvers
This also adds additional code in the event a module is not
returned.
2019-04-23 08:26:14 -04:00
Matt Prahl
e72538b8b1 Merge #1219 Handle streams in base module stream 2019-04-23 12:24:36 +00:00
Chenxiong Qi
7c993f9165 Handle streams in base module stream
A base module's stream (the platform for RHEL) could have Z-stream suffix, e.g.
el8.0.0.z, this patch handles this Z-stream suffix and other potential streams
by returning the stream version as a float with configured suffix value. For
example, el8.1.0.z would be parsed as 080100.1. Note that, the 0.1 is totally
configured in config and it actually could be any value according to concrete
cases in practice.

Config STREAM_SUFFIXES is enabled in TestConfiguration so that tests depending
on the return value from ModuleBuild.get_stream_version are covered.

Part fixture of test TestMMDResolver.test_solve_virtual_streams is updated by
adding Z-stream suffix to platform:el8.2.0 in order to ensure this patch does
not break the MMD resolver.

Addresses FACTORY-4307

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-23 11:21:46 +08:00
Chenxiong Qi
642c37526e Fix typo in MMDResolver._deps2reqs docstring
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-23 10:39:46 +08:00
Chenxiong Qi
f3d61b8259 Pass list of stream values to _expand_mse_streams
The original description of argument stream is inconsistent with the value
passed to function _expand_mse_streams. The actual passed-in value is
Modulemd.SimpleSet. To fix this inconsistency, just pass list of streams, each
of them is a string representing a stream.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-22 20:18:58 +08:00
mprahl
5a82d95756 Release v2.19.1 v2.19.1 2019-04-16 14:22:01 -04:00
mprahl
b017dae68b Unpin the version of python-ldap3 in Dockerfile-tests since a new version has been released 2019-04-15 09:03:37 -04:00
Matt Prahl
4858e64d96 Merge #1210 Allow passing --platform-id (-p) to build_module_locally. 2019-04-11 17:19:22 +00:00
mprahl
83bc780a23 Add backwards-compatibility for cloning local repos with the artifact name and not the full path
This addresses #1211
2019-04-11 10:23:12 -04:00
Jan Kaluza
40ed1cbfdc Allow passing --platform-id (-p) to build_module_locally.
Currently, the PLATFORM_ID is parsed from the `/etc/os-release`. This
is good default value, but sometimes you want to build module locally
against the different platform stream.

For example building on platform:f29 against the platform:f30 modules. In
that case, we need to be able to override the host PLATFORM_ID and
set it manually chosen value.
2019-04-11 14:45:15 +02:00
Matt Prahl
bf58a03cbf Merge #1209 Allow importing MMD without xmd["buildrequires"]. 2019-04-11 12:19:48 +00:00
Jan Kaluza
3cfefd7e0b Allow importing MMD without xmd["buildrequires"].
When importing modules for offline local builds from local repositories,
the XMD section does not have to be set at all - it gets removed during
the compose and is also MBS specific.

We need to be able to import such MMDs using the `import_mmd` method
in order to make --offline local builds working.

This commit adds new `check_buildrequires` bool kwarg in `import_mmd`
method to disable `xmd["buildrequires"]` checks to fix this.
2019-04-11 06:45:53 +02:00
mprahl
4afd3e1209 Remove xmd.mbs.requires from the virtual module documentation
This field has not been used for a long time and it should not
be documented any more.
2019-04-10 08:15:29 -04:00
Valerij Maljulin
e564edc808 Build counters
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-04-09 15:44:45 +02:00
Jan Kaluza
e32dcc153b Add offline module builds documentation. 2019-04-05 08:07:24 +02:00
mprahl
251c364307 Release v2.19.0 v2.19.0 2019-04-04 13:34:21 -04:00
Jan Kaluza
bc4a019e7d Allow getting the latest stream of base module.
If base module name:stream is not found, consider `stream` as virtual stream
and return the latest (the one with highest stream_version) base module with
that virtual stream.
2019-04-04 17:21:49 +00:00
mprahl
f348def71f Fix a log message 2019-04-04 13:16:33 -04:00
mprahl
d6d0c870fc Disable Greenwave gating by default 2019-04-04 13:16:33 -04:00
mprahl
321bb4940f Unpin the libsolv version for the Python 3 tests since it's in stable 2019-04-04 13:45:14 +00:00
mprahl
730871ddfd Fix the test_submit_br_metadata_only_module unit test on Python 3 2019-04-04 09:28:42 -04:00
mprahl
9512a49631 Allow whitelisted buildrequires with xmd.mbs.disttag_marking set to influnece the disttag 2019-04-04 09:12:27 -04:00
mprahl
e2b2da7708 Move the module name validation to validate_mmd 2019-04-04 09:12:27 -04:00
mprahl
1570db8a7e Don't allow a user to set the xmd.mbs field in their modulemd 2019-04-04 09:12:27 -04:00
mprahl
f1480feec2 Allow importing modules without a Koji tag
These module builds will basically act as metadata-only module builds.
This will be more useful as additional features stem from these types
of builds.
2019-04-04 09:09:38 -04:00
Jan Kaluža
9aae63f967 Merge #1200 Fix the unit tests 2019-04-04 05:03:39 +00:00
Jan Kaluza
f6ecc72fc8 Revert "Fix tests."
This reverts commit 7a975ac0ff.
2019-04-04 07:03:10 +02:00
Jan Kaluza
7a975ac0ff Fix tests. 2019-04-04 07:02:38 +02:00
mprahl
0044b3f34b Whitelist py.test-3 in tox 2019-04-03 15:33:16 -04:00
mprahl
24d2be565b Pin the version of libsolv in FEDORA-2019-c381c7bf54 for the tests 2019-04-03 15:24:43 -04:00
mprahl
d46ce667cf Whitelist flake8 in tox 2019-04-03 15:24:20 -04:00
mprahl
bc2a1e8d3c Fix the unit tests 2019-04-03 14:40:52 -04:00
Merlin Mathesius
06e903c3c1 Fixes and test improvements based on review feedback.
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2019-04-03 18:15:59 +00:00
Merlin Mathesius
cd76a1dca5 Update scratch context uniqueness suffix character from '.' to '_'.
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2019-04-03 18:15:59 +00:00
Merlin Mathesius
663b7fc4d0 Allow resubmitting the same NSV for scratch module builds.
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2019-04-03 18:15:59 +00:00
Owen W. Taylor
da57146bf2 GenericBuilder: Add a boolean 'succeeded' parameter to finalize
Previously MockModuleBuilder was checking the module state to see if
it should run a final createrepo, but since eafa93037f, finalize() is
called before changing the module state; add an explicit boolean to
GenericBuilder.finalize() to avoid worrying about ordering.
2019-04-03 18:12:57 +00:00
mprahl
63bccb28ff Use Fedora 29 when developing with Vagrant 2019-04-02 14:35:27 +00:00
Jan Kaluza
4bc6e7ed65 Set the $releasever variable in Mock config. 2019-04-02 14:04:16 +00:00
Chenxiong Qi
0ee801877b Move module build to ready from done according to Greenwave
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-02 16:11:43 +08:00
Chenxiong Qi
3992a1f1ac Fix syntax error when checking if --offline is specified in CLI
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-04-02 08:33:20 +08:00
Jan Kaluza
1c535fa755 Set the module_platform_id in the yum.conf 2019-04-01 13:13:08 +00:00
Jan Kaluza
360a8f3b84 Add support for local component repository using file://.
This is needed for offline local builds to build a component which is
stored on local git repository.

This PR also adds OfflineLocalBuildConfiguration configuration class
for offline local builds to set the RESOLVER.
2019-04-01 13:13:08 +00:00
Jan Kaluza
67a5a9d1b0 Allow building module in --offline module with dependencies from local repositories.
There are following changes introduced in this commit:

- The `koji_tag` of module builds imported from the local repositories
  is now in `repofile:///etc/yum.repos.d/some.repo` format to store the
  repository from which the module was imported to local MBS DB.
- The `koji_tag` of fake base module is set to empty `repofile://`
  and in `MockModuleBuilder` the `conf.base_module_repofiles` list
  is used as source for the repositories defining platform. We can't
  simply use single repository, because there might be fedora.repo
  and fedora-update.repo and so on.
- The list of default .repo files for platform are passed using the
  `-r` switch in `build_module_locally` `mbs-manager` command.
- The LocalResolver (subclass of DBResolver) is added which is used
  to resolve the build dependencies when building modules offline
  locally.
- The `MockModuleBuilder` enables the buildrequired modules and
  repositories from which they come in the mock config.

With this commit, it is possible to build testmodule locally
without any external infra.
2019-04-01 13:13:08 +00:00
Jan Kaluza
e43d979bc8 Import modules found in the local repositories to MBS database for Offline local builds.
This is the first PR in many for Offline local builds. This PR:

- Adds --offline flag to build_module_locally mbs-manager command to enable
  offline local builds.
- If this flag is used, new `import_builds_from_local_dnf_repos` method is
  called which uses DNF API to get all the available installable modulemd
  files and imports each module into MBS local SQLite database.
- It also adds fake "platform:stream" module based on the /etc/os-release,
  so the buildrequirements of the imported modules are satisfied.

The idea here is that in upcoming commits, I will create LocalResolver
which will be similar to DBResolver with some extra rules to resolve
local module builds. This new LocalResolver will still be based on
the models.ModuleBuild methods and therefore we need the modules
imported in database.
2019-04-01 13:13:08 +00:00