2602 Commits

Author SHA1 Message Date
mprahl
9c085a4d79 Release v2.30.2 v2.30.2 2019-11-08 08:34:29 -05:00
mprahl
1160d47e7a Stop adding repo entries for empty tags for local builds
DNF fails on Fedora 31 when there is a repo entry to an empty directory.
2019-11-07 11:18:50 -05:00
mprahl
be641dee57 Set skip_if_unavailable=True on localrepo to avoid module-build-macros failures for local builds
When module-build-macros is built, the localrepo hasn't been generated yet.
This has caused errors on Fedora 31.
2019-11-07 11:18:38 -05:00
Chenxiong Qi
f24cd4222f Make db_session singleton
Please note that this patch does not change the use of database session
in MBS. So, in the frontend, the database session is still managed by
Flask-SQLAlchemy, that is the db.session. And the backend, running event
handlers, has its own database session created from SQLAclehmy session
API directly.

This patch aims to reduce the number of scoped_session created when call
original function make_db_session. For technical detailed information,
please refer to SQLAlchemy documentation Contextual/Thread-local
Sessions.

As a result, a global scoped_session is accessible from the
code running inside backend, both the event handlers and functions
called from handlers. The library code shared by frontend and backend,
like resolvers, has no change.

Similarly, db.session is only used to recreate database for every test.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-11-07 11:06:40 +08:00
mprahl
090f4bb7dc Release v2.30.1 v2.30.1 2019-11-06 09:27:37 -05:00
mprahl
eebefd0689 Set module_hotfixes on repos created for local builds to allow using modular packages in non-modular repos
This fixes an issue that causes module-build-macros to fail during a local
build when a module buildrequires a non-base module.
2019-11-06 09:13:32 -05:00
Chenxiong Qi
28f089bf3d Merge #1491 Remove unused _dummy_context_mgr 2019-11-06 02:17:53 +00:00
Chenxiong Qi
4b5679b37c Merge #1492 Remove unused Kerberos configuration options 2019-11-06 02:15:58 +00:00
mprahl
efb690a482 Release v2.30.0 v2.30.0 2019-11-05 15:15:04 -05:00
mprahl
8dc20c1731 Remove unused Kerberos configuration options
This is some leftover code that was missed in 9fd3731ff7.
2019-11-05 15:08:27 -05:00
Matt Prahl
e2155b58db Merge #1489 Mention layered product modules in KojiResolver. 2019-11-05 14:10:09 +00:00
mprahl
3b85cecf6a Remove unused _dummy_context_mgr 2019-11-05 08:48:40 -05:00
Jan Kaluza
566164ecb1 Mention layered product modules in KojiResolver. 2019-11-05 08:59:51 +01:00
Jan Kaluža
84398834e4 Merge #1481 Search for default modules built also against compatible base modules. 2019-11-05 07:41:42 +00:00
Jan Kaluza
96ca7fd00b Search for default modules built also against compatible base modules. 2019-11-05 07:03:40 +01:00
Matt Prahl
4eee019791 Merge #1486 update container base images to Fedora 31 2019-11-04 20:27:39 +00:00
Mike Bonnet
e582126106 use the C locale for generating the date string for the specfile changelog
This produces exactly the same output as the en_US locale, and is guaranteed to be supported
in all environments.
2019-11-01 16:50:56 -07:00
Mike Bonnet
86c85825ee update container base images to Fedora 31
Also update the uid management in the frontend image to be more consistent with
best practices, as demonstrated by:

https://github.com/RHsyseng/container-rhel-examples/tree/master/starter-arbitrary-uid

