2336 Commits

Author SHA1 Message Date
Jan Kaluza
e1b29d2fde Version 2.23.0 v2.23.0 2019-06-20 06:55:00 +02:00
Jan Kaluza
c9d2b77167 When no architecture is set in Koji tag, fallback to conf.arches 2019-06-19 14:32:10 +02:00
mprahl
6a850e4996 Pass --no-tty to run-unittests.sh when being run by Jenkins 2019-06-18 10:56:24 -04:00
Matt Prahl
d9f2a6e68d Merge #1290 Add option --no-tty to run-unittests.sh 2019-06-18 14:52:57 +00:00
Chenxiong Qi
ee2036cd10 Add option --no-tty to run-unittests.sh
This is useful for running run-unittests.sh in Jenkins. When set --no-tty, -i
and -t are not added to docker-run command.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-18 22:48:15 +08:00
mprahl
e8b47e70d4 Fix the path to run-unittests.sh in .cico-pr.pipeline 2019-06-18 10:19:00 -04:00
mprahl
1a17d655ee Accept floats when filtering by stream_version_lte on the API 2019-06-18 10:19:00 -04:00
Valerij Maljulin
392a456dab Release v2.22.0 v2.22.0 2019-06-18 10:44:58 +02:00
Chenxiong Qi
630f7b4e18 Allow to run tests with PostgreSQL inside container
This patch introduces a new environment variable in order to allow running
tests with different database backend. This is useful particularly for running
tests inside container. With this change, it is possible run tests in following
combinations:

* Python 2 and SQLite
* Python 3 and SQLite
* Python 2 and PostgreSQL
* Python 3 and PostgreSQL

Package python-psycopg2 is installed in both Dockerfile-tests and
Dockerfile-tests-py3 in case of running tests with PostgreSQL.

A new script contrib/run-unittests.sh is added to make it easy to run tests. An
example:

    contrib/run-unittests.sh --py3 --with-pgsql

that runs tests with Python 3 and PostgreSQL.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-17 22:47:23 +08:00
Jan Kaluža
5794c4375d Merge #1281 Allow buildrequiring modules built against all platform streams. 2019-06-17 05:27:32 +00:00
Jan Kaluza
2778c39765 Allow buildrequiring modules built against all platform streams.
This commit fixes issue with following situation:

Module `foo` has been built with `buildrequires: platform: [f28]`
and `requires: platform: []`. It can therefore be used as a buildrequirement
on any platform stream. But if you want to build module `app` which
buildrequires `foo` on `platform:f30`, the MBS won't pull-in the `foo`
module build, because MBS currently limits the modules by the platform
they have been built for.

This commit adds new config option to allow including modules built
against any platform stream.
2019-06-17 07:25:50 +02:00
mprahl
9828a0127b Don't try to add duplicate buildrequires entries when importing a module
To do this, we need to use the same database session in import_mmd as in
ModuleBuild.get_buildrequired_base_modules, otherwise, the returned
ModuleBuild objects are in a detached state.
2019-06-13 07:49:30 -04:00
Matt Prahl
489fb89a52 Merge #1285 Invalid scmurl on import should yield status 400 2019-06-12 15:27:36 +00:00
Matt Prahl
eeecadd843 Merge #1279 Use image from Quay.io to run the tests 2019-06-12 14:49:42 +00:00
sarah256
0d3655c2a8 Invalid scmurl on import should yield status 400 2019-06-12 10:21:13 -04:00
Jan Kaluza
511cad8c14 Check if buildopts.get_rpm_whitelist() is really set before using it.
This fixes module builds which sets the `buildopts` for something else
than the RPM whitelist.

Before this commit, when `buildopts` was set, the RPM whitelist was
always taken from the buildopts even if it was not defined there.
This resulted in empty `rpm_whitelist` and therefore no pkglist set
in Koji tag.

In this commit, MBS uses whitelist from `buildopts` only if it is
really set by the module maintainer.
2019-06-12 14:17:26 +02:00
Hunor Csomortáni
1848350e13 Document updating the test images in Quay.io
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
e6640bb95b Use images from Quay to run the tests on CentOS CI
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
9b90836595 Document using images from Quay.io for testing
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
7db21b7385 Contributing: replace docker with podman
Recommend using podman instead of docker because:

* one can spin up containers without sudo with podman;
* docker in Fedora has a really old version, and probably will be
  depercated at some point.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-11 14:04:30 +02:00
Hunor Csomortáni
71900fb471 Merge #1283 Add a 10 minutes timeout to cloning tests 2019-06-11 11:46:03 +00:00
Hunor Csomortáni
165325fc3e Add a 10 minutes timeout to cloning tests
This stage often gets blocked and takes hours until it gets cancelled.
Add a 10 minutes timeout to make it fail faster.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-11 12:32:46 +02:00
Igor Gnatenko
cdb701d525 Allow configuring 'dynamic_buildrequires'
The default is not set because we want to use koji's default if modulemd
does not specify 'dynamic_buildrequires'.

Requires: https://pagure.io/koji/pull-request/1466
Closes: https://pagure.io/fm-orchestrator/issue/1264
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-09 18:53:04 +02:00
Jan Kaluža
d34118cae4 Merge #1277 Take the list of arches for -build Koji tag from buildrequired modules. 2019-06-07 13:36:48 +00:00
Jan Kaluza
bf0bcaff57 Take the list of arches for -build Koji tag from buildrequired modules.
Currently, we are using just `conf.arches` and `conf.base_module_arches`
to define the list of arches for which the RPMs in a submitted module are
built. This is not enough, because RCM needs to generate modules based
on the base modules which should use different arches.

