Commit Graph

2956 Commits

Author SHA1 Message Date
Owen W. Taylor
c27e77c59d MBSResolver: improve efficiency of querying latest version
Only get 5 results at a time, and if we see that we're already
retrieving an old versions, stop requesting more pages.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
31fca9a962 100% test coverage for MBSResolver.py
Add new tests and modify existing tests so that test_mbs.py entirely
covers MBSResolver.py. To make the tests simpler, change from
explicitly expectations about the MBS API request => response sequence
to a stub local implementatin of the MBS API.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
80c7e20bfa resolver: remove unused state/states parameter to get_module()
BaseResolver.get_module() and DBResolver.get_module() to a state
parameter, MBSResolver took a states parameter - neither was used
anywhere.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
7d2e754f35 Fix handling of getting "modulemd: null" in MBS verbose response
The code made some half-hearted attemps to handle a MBS verbose query
missing the modulemd data, but it didn't do anything logically
consistent - fix it to consistently ignore such modules.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
960058fe9d MBSResolver: fix 'either...or' => 'both....and' 2022-04-29 15:47:08 -04:00
Owen W. Taylor
70ed42885e MBSResolver: local modules can't be metadata-only
A module added with --add-local-build  can't have koji_tag=None, since
koji_tag is set to the directory where the module is.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
7d6c7876b1 MBSResolver: fix a RuntimeError to not reference None 2022-04-29 15:47:08 -04:00
Owen W. Taylor
7e33935760 MBSResolver: remove non-functional handling of RPM filtering
Code in MBSResolver.resolve_requires() to compute filtered_rpms()
assumed the response from MBS has a "rpms" key with binary RPMS
from the build, but this was never implemented.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
abd731397f MBSResolver: use requests.Response.raise_for_status()
Simplify and avoid extra uncovered code paths.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
7788c4f3f7 local builds: provide a useful error message for a non-xyz base module
If allow_only_compatible_base_modules=True, then it's an error if the
module buildrequires a non-xyz base module stream. Give an error message
that says how to override the base module in the modulemd file.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
4026900f4f Add --buildrequires/--requires options to build_module_locally
Overriding the platform stream with, e.g, platform:el8.3.1
is necessary to correctly pick up the right build dependencies for some
configurations. Match the fedpkg/rhpkg module-build way of doing this by adding
--buildrequires and --requires options to build_module_locally.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
7761bbf5b4 Tweak behavior of get_compatible_base_module_modulemds
Fix some oddities in the DBResolver implementation of
get_compatible_base_module_modulemds() and make the MBSResolver version -
which was previously just buggy - match that. (Tests for the MBSResolver
version are added in a subsequent commit.)

 * If an empty virtual_streams argument was passed in, *all* streams
   were considered compatible. Throw an exception in this case - it
   should be considered an error.
 * If stream_version_lte=True, but the stream from the base module
   wasn't in the form FOOx.y.z, then throw an exception. This was
   previously treated like stream_version_lte=False, which is just
   a recipe for confusion and mistakes.

test_get_reusable_module_use_latest_build() is rewritten to
comprehensively test all possibilities, including the case that changed
above.

test_add_default_modules_compatible_platforms() is changed to run
under allow_only_compatible_base_modules=False, since it expected
Fedora-style virtual streams (versions not in FOOx.y.z form, all
share the same stream), which doesn't make sense with
allow_only_compatible_base_modules=True.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
c4230a352d LocalBuildConfiguration: Set ALLOW_ONLY_COMPATIBLE_BASE_MODULES = False
The default LocalBuildConfiguration builds against Fedora - which has
ALLOW_ONLY_COMPATIBLE_BASE_MODULES = False on the server side. Match that
to avoid warnings that f33 isn't in <stream>x.y.z form.
2022-04-29 15:47:08 -04:00
Owen W. Taylor
e48983132c Clarify the meaning conf.allow_only_compatible_base_modules=False
config.allow_compatible_base_modules=False does different things for
build-requires selection and for module reuse. Clarify this in the config
key documentation.

