2535 Commits

Author SHA1 Message Date
Mike McLean
bbe10fd2da Release 2.29.0 v2.29.0 2019-10-03 15:10:54 -04:00
Valerij Maljulin
2c0291987f Raise Unathorized exception instead of general one whenever OIDC auth fails
This fixes #1147
2019-10-03 17:02:33 +02:00
Valerij Maljulin
689d949a48 buildonly support
This fixes #1307

Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-10-03 16:20:04 +02:00
Jan Kaluža
6e34e50c18 Merge #1451 Add support for KojiResolver in component reuse code. 2019-10-03 13:16:00 +00:00
Jan Kaluza
486dc39898 Add support for KojiResolver in component reuse code.
In this commit, when component reuse code finds out that the base module uses
KojiResolver, it uses the `KojiResolver.get_buildrequired_modules` method
to find out possible modules to reuse and limits the original query just
by the IDs of these modules.

In order to do that, this commit splits the original
`KojiResolver.get_buildrequired_modulemds` into two methods:

- The `get_buildrequired_modules` returning the ModuleBuilds.
- The `get_buildrequired_modulemds` calling the `get_buildrequired_modules`
  and returning modulemd metadata.
2019-10-03 15:14:29 +02:00
mprahl
8c6cfb702d Use small license headers in the Python files
This also removes the outdated comments around authorship of each
file. If there is still interest in this information, one can just
look at the git history.
2019-10-03 08:47:24 -04:00
Matt Prahl
df295516e3 Merge #1449 Use double quotes instead of single quotes to match the style guide 2019-10-02 13:57:36 +00:00
Matt Prahl
73e2d1a6f7 Merge #1427 Allow running an individual test using a relative path 2019-10-02 12:09:30 +00:00
mprahl
f60b292c9c Use double quotes instead of single quotes to match the style guide 2019-10-02 07:42:20 -04:00
mprahl
164f592c1d Make the DNF minrate setting configurable when loading repos 2019-10-02 07:37:12 -04:00
Matt Prahl
2796b9e6a1 Merge #1448 Load the DNF repos in parallel 2019-10-02 11:33:21 +00:00
Jan Kaluza
fc39df9487 Store the build_context without base modules in a database.
For KojiResolver, we need to be able to find out the module to reuse
components from based only on the non-base-module buildrequires. The
base module buildrequirement will be defined by the Koji tag inheritance.

For this, we need to store build_context computed without the base
modules.
2019-10-02 07:16:55 +02:00
mprahl
8d76977434 Load the DNF repos in parallel
In production, loading each repo can be quite slow. This approach
loads the repos in parallel.
2019-10-01 15:29:00 -04:00
Matt Prahl
d4b7a019c7 Merge #1444 Return an empty list in KojiResolver.get_compatible_base_module_modulemds. 2019-09-30 15:12:31 +00:00
Matt Prahl
db7696eafc Merge #1439 Disable handling collisions on local builds due to RHBZ#1693683 2019-09-30 14:58:40 +00:00
Jan Kaluza
a28df5edb7 Return an empty list in KojiResolver.get_compatible_base_module_modulemds.
For KojiResolver, this method returns always an empty list. The compatible modules are
defined by the Koji tag inheritance, so there is no need to find out the compatible
base modules on MBS side.

This makes `mse.get_base_module_mmds` to ignore virtual streams and just use
the input base module as the only module without finding the compatible
base modules.
2019-09-30 09:04:21 +02:00
Jan Kaluža
f6c2a88cc0 Merge #1435 Add initial code for KojiResolver class. 2019-09-30 06:25:55 +00:00
Jan Kaluza
a7540452cd Add initial code for KojiResolver class.
This commit:

- Adds KojiResolver class and KojiResolver tests.
- Changes the GenericResolver and its subclasses to pass base_module_mmds
  instead of base_module_nsvc to get_buildrequired_modulemds. This is needed,
  because KojiResolver needs to access XMD section of base module.
- Implements KojiResolver.get_buildrequired_modulemds to ask Koji for list of
  modules tagged in the Koji tag and return their modulemds.
