Harmonize listers parameters and add test to check mandatory ones
Ensure that all lister classes have the same set of mandatory parameters in their constructors, notably: scheduler, url, instance and credentials. Add a new test checking listers classes have mandatory parameters declared in their constructors. The purpose is to avoid deployment issues on staging or production environment as celery tasks can fail to be executed if mandatory parameters are not handled by listers. Reated to swh/infra/sysadm-environment#5030.
This commit is contained in:
parent
5f717e311d
commit
6e7bc49ec7
27 changed files with 231 additions and 73 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2022 The Software Heritage developers
|
||||
# Copyright (C) 2022-2023 The Software Heritage developers
|
||||
# See the AUTHORS file at the top-level directory of this distribution
|
||||
# License: GNU General Public License version 3, or any later version
|
||||
# See top-level LICENSE file for more information
|
||||
|
@ -46,6 +46,8 @@ class AurLister(StatelessLister[AurListerPage]):
|
|||
def __init__(
|
||||
self,
|
||||
scheduler: SchedulerInterface,
|
||||
url: str = BASE_URL,
|
||||
instance: str = INSTANCE,
|
||||
credentials: Optional[CredentialsType] = None,
|
||||
max_origins_per_page: Optional[int] = None,
|
||||
max_pages: Optional[int] = None,
|
||||
|
@ -54,8 +56,8 @@ class AurLister(StatelessLister[AurListerPage]):
|
|||
super().__init__(
|
||||
scheduler=scheduler,
|
||||
credentials=credentials,
|
||||
instance=self.INSTANCE,
|
||||
url=self.BASE_URL,
|
||||
instance=instance,
|
||||
url=url,
|
||||
max_origins_per_page=max_origins_per_page,
|
||||
max_pages=max_pages,
|
||||
enable_origins=enable_origins,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue