Commit 30744469 authored by Adrian DC's avatar Adrian DC
Browse files

fix(entrypoint): detect if GitLab actions can continue

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent e56e0548
Loading
Loading
Loading
Loading
Loading
+19 −10
Changes for src/cli/entrypoint.py: 19 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -69,11 +69,12 @@ class Entrypoint:

            # Handle group
            if not options.exclude_group:
                Entrypoint.group(
                if not Entrypoint.group(
                        options,
                        gitlab,
                        group.id,
                )
                ):
                    return False

            # Iterate through subgroups
            if not options.exclude_subgroups:
@@ -86,12 +87,13 @@ class Entrypoint:
                        ),
                        key=lambda item: item.full_path,
                ):
                    Entrypoint.group(
                    if not Entrypoint.group(
                            options,
                            gitlab,
                            group_subgroup.id,
                            True,
                    )
                    ):
                        return False

            # Iterate through projects
            if not options.exclude_projects:
@@ -104,11 +106,12 @@ class Entrypoint:
                        ),
                        key=lambda item: item.path_with_namespace,
                ):
                    Entrypoint.project(
                    if not Entrypoint.project(
                            options,
                            gitlab,
                            group_project.id,
                    )
                    ):
                        return False

        # Result
        return True
@@ -120,7 +123,7 @@ class Entrypoint:
        gitlab: GitLabFeature,
        criteria: str,
        subgroup: bool = False,
    ) -> None:
    ) -> bool:

        # Acquire group
        group = gitlab.group(criteria)
@@ -153,7 +156,7 @@ class Entrypoint:
                  f'{Colors.RESET}')
            print(' ')
            Platform.flush()
            return
            return subgroup

        # Set group description
        if options.set_description:
@@ -208,13 +211,16 @@ class Entrypoint:
        print(' ')
        Platform.flush()

        # Result
        return True

    # Project, pylint: disable=too-many-branches,too-many-statements
    @staticmethod
    def project(
        options: Namespace,
        gitlab: GitLabFeature,
        criteria: str,
    ) -> None:
    ) -> bool:

        # Acquire project
        project = gitlab.project(criteria)
@@ -237,7 +243,7 @@ class Entrypoint:
                  f'{Colors.RESET}')
            print(' ')
            Platform.flush()
            return
            return True

        # Set project description
        if options.set_description:
@@ -354,3 +360,6 @@ class Entrypoint:
        # Footer
        print(' ')
        Platform.flush()

        # Result
        return True