This allows the dependency on nss_wrapper to be dropped.
2019-11-01 12:04:36 -07:00
mprahl
f95b665904 Use RuntimeError instead of ValueError when the retrieval of default modules fails
This will result in the error actually being in the state reason
of the failed module build instead of "An unknown error occurred
while validating the modulemd".
2019-11-01 14:49:10 -04:00
Chenxiong Qi
1c645f5a04 Fix log.exception
log.exception() without a message will fail and module build cannot move
to failed state.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-11-01 21:33:08 +08:00
mprahl
ef0ab348bc Remove commented out code in test_utils.py 2019-10-30 15:29:45 -04:00
Mike Bonnet
f6baf5a427 convert tests to Kerberos auth 2019-10-29 19:37:31 -07:00
Mike Bonnet
6cdf460647 configure MBS to use Kerberos for authentication
This change deploys a KDC using the c3i-library (https://pagure.io/c3i-library) and configures MBS
to require Kerberos authentication for submitting builds to the frontend.
2019-10-29 19:37:31 -07:00
Chenxiong Qi
1ab259ba77 Fix state for determining if continue building components in current batch
The original code before changing to is_unbuilt is to check if any
component builds in current batch has state None. This patch fixes that.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-30 09:26:07 +08:00
Chenxiong Qi
cab9cb8ee3 Merge #1479 Minor fixes to consume and process_message 2019-10-30 01:24:38 +00:00
Chenxiong Qi
251239621d Refactor consume and process_message
A new method _map_message is added for converting a message object to
corresponding event handler and module build. This is used to shorten the
process_message method.

process_message is refactored so that:

* when handler is NO_OP, just return as earlier as possible because setting it
  make no sense to set MBSConsumer.current_module_build_id back and forth.
* Re-raise error thrown from handler execution so that the caller is able to
  get a chance to collect monitoring metric inside except clause handling
  Exception. Otherwise, no failed metric is collected. This is the major
  problem this patch is to fix.
* Ensure MBSConsumer.current_module_build_id is set back to None.

In consumer method, no traceback is logged inside except clause catching
Exception. process_method does that.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-29 22:22:10 +08:00
Chenxiong Qi
fa227698ef Fix wrong value passed to ModuleBuild.transition state argument
state argument expects an int value represeting a module build state
rather than a string value.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-29 22:19:46 +08:00
Chenxiong Qi
4bebd13872 Fix wrong argument name in docstring and assert its value
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-29 22:19:46 +08:00
Chenxiong Qi
3bdbdaee20 Remove unnecessary code from process_message
It is not necessary to initialize the build variable before following
if-elif-else branch.

After the if-elif-else branch, if no build is found, process_message
just returns immediately. So, no need to check if build is None during
handling error raised from handler call.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-28 20:49:52 +08:00
Matt Prahl
0596dad784 Merge #1477 Do not drop realm from user's kerberos principal name 2019-10-25 14:56:50 +00:00
Matt Prahl
1de4cfcc64 Merge #1476 Use the new internal container registry 2019-10-25 14:55:21 +00:00
Chenxiong Qi
d1026c0df7 Do not drop realm from user's kerberos principal name
Save the realm and just keep the variable there for any further possible
use.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-10-25 13:46:54 +08:00
Hunor Csomortáni
0066c79dae Bootstrap integration tests
This is the first step to have some tests, that we could run against an
MBS instance, to check that it's functionally correct. Ultimately, these
will replace the test scripts (`contrib/test-*`).

This doesn't really do anything yet, but I would like to make sure that
everyone is on the same page regarding how this will be set up.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-10-24 10:16:16 +02:00
Luiz Carvalho
246cae6328 Use the new internal container registry
Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
2019-10-23 17:49:19 -04:00
Mike McLean
2b5deca8ec Merge #1464 Fix the name field in modulemd text for -devel builds 2019-10-21 22:12:44 +00:00
Mike Bonnet
6868454fcc increase build timeouts 2019-10-18 10:29:29 -07:00
Mike McLean
e90fa30841 revert part of #1469
After merging #1469, CI runs are failing on the merge step

11:33:39  fatal: proposed/devel-build-modulemd - not something we can merge

This seems to be caused by the change to the fetch line. It seems older versions
of git might have slightly different behavior when asked to fetch a branch name.
2019-10-18 12:13:02 -04:00
Matt Prahl
9379e9ac9c Merge #1469 avoid shallow clone, but limit second fetch to branch under consideration 2019-10-18 15:24:35 +00:00
Matt Prahl
5fc3e0a73f Merge #1467 use C3I-as-a-Service to allocate a dynamic project for building and testing 2019-10-18 15:20:23 +00:00
Mike McLean
920c4efa46 avoid shallow clone, but limit second fetch to branch under consideration 2019-10-18 11:18:10 -04:00
Mike McLean
107df94776 fix unit test 2019-10-18 09:44:45 -04:00
Mike McLean
dbcb0f30d1 drop unnecessary parentheses 2019-10-18 09:44:45 -04:00
Mike McLean
5e854f503d adjust unit test 2019-10-18 09:44:45 -04:00
Mike McLean
620263c34b combine common code 2019-10-18 09:44:45 -04:00
Mike McLean
ad6afecc69 also fix build.extra 2019-10-18 09:44:45 -04:00
Mike McLean
8a83a17c53 update devel case assertion 2019-10-18 09:44:45 -04:00
Mike McLean
8581b9d02f adjust name for devel builds in modulemd.txt 2019-10-18 09:44:45 -04:00
Mike McLean
72621277f3 Merge #1465 run-unittests.sh: docker pull needed images 2019-10-17 15:13:55 +00:00
Mike McLean
1b02a45331 no need to update database image 2019-10-17 11:06:20 -04:00
Mike Bonnet
78ee32bc83 enable parallel job execution
With the use of C3IaaS, resource contention in the main OpenShift project will
be dramatically reduced. This allows jobs to run in paralle, increasing throughput
and reducing lag time for feedback on changes.
2019-10-17 07:32:16 -07:00