Commit Graph

119 Commits

Author SHA1 Message Date
Chenxiong Qi
5579a0e72b Init event handler handles module stream collision
Fixes: FACTORY-3616

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-12-05 18:25:14 +08:00
Chenxiong Qi
917c06ad0c Resolve stream collision with modules added to ursine content
This resolve the stream collision by adding specific RPMs to
module-build-macros SRPM as Conflicts.

For more information about module stream collision, please refer to
docstring in utils/ursine.py

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2018-11-27 11:06:34 +08:00
mprahl
cfb75b4d0f Prefix the module version based on the platform it buildrequires 2018-10-04 07:19:07 -04:00
Ralph Bean
e7089d7be0 Rename this to be PDC-agnostic. 2018-09-04 09:51:56 -04:00
Ralph Bean
0aff640ef3 Optionally, block building modules with EOL streams.
Requested by @mboddu in:

- https://pagure.io/fm-orchestrator/issue/960
- https://pagure.io/modularity/issue/102
2018-08-31 15:23:04 -04:00
mprahl
f08135352a Use the NVR instead of the component name when responding to a tag message
This addresses an issue when a module contains builds that have different
names in their NVR than the component name in MBS. This happens with
SCLs for instance. MBS wouldn't be able to find the component to mark
as tagged in the database since it was searching by the wrong name, so the
build would just stall. This uses the NVR now to find the correct build
in the database.
2018-08-07 11:54:28 -04:00
mprahl
a78c564073 Revert "Store the component's build ID and use that to identify the build when acting on a tag message"
This reverts commit 9bd16beeef.
2018-08-07 10:32:50 -04:00
mprahl
9bd16beeef Store the component's build ID and use that to identify the build when acting on a tag message
This resolves an issue where the component name is different than the
package being tagged due to a macro such as those used for SCLs.
2018-08-03 20:45:00 -04:00
mprahl
36a9026ca8 Remove references to COPR 2018-06-28 10:00:06 -04:00
Ralph Bean
6981449853 Fix local builds.
I discovered that local builds have been broken by recent (good) changes in
dnf.  At the end of every batch, we regenerate the local repo with createrepo
and we also call modifyrepo to include the modulemd file as we progress.  This
was added in #467.

What we really want, is for the modulemd file to be present at the *end* of the
build.

Recently, dnf started respecting the modulemd file natively, such that builds
we built in batch0 would not show up in batch1.  They would be present in the
repo, but they would be marked as belonging to a module which was not enabled,
and so could not be pulled in.  Every module build would fail because
module-srpm-macros was in a disabled module (the module being built at the
time).

This change makes it so that the module metadata is only added to the repo at
the very end of the build.  I moved it into a `finalize` method on the builder
which the copr builder was using, and for symmetry's sake I moved the koji
content generator code to the same method on that builder.

There was a circular import issue to solve between the koji module builder and
the koji content generator modules that generated a larger diff, but is mostly
cosmetic and mock changes.
2018-06-25 17:05:22 -04:00
Qixiang Wan
d83e6897ca Change ModuleBuild.context to db column
1. Changed ModuleBuild's context property to db column, it's
non-nullable and default value is '00000000' to keep it consistent
with previous behaviour.

2. Changed ModuleBuild.contexts_from_mmd to return a tuple of
(ref_build_context, build_context, runtime_context, context).

