Commit graph

1430 commits

Author SHA1 Message Date
Mike McLean
71a891f428 ensure that cursors are closed in QueryProcessor.iterate()
By using try..finally here, we ensure the cursor cleanup is performed
even if the generator is not exhausted before being garbage collected.

Fixes https://pagure.io/koji/issue/2435
2020-08-12 11:34:43 -04:00
Mike McLean
4e46be954e editTag: make compat perm_id option an alias for perm
Fixes https://pagure.io/koji/issue/2375
2020-07-29 15:47:02 +02:00
Ken Dreyer
07bc3a82d6 hub: document listBType return value when query matches no entries
When a user calls listBType with a query parameter and that query
matches no existing btypes, the listBType method returns an empty list.
Add this information to the listBType docstring.
2020-07-23 10:16:01 +02:00
Tomas Kopecek
a8bee1511f hub: importImage doesn't honor volume
We're not sending updated build_info to the method and it is requesting
data from db. There is not volume saved yet.

Change is reusing modified buildinfo.

Fixes: https://pagure.io/koji/issue/2355
2020-07-15 12:06:55 -04:00
Yu Ming Zhu
f68f277ee6 hub: make sure checksum_type is int for DB
fixes: #2368
2020-07-13 06:16:24 +00:00
Mike McLean
1305fe8cf2 also consider task data in apply_volume_policy() 2020-07-02 16:54:22 +02:00
Mike McLean
da8fe93755 policy_get_build_tags: use target data if available
Fixes https://pagure.io/koji/issue/2305
2020-07-02 16:54:22 +02:00
Mike McLean
c90a6ced65 fix handling of indirectionimage in policy_data_from_task_args() 2020-07-02 16:54:22 +02:00
Mike McLean
e1a53b971a use policy_data_from_task in complete*Build calls 2020-07-02 16:54:22 +02:00
Mike McLean
9a90a3edf5 split off "policy data from task" logic 2020-07-02 16:54:22 +02:00
Tomas Kopecek
c13bcecbc7 fix error message 2020-07-01 14:01:01 +02:00
Ken Dreyer
c1511ae182 hub: remove "GssapiLocalName off" setting
mod_auth_gssapi already defaults "GssapiLocalName" to "off". Simplify
our configuration and just remove this line.
2020-07-01 11:40:29 +02:00
Tomas Kopecek
dd4f39208e fix option order
Related: https://pagure.io/koji/issue/2086
2020-06-30 14:51:23 +02:00
Tomas Kopecek
03b55bf39e hub: allow glob matching for listTags
server-side filtering would be better than CLI/client side filtering.

Fixes: https://pagure.io/koji/issue/2086
2020-06-30 14:20:32 +02:00
Tomas Kopecek
76cf735aed hub: fix typo
Fixes: https://pagure.io/koji/issue/1969
2020-06-24 15:10:35 +02:00
Ken Dreyer
9014fac420 hub: remove "GssapiSSLonly Off" option
mod_auth_gssapi already defaults "GssapiSSLonly" to "off", and in fact
this is not something we want to recommend to users.
2020-06-24 14:48:51 +02:00
Yu Ming Zhu
1be2064df1 fix flake8 for kojihub.py 2020-06-24 14:42:01 +02:00
Yuming Zhu
65f5b6489b fix param name for uploadFile 2020-06-24 14:42:01 +02:00
Tomas Kopecek
50bcb6f3bc replace md5 with sha256 2020-06-24 14:42:01 +02:00
Yu Ming Zhu
a893e8bf2b a wrapper ignoring FIPS for hashlib.md5 2020-06-24 14:42:00 +02:00
Tomas Kopecek
ba02c1b977 improve race condition for getNextRelease / images
Fixes: https://pagure.io/koji/issue/2138
2020-06-24 13:36:23 +02:00
Mike McLean
b2dd73fa03 avoid redundant clauses and joins
Fixes https://pagure.io/koji/issue/2300
2020-06-24 10:40:36 +02:00
Ken Dreyer
993be46a4c hub: document listChannels arguments
Describe the arguments and return value for the listChannels() method.
2020-06-23 12:24:04 +02:00
Tomas Kopecek
af311184fc dropping six from hub/web 2020-06-18 15:41:35 +02:00
Ken Dreyer
d7d745295a hub: simplify recipients condition in build_notification()
If get_notification_recipients() returns a non-empty list of recipients,
then the build_notification() method creates a new buildNotification task.

Simplify the conditional that checks the get_notification_recipients()
return value so that it is easier to read. Python treats an empty list
as False and a non-empty list as True, so we don't need to explicitly
test the list length here.