This commit changes the MBS to take the list of arches from the buildrequired
module build. It checks the buildrequires for "privileged" module or base
module and if it finds such module, it queries the Koji to find out the list
of arches to set for the module.

The "privileged" module is a module which can override base module arches
or disttag. Previously, these modules have been defined by
`allowed_disttag_marking_module_names` config option. In this commit,
this has been renamed to `allowed_privileged_module_names`.

The list of arches are stored per module build in new table represented
by ModuleArch class and are m:n mapped to ModuleBuild.
2019-06-07 13:16:31 +02:00
mprahl
4aeabc0f9b Set the test data in test_submit_build_automatic_z_stream_detection to match the actual use-case 2019-06-04 09:29:37 -04:00
Valerij Maljulin
52a600be40 Make sync_koji_build_tags poller working only with the builds that are in build state for some time
This fixes #1271

Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-05-30 18:01:18 +02:00
Valerij Maljulin
13afde0124 Fix for test_sync_koji_build_tags
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-05-30 12:53:25 +02:00
Jan Kaluza
222f0417cf Use single session object in greenwave handler and call commit() in the end. 2019-05-29 13:45:08 +02:00
Jan Kaluza
ae2b6d9533 Release 2.21.0 v2.21.0 2019-05-24 10:17:56 +02:00
Valerij Maljulin
87d3a39607 A poller for Greenwave
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-05-22 13:20:26 +02:00
mprahl
dd5667665d Query the Red Hat Product Pages to see if this is a Z stream build when configured
In certain use-cases, a module's buildrequires may remain the same
in the modulemd, but a different support stream of the buildrequired
base module should be used. For example, since RHEL 8.0.0 is GA, any
modules that buildrequire platform:el8.0.0 should buildrequire
platform:el8.0.0z instead.
2019-05-21 08:55:52 -04:00
mprahl
00ea4e3bca Breakout some of the functionality in _handle_base_module_virtual_stream_br so it can be reused for a future feature 2019-05-21 08:55:52 -04:00
Matt Prahl
79ba221172 Merge #1262 Make pipeline job options consistent 2019-05-21 12:55:45 +00:00
Valerij Maljulin
95bacc4e15 Add greenwave query to done handler
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-05-17 16:10:06 +02:00
Mike Bonnet
d80316ebf2 Make pipeline job options consistent
Set a consistent set of options on Jenkins pipeline jobs. This includes timestamps,
reasonable timeouts, saving only the last 10 builds (to avoid filling up the disk
of the Jenkins master), disabling concurrent builds (to avoid hitting quota limits),
and skipping the default checkout (all jobs that need the source call checkout()
explicitly).
2019-05-16 12:22:47 -07:00
mprahl
4b5618f079 Add scratch to the short JSON
This is needed for the MBS-UI PR:
https://github.com/release-engineering/mbs-ui/pull/10
2019-05-16 15:44:09 +00:00
mprahl
a8eaac7c0a Build the JSON using Groovy in the failing integration test rather manually creating a JSON string 2019-05-16 09:32:22 -04:00
Matt Prahl
2db62eb897 Merge #1258 Run the integration tests from the current branch 2019-05-16 13:31:44 +00:00
mprahl
c1e2a5b0af Unpin the libmodulemd RPMs 2019-05-16 11:51:38 +00:00
Mike Bonnet
095fab0292 Run the integration tests from the current branch
Previously, the integration test pipeline was configured to always use the tests present on the
master branch. When running the pre-merge pipeline for a PR, this would result in potentially
out-dated tests being run. This change runs the tests from the current branch, allowing the code
and the tests to evolve together.

This also disables the default checkout of the master branch, which is unnecessary when calling
checkout() from the pipeline.
2019-05-15 16:44:29 -07:00
mprahl
dde4b96baf Add an integration test for buildrequiring a virtual stream 2019-05-15 13:47:32 -04:00
mprahl
14d0c30990 Add a try/catch around the grant-cg-access code in the integration tests
Since there's no way of knowing if the user has already been granted access,
this wraps this code and just ignores the failure.
2019-05-15 13:47:32 -04:00
mprahl
85f1228b76 Remove an unnecessary print statement in the tests 2019-05-15 13:47:32 -04:00
mprahl
d208fd479c Cast the version to an integer for proper sorting in get_last_builds_in_stream_version_lte 2019-05-15 13:47:32 -04:00
mprahl
beb38b0fd2 Modify ModuleBuild._add_virtual_streams_filter to use a subquery to better support Postgres
The old way performed a `DISTINCT (module_builds.id)` on the original query passed in
to ModuleBuild._add_virtual_streams_filter, but this caused issues when the original
query was ordered by something other than ID on Postgres databases. This new approach
uses a subquery to filter that module builds with the desired virtual streams, and then
joins this subquery to the original query.
2019-05-15 13:47:32 -04:00
mprahl
84dc82c4a0 Add a migration that adds a missing uniqueness constraint that was defined in the model
The uniqueness constraint was added in 599c881714, but it
was not part of the migration.
2019-05-15 11:14:05 -04:00
mprahl
ea838a9855 Set nullable=False on the ModuleBuild.context column model to match the migration
The context column was added in d83e6897ca. The
migration set `nullable=False`, but the model kept the default of `nullable=True`.
This caused `mbs-manager db migrate` to create a migration for setting the context
collumn to `nullable=True`.
2019-05-15 11:14:05 -04:00
mprahl
8c6822f871 Add the missing modules_allow_scratch entry in config.py 2019-05-14 21:46:28 -04:00
mprahl
40e0e8f062 Provide a better error message when the modulemd version is unsupported
Also raise an exception if `load_mmd` is called with None as an argument.
2019-05-14 10:03:32 -04:00