3. Updated tests affected by this change.
2018-04-28 11:46:31 +08:00
Jan Kaluza
8d1d439737 Generate 'context' from hash based on buildrequires/requires stream. Reuse components only from module with the same stream_build_context. 2018-04-24 15:45:26 +02:00
mprahl
19db295795 Fix flake8 errors 2018-04-03 09:58:57 -04:00
Jan Kaluza
9b6fd2ba39 Split utils.py to multiple files based on the methods use-case. 2018-04-03 09:58:57 -04:00
Jan Kaluza
e5e9a24fce Allow adding bool to XMD. Fix flake8 issues. 2018-04-03 09:58:57 -04:00
Jan Kaluza
2482e47c07 Fix issues from review. Drop xmd['mbs']['requires']. Do not allow building MSE builds against non-MSE builds. 2018-04-03 09:58:57 -04:00
Jan Kaluza
31ddbe51a5 Add generate_expanded_mmds which returns list of MMDs which can be submitted as MSE builds and submit them. 2018-04-03 09:58:57 -04:00
mprahl
eb0b2e1c38 Add the database resolver plugin 2018-04-03 09:58:57 -04:00
mprahl
28e821fee0 Start querying modules by context when it's available
When implementing module stream expansion, we'll need to make sure
the buildrequires are queried using their context as well.
2018-04-03 09:58:57 -04:00
mprahl
f0852d9009 Port to libmodulemd and support v2 modulemd without module stream expansion 2018-04-03 09:58:57 -04:00
Yash Nanavati
ed25afd9ec Code changes for Python 3 support 2018-03-04 03:22:38 -05:00
mprahl
654820ac31 Fix error that occurs when a batch hasn't started but a repo regen message is received
Fixes #864
2018-02-19 13:56:46 -05:00
Jan Kaluza
6a5d7267fd Save another 20s in tests. 2018-02-09 11:46:12 +01:00
Jan Kaluza
4001d3c488 Use in-memory SQLite database in tests to make them 40% faster. 2018-02-08 08:01:24 +01:00
mprahl
8f024e6b04 Remove the dependency on vcrpy in unit tests and modernize some of the test data 2018-02-05 22:17:18 -05:00
mprahl
ea650047a1 Use a random build_id instead of an incrementing one in FakeModuleBuilder
I ran into issues on CentOS CI where fake Koji build messages were getting
one ID but the task_id for the component in the database was getting
another. Making the build_id random and not tied to the class seems to
resolve that issue.
2018-02-05 22:16:53 -05:00
mprahl
0fd29b33c3 Removed unneeded timed decorators on test_build tests 2018-02-05 22:11:31 -05:00
mprahl
6b3cc64711 Use a FileStorage object instead of a tuple when testing direct modulemd submissions
It seems that there is a bug with the Flask test client when submitting a tuple of
file path and content, that incorrectly sets the filename to be the first line of
the file contents instead of the actual filename. We should eventually investigate
this and report a bug or provide a patch.
2018-02-05 11:44:55 -05:00
mprahl
e91d09f7ca Change the format of the unit tests to pytest 2018-01-31 16:34:21 -05:00
Ralph Bean
01c8295269 Add an incrementing prefix to the dist_hash.
For #823.
2018-01-17 16:54:02 -05:00
mprahl
430ac4ba31 Use the "build_context" field when evaluating if a previous module's buildrequires changed 2018-01-16 10:36:09 -05:00
mprahl
a67b53f5c3 Add a "context" field on component and module releases in Koji for uniqueness for when Module Stream Expansion is implemented 2018-01-16 10:36:09 -05:00
mprahl
d13699fce3 Fix some logic errors in FakeModuleBuilder 2017-12-08 16:08:29 -05:00
mprahl
12d036089e Fix test_submit_build_resume_init_fail 2017-12-08 16:04:40 -05:00
mprahl
aa4ca009ef Fix situations where module-build-macros builds in Koji but fails in MBS and the build is resumed 2017-12-08 15:50:55 -05:00
mprahl
5e9d846872 Fix double tagging on module builds that have all their components reused 2017-11-28 09:50:35 -05:00
mprahl
30ef85af01 Fix "instant complete" builds and reusing all components 2017-11-27 16:20:28 -05:00
mprahl
fa6f43e748 Fail module builds directly when a component build in a batch fails 2017-11-17 10:44:15 -05:00
Matt Prahl
ea26e0281a Merge #788 Fix bug and clean up scm.get_latest 2017-11-14 13:38:23 +00:00
mprahl
1622494b17 Replace the name of the "branch" parameter in "scm.get_latest" to "ref" 2017-11-13 09:20:20 -05:00
Ralph Bean
8431d2698b Explicit imports of builders in the test suite. 2017-11-10 16:03:14 -05:00
mprahl
bb0dde9936 Only complete the module build when *all components are tagged* and a KojiRepoRegen message is received 2017-11-10 08:33:53 -05:00
mprahl
3ccbb3dd57 Fix duplicate state traces 2017-11-08 10:18:47 -05:00
mprahl
a8421568f9 Fix Flake8 errors 2017-11-08 08:45:58 -05:00
mprahl
b578f802a6 Reenable skipped test 2017-11-07 14:57:27 -05:00
mprahl
d7c49caca8 Skip a test that hangs when run on CentOS CI over SSH 2017-11-07 13:20:38 -05:00
mprahl
11e39ab0c3 Fix multiple transitions to the failed state 2017-11-06 16:46:57 -05:00
mprahl
d8f126e978 Allow resuming from a failure during the "init" phase
This also shifts build failure transitions from individual functions
in utils.py to the init module handler.
2017-11-06 14:15:12 -05:00
mprahl
58d160cce4 Transition a failed module to wait instead of init upon resuming 2017-11-03 15:12:39 -04:00
Ralph Bean
9b006e1ba5 The Case of the Mysterious Dist Tag
We ran into a crazy bug in stg today where the `disttag` of every
component build .. for every module .. was the same!  (duh duh duh).

Turns out this had to do with the way we were writing the name, stream,
and version values back into the yaml file we recorded.  More correctly,
how we *weren't* writing those values back.
2017-11-02 13:36:18 -04:00