The purpose of this change is to make this code easier to read and
understand.
2020-06-18 15:22:44 +02:00
Ken Dreyer
4e9a1590f3 hub: fix "opt-outs" comment in get_notification_recipients()
Fix a typo in the comment that describes the block of code that
assembles the set of opt-outs.
2020-06-16 12:31:36 +02:00
Tomas Kopecek
47210e44bf hub: default policy allow packagelist changes with 'tag' permission
Fixes: https://pagure.io/koji/issue/2011
2020-06-16 11:04:14 +02:00
Tomas Kopecek
eb8d7f92a8 PR#2308: hub: return empty list in get_notification_recipients()
Merges #2308
https://pagure.io/koji/pull-request/2308

Fixes: #2307
https://pagure.io/koji/issue/2307
get_notification_recipients() can return None, leading to build_notification() crash
2020-06-16 09:58:40 +02:00
Ken Dreyer
4fb79b9e9f hub: return empty list in get_notification_recipients()
If we find no recipients, return an empty list, rather than None.

This fixes a crash in build_notifications() where we expect to call
len() on the return value from get_notification_recipients().

Fixes: https://pagure.io/koji/issue/2307
2020-06-16 09:58:28 +02:00
Mike McLean
0b1482d924 disable notifications by default in [un]tagBuildBypass calls
Fixes https://pagure.io/koji/issue/2292
2020-06-11 14:42:38 -04:00
Tomas Kopecek
efecdad43a hub: query_buildroots fix query behaviour
Fixes: https://pagure.io/koji/issue/2302
2020-06-10 11:06:32 +02:00
Tomas Kopecek
db41061111 hub: query_buildroots have to return ASAP
If candidate_buildroot_ids are pruned to zero in some point,
query_buildroots have to return. Otherwise big working queryset will be
created eating resources and returning empty list anyway.

Fixes: https://pagure.io/koji/issue/2298
2020-06-09 16:06:26 +02:00
Tomas Kopecek
5bc763ab2d hub: log tracebacks for multicalls
Fixes: https://pagure.io/koji/issue/2204
2020-06-03 15:34:56 +02:00
Tomas Kopecek
ef43ba0b7b replace deprecated function with logging
Relates: https://pagure.io/koji/issue/1440

warnings doesn't behave well with python 3.8 causing segfaults. Let's
user simple logging for a while.
2020-05-19 14:29:52 +02:00
Tomas Kopecek
404666d54c hub: deprecate host.getTask call
Fixes: https://pagure.io/koji/issue/1440
2020-05-18 11:40:25 +02:00
Tomas Kopecek
3f109f610b hub: API docs
Fixes: https://pagure.io/koji/issue/2108
2020-05-13 16:03:52 +02:00
Tomas Kopecek
64468b688e hub: additional API docs
Fixes: https://pagure.io/koji/issue/2109
2020-05-13 16:03:10 +02:00
Carl George
7382eabe43 Correct docstring about deleting inheritance rules
The docstring for the setInheritanceData method states that a special
"remove link" key set to True will remove an inheritance rule.  The
_writeInheritanceData function actually looks for a "delete link" key.
The commit updates the docstring to reflect reality.
2020-05-04 23:52:18 -05:00
Tomas Kopecek
9c7b4b91b1 don't traceback on missing user 2020-04-29 10:08:52 +02:00
Tomas Kopecek
913bc4026b hub: admin can't force tag now
Fixes: https://pagure.io/koji/issue/2202
2020-04-29 10:08:52 +02:00
Ken Dreyer
0049e8604f hub: document addExternalRepoToTag arguments
Describe the types of each argument to the addExternalRepoToTag() method.
2020-04-27 15:17:44 +02:00
Ken Dreyer
a14a21b2c2 hub: document createUser arguments
Describe the types of each argument to the createUser() method.
2020-04-23 17:33:51 -06:00
Tomas Kopecek
0132313f92 replace logging.warn with warning
call is deprected in python 3.7

Fixes: https://pagure.io/koji/issue/2135
2020-04-22 13:47:15 +02:00
Tomas Kopecek
4d4e569909 translate exceptions to GenericError
Fixes: https://pagure.io/koji/issue/2067
2020-04-22 10:37:14 +02:00
Ken Dreyer
3c7d8c8407 hub: document editUser method
Describe the types of each argument to the edit_user() method. Give some
example values for krb_principal_mappings.
2020-04-22 09:54:58 +02:00
Ken Dreyer
4c505be0fa hub: document removeExternalRepoFromTag arguments
Describe the types of each argument to the removeExternalRepoFromTag()
method.
2020-04-22 09:42:32 +02:00
Ken Dreyer
5d86ecacf5 hub: document getTagExternalRepos
Describe the types of each argument to the getTagExternalRepos() method.
2020-04-22 09:42:00 +02:00
Yuming Zhu
293cc87325 hub: assert_policy - use hasPerm instead of assertPerm
fixes: #1930
2020-04-15 11:53:01 +02:00
Tomas Kopecek
7970e78092 drop "keys" field 2020-04-07 12:27:56 +02:00
Tomas Kopecek
9ef57c0f82 new policy for dist-repo
Fixes: https://pagure.io/koji/issue/1660
2020-04-07 12:27:56 +02:00