diff --git a/docs/architecture.rst b/docs/architecture.rst index 9205f12f..cece384a 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -96,7 +96,7 @@ All subcommands are divided into several groups depending on the role they are d * ``aur`` (``aur-search``) group is for AUR operations. * ``help`` (e.g. ``help``) are system commands. * ``package`` subcommands (e.g. ``package-add``) allow to perform single package actions. -* ``patch`` subcommands (e.g. ``pacth-list``) are the special case of ``package`` subcommands introduced in order to control patches for packages. +* ``patch`` subcommands (e.g. ``patch-list``) are the special case of ``package`` subcommands introduced in order to control patches for packages. * ``repo`` subcommands (e.g. ``repo-check``) usually perform actions on whole repository. * ``service`` subcommands (e.g. ``service-setup``) perform actions which are related to whole service managing: create repository, show configuration. * ``user`` subcommands (``user-add``) are intended for user management. diff --git a/docs/faq.rst b/docs/faq.rst index 889c2a90..3534e3b5 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -545,7 +545,7 @@ In this example we are going to use files and packages which are provided by off .. code-block:: shell - wget http://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst + wget https://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst pacman -U archlinux32-keyring-20230705-1.0-any.pkg.tar.zst #. @@ -553,7 +553,7 @@ In this example we are going to use files and packages which are provided by off .. code-block:: shell - wget http://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst + wget https://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst pacman -U devtools-20221208-1.2-any.pkg.tar.zst Alternatively, you can create your own ``makepkg`` configuration and save it as ``/usr/share/devtools/makepkg.conf.d/i686.conf``. @@ -563,7 +563,7 @@ In this example we are going to use files and packages which are provided by off .. code-block:: shell - ahriman -a i686 service-setup --mirror 'http://de.mirror.archlinux32.org/$arch/$repo'--no-multilib ... + ahriman -a i686 service-setup --mirror 'https://de.mirror.archlinux32.org/$arch/$repo'--no-multilib ... In addition to usual options, you need to specify the following options: @@ -598,8 +598,8 @@ There are two possible ways to achieve same setup, by using docker container. Th .. code-block:: dockerfile RUN pacman --noconfirm -Sy wget - RUN wget http://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst && pacman --noconfirm -U devtools-20221208-1.2-any.pkg.tar.zst - RUN wget http://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst && pacman --noconfirm -U archlinux32-keyring-20230705-1.0-any.pkg.tar.zst + RUN wget https://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst && pacman --noconfirm -U devtools-20221208-1.2-any.pkg.tar.zst + RUN wget https://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst && pacman --noconfirm -U archlinux32-keyring-20230705-1.0-any.pkg.tar.zst #. At that point you should have full ``Dockerfile`` like: @@ -611,8 +611,8 @@ There are two possible ways to achieve same setup, by using docker container. Th RUN pacman-key --init RUN pacman --noconfirm -Sy wget - RUN wget http://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst && pacman --noconfirm -U devtools-20221208-1.2-any.pkg.tar.zst - RUN wget http://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst && pacman --noconfirm -U archlinux32-keyring-20230705-1.0-any.pkg.tar.zst + RUN wget https://pool.mirror.archlinux32.org/i686/extra/devtools-20221208-1.2-any.pkg.tar.zst && pacman --noconfirm -U devtools-20221208-1.2-any.pkg.tar.zst + RUN wget https://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-20230705-1.0-any.pkg.tar.zst && pacman --noconfirm -U archlinux32-keyring-20230705-1.0-any.pkg.tar.zst #. After that you can build you own container, e.g.: @@ -626,7 +626,7 @@ There are two possible ways to achieve same setup, by using docker container. Th .. code-block:: shell - docker run --privileged -p 8080:8080 -e AHRIMAN_ARCHITECTURE=i686 -e AHRIMAN_PACMAN_MIRROR='http://de.mirror.archlinux32.org/$arch/$repo' -e AHRIMAN_MULTILIB= ahriman-i686:latest + docker run --privileged -p 8080:8080 -e AHRIMAN_ARCHITECTURE=i686 -e AHRIMAN_PACMAN_MIRROR='https://de.mirror.archlinux32.org/$arch/$repo' -e AHRIMAN_MULTILIB= ahriman-i686:latest Remote synchronization ---------------------- diff --git a/recipes/README.md b/recipes/README.md index ec846046..e49d5a0d 100644 --- a/recipes/README.md +++ b/recipes/README.md @@ -7,7 +7,7 @@ Collection of the examples of docker compose configuration files, which covers s * [Check](check): double process service; one with periodic checks (automatic build disabled) and other one is with the web service. * [Daemon](daemon): service with periodic repository checks. * [Distributed](distributed): cluster of three nodes, one with web interface and two workers which are responsible for build process. -* [Distrubuted manual](distributed-manual): same as [distributed](distributed), but two nodes and update process must be run on worker node manually. +* [Distributed manual](distributed-manual): same as [distributed](distributed), but two nodes and update process must be run on worker node manually. * [i686](i686): non-x86_64 architecture setup. * [Multi repo](multirepo): run web service with two separated repositories. * [Pull](pull): normal service, but in addition with pulling packages from another source (e.g. GitHub repository). diff --git a/recipes/i686/Dockerfile b/recipes/i686/Dockerfile index a83eca9f..e9ca47ee 100644 --- a/recipes/i686/Dockerfile +++ b/recipes/i686/Dockerfile @@ -5,5 +5,5 @@ ENV ARCH32_KEYRING_VERSION="20231126-1.0" RUN pacman-key --init RUN pacman -Sy --noconfirm wget && \ - wget -nv http://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-${ARCH32_KEYRING_VERSION}-any.pkg.tar.zst && \ + wget -nv https://pool.mirror.archlinux32.org/i686/core/archlinux32-keyring-${ARCH32_KEYRING_VERSION}-any.pkg.tar.zst && \ pacman -U --noconfirm archlinux32-keyring-${ARCH32_KEYRING_VERSION}-any.pkg.tar.zst diff --git a/src/ahriman/application/application/workers/updater.py b/src/ahriman/application/application/workers/updater.py index a1852a4c..08655f06 100644 --- a/src/ahriman/application/application/workers/updater.py +++ b/src/ahriman/application/application/workers/updater.py @@ -34,9 +34,6 @@ from ahriman.models.worker import Worker class Updater(LazyLogging): """ updater handler interface - - Attributes: - split_method(Callable[[Iterable[Package]], list[list[Package]]]): method to split packages into chunks """ @staticmethod diff --git a/src/ahriman/application/handlers/handler.py b/src/ahriman/application/handlers/handler.py index 85679fb9..efa09744 100644 --- a/src/ahriman/application/handlers/handler.py +++ b/src/ahriman/application/handlers/handler.py @@ -170,7 +170,7 @@ class Handler: # extract repository names first if (from_args := args.repository) is not None: repositories: Iterable[str] = [from_args] - elif (from_filesystem := RepositoryPaths.known_repositories(root)): + elif from_filesystem := RepositoryPaths.known_repositories(root): repositories = from_filesystem else: # try to read configuration now repositories = [configuration.get("repository", "name")] diff --git a/src/ahriman/core/build_tools/sources.py b/src/ahriman/core/build_tools/sources.py index b0e8dc80..c13059f4 100644 --- a/src/ahriman/core/build_tools/sources.py +++ b/src/ahriman/core/build_tools/sources.py @@ -344,7 +344,7 @@ class Sources(LazyLogging): str: HEAD commit hash """ # we might want to parse git files instead though - return check_output("git", "rev-parse", ref_name, cwd=sources_dir) + return check_output("git", "rev-parse", ref_name, cwd=sources_dir, logger=self.logger) def move(self, pkgbuild_dir: Path, sources_dir: Path) -> None: """ diff --git a/src/ahriman/core/build_tools/task.py b/src/ahriman/core/build_tools/task.py index a67b15de..2878adde 100644 --- a/src/ahriman/core/build_tools/task.py +++ b/src/ahriman/core/build_tools/task.py @@ -38,7 +38,7 @@ class Task(LazyLogging): archbuild_flags(list[str]): command flags for archbuild command architecture(str): repository architecture build_command(str): build command - makechroootpkg_flags(list[str]): command flags for makechrootpkg command + makechrootpkg_flags(list[str]): command flags for makechrootpkg command makepkg_flags(list[str]): command flags for makepkg command package(Package): package definitions paths(RepositoryPaths): repository paths instance diff --git a/src/ahriman/core/status/client.py b/src/ahriman/core/status/client.py index 2b16c992..9f7a6ae4 100644 --- a/src/ahriman/core/status/client.py +++ b/src/ahriman/core/status/client.py @@ -41,7 +41,7 @@ class Client: load client from settings Args: - repository_id(RepositoryId): repository unqiue identifier + repository_id(RepositoryId): repository unique identifier configuration(Configuration): configuration instance report(bool): force enable or disable reporting diff --git a/src/ahriman/core/tree.py b/src/ahriman/core/tree.py index 5fe87514..fcffed47 100644 --- a/src/ahriman/core/tree.py +++ b/src/ahriman/core/tree.py @@ -276,8 +276,8 @@ class Tree: unprocessed = sorted(self.leaves, key=lambda leaf: leaf.package.base) while unprocessed: # pick one and append it to the most free partition and build chunk - leaf = unprocessed.pop() - chunk = [leaf] + first_leaf = unprocessed.pop() + chunk = [first_leaf] while True: # python doesn't allow to use walrus operator to unpack tuples # get packages which depend on packages in chunk diff --git a/src/ahriman/models/result.py b/src/ahriman/models/result.py index 21b194f5..eea7ab54 100644 --- a/src/ahriman/models/result.py +++ b/src/ahriman/models/result.py @@ -46,7 +46,7 @@ class Result: default constructor Args: - addded(Iterable[Package] | None, optional): initial list of successfully added packages + added(Iterable[Package] | None, optional): initial list of successfully added packages (Default value = None) updated(Iterable[Package] | None, optional): initial list of successfully updated packages (Default value = None) diff --git a/tests/ahriman/application/handlers/test_handler_users.py b/tests/ahriman/application/handlers/test_handler_users.py index 82ac16dc..33beace5 100644 --- a/tests/ahriman/application/handlers/test_handler_users.py +++ b/tests/ahriman/application/handlers/test_handler_users.py @@ -1,6 +1,4 @@ import argparse -import configparser - import pytest from pytest_mock import MockerFixture diff --git a/tests/ahriman/conftest.py b/tests/ahriman/conftest.py index 1d5f7654..904e213c 100644 --- a/tests/ahriman/conftest.py +++ b/tests/ahriman/conftest.py @@ -565,6 +565,7 @@ def watcher(repository_id: RepositoryId, database: SQLite, repository: Repositor Args: repository_id(RepositoryId): repository identifier fixture database(SQLite): database fixture + repository(Repository): repository fixture Returns: Watcher: package status watcher test instance diff --git a/tests/ahriman/core/build_tools/test_sources.py b/tests/ahriman/core/build_tools/test_sources.py index 659fb1bb..61356a66 100644 --- a/tests/ahriman/core/build_tools/test_sources.py +++ b/tests/ahriman/core/build_tools/test_sources.py @@ -510,7 +510,7 @@ def test_head(sources: Sources, mocker: MockerFixture) -> None: local = Path("local") assert sources.head(local) == "sha" - check_output_mock.assert_called_once_with("git", "rev-parse", "HEAD", cwd=local) + check_output_mock.assert_called_once_with("git", "rev-parse", "HEAD", cwd=local, logger=sources.logger) def test_head_specific(sources: Sources, mocker: MockerFixture) -> None: @@ -521,7 +521,7 @@ def test_head_specific(sources: Sources, mocker: MockerFixture) -> None: local = Path("local") assert sources.head(local, "master") == "sha" - check_output_mock.assert_called_once_with("git", "rev-parse", "master", cwd=local) + check_output_mock.assert_called_once_with("git", "rev-parse", "master", cwd=local, logger=sources.logger) def test_move(sources: Sources, mocker: MockerFixture) -> None: diff --git a/tests/ahriman/core/formatters/conftest.py b/tests/ahriman/core/formatters/conftest.py index 61032a31..89d057f4 100644 --- a/tests/ahriman/core/formatters/conftest.py +++ b/tests/ahriman/core/formatters/conftest.py @@ -145,7 +145,7 @@ def update_printer(package_ahriman: Package) -> UpdatePrinter: package_ahriman(Package): package fixture Returns: - UpdatePrinter: udpate printer test instance + UpdatePrinter: update printer test instance """ return UpdatePrinter(package_ahriman, None) diff --git a/tests/ahriman/core/test_util.py b/tests/ahriman/core/test_util.py index 5cb1179c..a1a049c8 100644 --- a/tests/ahriman/core/test_util.py +++ b/tests/ahriman/core/test_util.py @@ -15,6 +15,7 @@ from ahriman.core.util import check_output, check_user, dataclass_view, enum_val srcinfo_property, srcinfo_property_list, trim_package, unquote, utcnow, walk from ahriman.models.package import Package from ahriman.models.package_source import PackageSource +from ahriman.models.repository_id import RepositoryId from ahriman.models.repository_paths import RepositoryPaths @@ -150,11 +151,11 @@ def test_check_output_empty_line(mocker: MockerFixture) -> None: logger_mock.assert_has_calls([MockCall(""), MockCall("hello")]) -def test_check_user(mocker: MockerFixture) -> None: +def test_check_user(repository_id: RepositoryId, mocker: MockerFixture) -> None: """ must check user correctly """ - paths = RepositoryPaths(Path.cwd(), "x86_64") + paths = RepositoryPaths(Path.cwd(), repository_id) mocker.patch("os.getuid", return_value=paths.root_owner[0]) check_user(paths, unsafe=False) @@ -167,22 +168,22 @@ def test_check_user_no_directory(repository_paths: RepositoryPaths, mocker: Mock check_user(repository_paths, unsafe=False) -def test_check_user_exception(mocker: MockerFixture) -> None: +def test_check_user_exception(repository_id: RepositoryId, mocker: MockerFixture) -> None: """ must raise exception if user differs """ - paths = RepositoryPaths(Path.cwd(), "x86_64") + paths = RepositoryPaths(Path.cwd(), repository_id) mocker.patch("os.getuid", return_value=paths.root_owner[0] + 1) with pytest.raises(UnsafeRunError): check_user(paths, unsafe=False) -def test_check_user_unsafe(mocker: MockerFixture) -> None: +def test_check_user_unsafe(repository_id: RepositoryId, mocker: MockerFixture) -> None: """ must skip check if unsafe flag is set """ - paths = RepositoryPaths(Path.cwd(), "x86_64") + paths = RepositoryPaths(Path.cwd(), repository_id) mocker.patch("os.getuid", return_value=paths.root_owner[0] + 1) check_user(paths, unsafe=True) diff --git a/tests/ahriman/core/triggers/test_trigger_loader.py b/tests/ahriman/core/triggers/test_trigger_loader.py index 5263db03..940041d2 100644 --- a/tests/ahriman/core/triggers/test_trigger_loader.py +++ b/tests/ahriman/core/triggers/test_trigger_loader.py @@ -37,7 +37,9 @@ def test_load_trigger(trigger_loader: TriggerLoader, configuration: Configuratio """ must load trigger """ - loaded = trigger_loader.load_trigger("ahriman.core.report.ReportTrigger", "x86_64", configuration) + _, repository_id = configuration.check_loaded() + + loaded = trigger_loader.load_trigger("ahriman.core.report.ReportTrigger", repository_id, configuration) assert loaded assert isinstance(loaded, ReportTrigger) diff --git a/tests/ahriman/models/test_aur_package.py b/tests/ahriman/models/test_aur_package.py index 3e402834..b224e8db 100644 --- a/tests/ahriman/models/test_aur_package.py +++ b/tests/ahriman/models/test_aur_package.py @@ -54,8 +54,7 @@ def test_from_json_2(aur_package_ahriman: AURPackage, mocker: MockerFixture) -> assert AURPackage.from_json(asdict(aur_package_ahriman)) == aur_package_ahriman -def test_from_pacman(pyalpm_package_ahriman: pyalpm.Package, aur_package_ahriman: AURPackage, - resource_path_root: Path) -> None: +def test_from_pacman(pyalpm_package_ahriman: pyalpm.Package, aur_package_ahriman: AURPackage) -> None: """ must load package from repository database """ diff --git a/tests/ahriman/models/test_package.py b/tests/ahriman/models/test_package.py index daf764c5..229f37a0 100644 --- a/tests/ahriman/models/test_package.py +++ b/tests/ahriman/models/test_package.py @@ -320,7 +320,7 @@ def test_local_files_empty(mocker: MockerFixture, resource_path_root: Path) -> N assert list(Package.local_files(Path("path"))) == [] -def test_local_files_error(mocker: MockerFixture, resource_path_root: Path) -> None: +def test_local_files_error(mocker: MockerFixture) -> None: """ must raise exception on package parsing for local sources """ diff --git a/tests/ahriman/web/middlewares/test_exception_handler.py b/tests/ahriman/web/middlewares/test_exception_handler.py index 8a94afaf..b926829a 100644 --- a/tests/ahriman/web/middlewares/test_exception_handler.py +++ b/tests/ahriman/web/middlewares/test_exception_handler.py @@ -139,7 +139,7 @@ async def test_exception_handler_head() -> None: async def test_exception_handler_method_not_allowed() -> None: """ - must handle not allowed methodss + must handle not allowed methods """ request = pytest.helpers.request("", "", "POST") request_handler = AsyncMock(side_effect=HTTPMethodNotAllowed("POST", ["GET"]))