(This config key is really: True: "do what RHEL expects"
False: "do what Fedora expects")
2022-04-29 15:47:08 -04:00
Brendan Reilly
3a633967ec Merge #1737 Remove Greenwave Code 2022-04-14 19:50:11 +00:00
Brendan Reilly
4a30847bea Remove Greenwave Code
No implementations of MBS are using Greenwave, and there are no current plans
to do so. Koji Resolver will be sufficient for any usecase dependent on gating.
2022-03-30 14:27:34 -04:00
Mike McLean
24e1efd394 PR#1733: Replace dashes with underscore in stream name integration test
Merges #1733
https://pagure.io/fm-orchestrator/pull-request/1733
2021-10-29 16:04:08 -04:00
Brendan Reilly
e7016b25ae Replace dashes with underscore in stream name integration test 2021-10-29 11:40:35 -04:00
Mike McLean
3f876ae5c7 PR#1732: clarify id in readme
Merges #1732
https://pagure.io/fm-orchestrator/pull-request/1732
2021-10-26 14:56:35 -04:00
Mike McLean
033acf9b38 clarify id in readme
Fixes https://pagure.io/fm-orchestrator/issue/1723
2021-10-20 13:27:49 -04:00
Mike McLean
6718bd72c5 PR#1729: don't filter runtime deps for packagerV3 case
Merges #1729
https://pagure.io/fm-orchestrator/pull-request/1729
2021-08-30 11:59:16 -04:00
Mike McLean
2f324d2ba1 fix unit test 2021-08-26 17:07:23 -04:00
Mike McLean
85e5b9c738 don't filter runtime deps for packagerV3 case
Fixes: https://pagure.io/fm-orchestrator/issue/1714
2021-08-26 15:54:10 -04:00
Mike McLean
d5d150da58 PR#1719: Clarify common 500 errors
Merges #1719
https://pagure.io/fm-orchestrator/pull-request/1719
2021-08-23 12:08:36 -04:00
Brendan Reilly
2cb057daf6 update 2021-08-12 15:53:53 -04:00
Brendan Reilly
39add4382c Clarify common 500 errors 2021-08-12 15:48:37 -04:00
Mike McLean
889a20990f PR#1726: Update handler name used by SQLAlchemy
Merges #1726
https://pagure.io/fm-orchestrator/pull-request/1726
2021-08-12 12:52:24 -04:00
Brendan Reilly
1883fa8567 Update handler name used by SQLAlchemy 2021-08-12 11:50:46 -04:00
Mike McLean
d115c86ec6 PR#1724: Improve error messaging for module submission.
Merges #1724
https://pagure.io/fm-orchestrator/pull-request/1724

Fixes: #1098
https://pagure.io/fm-orchestrator/issue/1098
[RFE] Improve the error messages when a user submits a module
2021-07-29 16:34:08 -04:00
Joe Talbott
06d31786e8 Improve error messaging for module submission.
Fixes: https://pagure.io/fm-orchestrator/issue/1098
2021-07-29 16:34:03 -04:00
Mike McLean
e44d203287 PR#1721: Remove conf/cacert.pem
Merges #1721
https://pagure.io/fm-orchestrator/pull-request/1721

Fixes: #1631
https://pagure.io/fm-orchestrator/issue/1631
delete conf/cacert.pem
2021-07-29 16:29:28 -04:00
Joe Talbott
10e1a9afd0 Remove conf/cacert.pem
Fixes: https://pagure.io/fm-orchestrator/issue/1631
2021-07-29 16:29:23 -04:00
Mike McLean
b0de17f7e8 PR#1720: Remove conf/__init__.py
Merges #1720
https://pagure.io/fm-orchestrator/pull-request/1720

Fixes: #1630
https://pagure.io/fm-orchestrator/issue/1630
delete conf/__init__.py
2021-07-29 16:26:30 -04:00
Joe Talbott
531bdb519b Remove conf/__init__.py
Fixes: https://pagure.io/fm-orchestrator/issue/1630
2021-07-29 16:26:24 -04:00
Mike McLean
ff32aaef47 PR#1717: Fail if requested side tag is not available for any base modules.
Merges #1717
https://pagure.io/fm-orchestrator/pull-request/1717
2021-07-29 16:21:59 -04:00
Joe Talbott
933c4fd8dd Update error message. 2021-07-29 16:21:55 -04:00
Joe Talbott
6b42102cc6 Fail if requested side tag is not available for any base modules. 2021-07-29 16:21:55 -04:00
Mike McLean
e5d0b39664 PR#1708: Exclude specific platform streams from stream expansion
Merges #1708
https://pagure.io/fm-orchestrator/pull-request/1708