2019-09-30 07:56:07 +02:00
Stephen Gallagher
8e3ebe5df2 Doc improvements for virtual modules
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2019-09-27 08:48:05 -04:00
mprahl
6b2e5be93a Disable handling collisions on local builds due to RHBZ#1693683 2019-09-26 11:43:30 -04:00
mprahl
453d871e03 Make the log message in execute_cmd easier to read for local builds 2019-09-25 17:30:21 -04:00
Jan Kaluza
1385a1dea3 default_modules: Convert arch to canon_arch.
Convert arch to canon_arch. This handles cases where Koji "i686" arch is mapped to
"i386" when generating RPM repository.
2019-09-23 13:18:38 +02:00
Jan Kaluža
3d5dd91cf7 Merge #1433 __all__ should be in type list[str] 2019-09-23 05:41:43 +00:00
Chenxiong Qi
8e54f05428 __all__ should be in type list[str]
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-20 21:47:04 +08:00
Luiz Carvalho
97be1c4737 Document how to generate DB migration scripts
Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
2019-09-19 16:26:26 -04:00
mprahl
550b266961 Release v2.28.2 v2.28.2 2019-09-19 10:22:01 -04:00
mprahl
749f186524 Add conflicts in module-build-macros for NEVRAs found in handle_collisions_with_base_module_rpms
PR #1331 made the assumption that the Ursa Major ursine RPMs were at
xmd["mbs"]["ursine_rpms"], but they are actually at
xmd["mbs"]["buildrequires"]["platform"]["ursine_rpms"]. This commit
handles the ursine RPMs generated by handle_collisions_with_base_module_rpms
separately since the base module the RPMs came from are not tracked in
that function.
2019-09-19 13:31:10 +00:00
Mike McLean
e2939c80a1 use patch.object 2019-09-18 17:22:59 -04:00
Mike McLean
e1cf07c038 extend unit test 2019-09-18 20:21:14 +00:00
Mike McLean
bbb1d4bb5b Use utc date for compare and correct operator 2019-09-18 20:21:14 +00:00
Mike McLean
fafff9f5d0 use date comparison rather than datetime 2019-09-18 20:21:14 +00:00
mprahl
2fc439c860 Allow running an individual test using a relative path
Since the tests now run in a different location in the container
since PR #1378, the documentation needed to be updated. Instead,
we should just allow the user to pass a relative path instead.
2019-09-18 16:01:05 -04:00
Matt Prahl
902d887a5e Merge #1423 option to use sudo when running docker for unit tests 2019-09-18 19:27:53 +00:00
mprahl
235d4cd457 Fix the test_handle_collisions_with_base_module_rpms unit test 2019-09-18 12:04:18 -04:00
mprahl
099ee8cbd1 Call record_module_build_arches before add_default_modules
record_module_build_arches needs to be called before since
record_module_build_arches requires the arches to be set to know
which DNF repos to query.
2019-09-18 11:36:01 -04:00
Mike McLean
dfc88f99a6 option to use sudo when running docker for unit tests 2019-09-18 11:04:46 -04:00
mprahl
853300d150 Release v2.28.1 v2.28.1 2019-09-18 09:55:55 -04:00
Chenxiong Qi
3fb079f23d Add more tests for mbs-manager command build_module_locally
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-18 13:42:42 +00:00
Chenxiong Qi
e3f91dd8a8 Add missing keyword assert to test
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-18 16:49:21 +08:00
Chenxiong Qi
0899e470f0 Convert value to correct type in order to pass to _get_rpms_from_tags
Fixes #1420

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-18 16:48:39 +08:00
mprahl
aa113042b0 Bump the version to v2.28.0 v2.28.0 2019-09-17 13:25:55 -04:00
mprahl
110b6adb0a Add release notes for v2.28.0 2019-09-17 13:24:22 -04:00
mprahl
1a05d59a4d Use double quotes instead of single quotes 2019-09-17 13:11:22 -04:00
Chenxiong Qi
065abe3c45 Fix DetachedInstanceError in command module_build_locally
Update test test_build_module_locally_set_stream accordingly by not
mocking database session object in order to test against the real
SQLAlchemy Session scope.

Resolves: RHBZ#1752075

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-17 23:09:14 +08:00
Chenxiong Qi
c36bd7ebac Name component builds by states
This patch attemps to make code shorter and easier to read by naming
component builds for different states.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-16 15:29:21 +08:00
Jan Kaluža
442a855f0a Merge #1415 Install python3-pytest-cov in the C3I Dockerfile since it's now used by tox 2019-09-16 06:25:26 +00:00
Jan Kaluža
b33fc6adf1 Merge #1410 Don't check for compatibile modules during component reuse if allow_only_compatible_base_modules is false 2019-09-16 06:14:10 +00:00
Jan Kaluža
0bf84f557e Merge #1407 Do not ignore building components to reset state when submit an existing module build 2019-09-16 06:11:04 +00:00
mprahl
86b16d61c0 Unpin python3-libmodulemd in the C3I tests since the MBS RPM requires it directly 2019-09-13 09:12:34 -04:00
mprahl
10d70f51e1 Install python3-pytest-cov in the C3I Dockerfile since it's now used by tox 2019-09-13 09:12:24 -04:00