Commit Graph

2014 Commits

Author SHA1 Message Date
Matt Prahl
7fe4dc89fc Merge #1072 Minor fixes to wait handler and KojiModuleBuilder 2018-11-07 13:11:15 +00:00
Chenxiong Qi
a1efbaae66 Fix out-dated comment to KojiModuleBuilder.module_build_tag
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-07 17:35:42 +08:00
Chenxiong Qi
1ef30f642e Replace name dependencies with dep_koji_tags in wait handler
The value referenced by variable dependencies is a list of koji_tags.
So, it would be more straightforward to use an alternative name like
dep_koji_tags than dependencies which is too general.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-07 17:31:40 +08:00
Chenxiong Qi
bc682ff15d No need set initial value to tag and dependencies in wait handler
Both tag and dependencies are set directly by calling private method
_get_deps_and_tag. There is no need to set initial value for them
separately.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-07 17:09:21 +08:00
Chenxiong Qi
d6407ac5fb Make directory /etc/module-build-service instead of link
rhpkg could be installed inside Vagrant machine to run MBS with internal
infra. rhpkg installs config file into /etc/module-build-service, which
could fail with following error if /etc/module-build-service is a link
to /opt/module_build_service/conf.

error: unpacking of archive failed on file
/etc/module-build-service/redhat.py;5be25ac4: cpio: chown

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-07 12:04:22 +08:00
Chenxiong Qi
8aab2688e1 Fix incorrect username appended to mock group
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-07 12:04:13 +08:00
Matt Prahl
8356848bec Merge #1069 Remove unused variable local_modules from format_mmd 2018-11-06 14:03:47 +00:00
Matt Prahl
fb95b6b6cd Merge #1066 Refine Vagrantfile 2018-11-06 13:29:14 +00:00
Chenxiong Qi
879d0daca0 Detect transitive stream collision
For an explanation of transitive stream collision, please refer to the
source code docstring.

When such collision is detected, error is raised with proper error
message.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-06 20:27:43 +08:00
Chenxiong Qi
254195a4d0 Remove unused variable local_modules from format_mmd
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-06 16:46:39 +08:00
Chenxiong Qi
eccb239dd4 Refine Vagrantfile
Major change is to create a dedicated Python virtual environment for MBS
instead of installing required packages (listed in requirements) into
system site-packages directory.