Fixes: #1639
https://pagure.io/fm-orchestrator/issue/1639
[RFE] Exclude certain platform stream(s) from [ ] expansion
2021-07-29 15:15:08 -04:00
Brendan Reilly
669318f1fd Exclude specific platform streams from stream expansion
Fixes: #1639
2021-07-29 15:15:03 -04:00
Mike McLean
14ce0c41c6 PR#1725: Allow overriding RPM components refs while submitting the module build.
Merges #1725
https://pagure.io/fm-orchestrator/pull-request/1725
2021-07-28 10:07:41 -04:00
Jan Kaluza
bfd9a13205 Allow overriding RPM components refs while submitting the module build.
There is a need to rebuild the module builds done in CentOS 9 Stream
internally in MBS to include them in RHEL. This is currenly a hard task,
because the RPM components included in a module are usually
taken from HEAD of the branch defined by their `ref` value.

For the rebuild task, it means we would have to ensure that the HEAD
of all RPM components points to right commit hash right before we start
rebuilding CentOS 9 Stream module in internal MBS. This is very hard
and fragile thing to do, especially if there are two different modules
using the RPM component from the same branch. This is prone to race
condition and makes the rebuilds quite complex and in some cases
not possible to do without force pushes to RPM component repositories
which is not acceptable by internal dist-git policy.

This commit fixes it by allowing overriding the commit hash while
submitting the module build. This helps in the mentioned situation,
because we can keep internal RPM components branches in 1:1 sync with
CentOS 9 Stream branches and HEAD can always point to the same commit
in both internal and CentOS 9 Stream repositories.

When the module rebuild is submitted in internal MBS,
we can use this new feature to override the `ref` for each RPM component
so it points to particular commit and the requirement for HEAD to point
to this commit is no longer there.

The `ref` is overriden only internally in MBS (but it is recorded in logs
and in XMD section), so the input modulemd file is not altered. This is
the same logic as used for other overrides (`buildrequire_overrides` or
`side_tag`).

This does not bring any security problem, because it is already possible
to use commit hash in `ref`, so the package maintainer can already change
the commit hash to any particular commit by using this `ref` value.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2021-07-28 08:48:12 +02:00
Mike McLean
31412a464f PR#1718: also nudge reused components after 10 minutes
Merges #1718
https://pagure.io/fm-orchestrator/pull-request/1718

Fixes: #1621
https://pagure.io/fm-orchestrator/issue/1621
unable to recover from failed tag operation
2021-07-19 14:23:51 -04:00
Mike McLean
a1494e66aa also nudge reused components after 10 minutes 2021-07-07 18:22:24 -04:00
Mike McLean
d944666fe1 PR#1715: List missing streams in exception message.
Merges #1715
https://pagure.io/fm-orchestrator/pull-request/1715

Fixes: #1574
https://pagure.io/fm-orchestrator/issue/1574
Error message improvement
2021-06-25 15:49:12 -04:00
Joe Talbott
1957d7db86 resolve: Fix docstring. 2021-06-25 15:49:09 -04:00
Joe Talbott
f1a3025a9a resolve: Update docstring with added return field. 2021-06-25 15:49:09 -04:00
Joe Talbott
b3203caf76 List missing streams in exception message.
Fixes: https://pagure.io/fm-orchestrator/issue/1574
2021-06-25 15:49:09 -04:00
Mike McLean
d1f2b85dea PR#1709: Fixed scratch build suffix bug
Merges #1709
https://pagure.io/fm-orchestrator/pull-request/1709
2021-06-16 12:06:19 -04:00
Martin Curlej
71a44bdfb6 Fixed scratch build suffix bug
When building a scratch build of a module with static context
the scratch suffix was added twice.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-06-16 12:06:14 -04:00
Mike McLean
5cdb2127fe PR#1711: Enforce sane module state transitions
Merges #1711
https://pagure.io/fm-orchestrator/pull-request/1711
2021-06-15 15:05:10 -04:00