This would be convenient for developer to install other Python packages
via package manager, for example to install rhpkg. I found an issue when
I installed rhpkg in original Vagrant machine, that is whole kobo
package is installed via pip, and `dnf install rhpkg' will result in
python2-kobo is installed and then it fails to import module
kobo.rpmlib. The fix is I have to install python2-kobo-rpmlib via dnf
again. With this change, this issue could be avoided. Two environments
are separated rather than mixed together.

Another two minor improvements base on this change are, after logging
into the machine, 1) the virtual environment is activated automatically,
and 2) change working directory to /opt/module_build_service.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-05 17:16:19 +08:00
mprahl
ba3bef9f46 Don't assume the context is set on base modules in the 526fb7d445f7_module_buildrequires migration 2018-11-01 09:38:02 -04:00
Hunor Csomortáni
65300a57b7 Add OpenShift test template and Dockerfiles
Add Dockerfiles to build images for the backend and frontend.

Add an OpenShift template to deploy an MBS test instance, and connect it
to a message bus and Koji instance.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2018-10-31 15:58:28 +01:00
mprahl
a46c1c2020 Fix the styling in the change log 2018-10-30 15:03:26 -04:00
mprahl
2b411dd870 Add some missing changes to the change log 2018-10-30 14:54:52 -04:00
mprahl
514fd54388 Release v2.8.1 v2.8.1 2018-10-30 12:19:18 -04:00
mprahl
26547f707a Fix typo in the migration script 2018-10-30 12:16:56 -04:00
mprahl
e37be40b24 Release v2.8.0 2018-10-30 11:47:55 -04:00
mprahl
df48d4e184 Fix typos in some of the code comments 2018-10-30 11:37:44 -04:00
Matt Prahl
1c104d0401 Merge #1062 Import -devel CG build with RPMs which are filtered out of the current real CG build. 2018-10-30 15:35:33 +00:00
Jan Kaluza
13ab18425a Import -devel CG build with RPMs which are filtered out of the current real CG build.
For some modules, modularity-wg wants to be able to ship the "-devel" modules containing
the RPMs which are normally filtered out from the module.

This PR generates second Koji CG module with -devel suffix in a name with final modulemd
files containing the filtered out RPMs.
2018-10-30 13:49:12 +01:00
mprahl
f7e7765686 Add the ability to override buildrequires and requires when submitting a module build
This will allow for tooling to automatically override certain buildrequires and requires
based on the branch name the modulemd is built form.

Addresses FACTORY-3414
2018-10-29 17:08:27 -04:00
Matt Prahl
7a0360728a Merge #1059 Remove duplicate modulemds returned in utils.mse._get_base_module_mmds 2018-10-29 13:00:19 +00:00
mprahl
85401c2e1e Surface an error to the user when no base module could be found in the module's buildrequires 2018-10-26 14:47:01 -04:00
mprahl
1633e55917 Remove duplicate modulemds returned in utils.mse._get_base_module_mmds 2018-10-26 14:39:54 -04:00
Jan Kaluza
f2a236bc74 Pass buildrequired modules built against all compatible base module streams to MMDResolver.
Imagine we have "platform:f29.0.0" and "platform:f29.1.0" base modules.
We also have "DBI" module we want to build agaisnt "platform:f29.1.0".
This "DBI" module depends on "perl" module which is only build against
"platform:f29.0.0".

Currently, DBI build would fail to resolve the dependencies, because
it wouldn't find "perl" module, because it is built against different
platform stream.

This PR changes the MSE code to include buildrequired module builds built
against all the compatible platform streams.

It does so by introducing following changes:

- MSE code uses new get_base_module_mmds() method to find out all the
  compatible platform modules. This needed new methods in DBResolver
  and MBSResolver.
- For each buildrequired module defined by name:stream, the MSE code then
  finds particular NSVC built against each compatible platform module.

Side effect of these code changes is that every module now must buildrequire
some base module.
2018-10-26 14:02:36 +02:00
Jan Kaluza
6b496dfde4 Add tests for "Conflicts: module(name)" in MMDResolver.
The test tests installation of multiple streams of single module.
For example:
 - "app:1" requires "foo:1" and "gtk:1".
 - "foo:1" requires "bar:1".
 - "gtk:1" requires "bar:2".
"bar:1" and "bar:2" cannot be installed in the same time and therefore
there need to be conflict defined between them.
2018-10-25 16:01:36 +02:00
Jan Kaluža
77ee4b2185 Merge #1056 Fix F901 flake8 error 2018-10-25 08:46:32 +00:00
Chenxiong Qi
b9601be420 Fix F901 flake8 error
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-25 16:35:26 +08:00
Chenxiong Qi
f9fda3f1c5 Add W504 to flake8 ignore list
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-25 16:31:55 +08:00
Jan Kaluza
ff758a48f1 Include also 'src' RPMs in the final RPMs list.
This fixes regression introduced in previous bcb104a16 commit.
2018-10-25 09:08:52 +02:00
Matt Prahl
8a7ad00a23 Merge #1051 Move flake8 config into flake8 section in tox.ini 2018-10-22 13:07:05 +00:00
Matt Prahl
3f4b422c23 Merge #1050 Fix a typo in comment 2018-10-22 13:05:24 +00:00
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
5ae0122b18 Move flake8 config into flake8 section in tox.ini
Sometimes, it would be convenient to run flake8 directly rather than
`tox -e flake8` and the flake8 section in tox.ini will apply to both of
them.

In addition, exclude ./.env as well.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-22 09:45:04 +08:00
Chenxiong Qi
a2ee9b4918 Fix a typo in comment
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-10-20 19:48:30 +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