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

feat(entrypoint): list limited features per line, then confirm

Issue: #3
---

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 123132b9
Loading
Loading
Loading
Loading
+30 −9
Changes for src/cli/entrypoint.py: 30 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -587,11 +587,18 @@ class Entrypoint:

        # Confirm group is exportable
        export_limitations = input_gitlab.group_export_limitations(input_group.full_path)
        if export_limitations and not Entrypoint.confirm(
                'Limited group export',
        if export_limitations:
            print(f'{Colors.BOLD}   - Limited group export detected: '
                  f'{Colors.RESET}')
            for export_limitation in export_limitations:
                print(f'{Colors.BOLD}     - Limited feature export: '
                      f'{Colors.CYAN}{export_limitation}')
            if not Entrypoint.confirm(
                    '',
                    input_group.full_path,
                    not options.confirm,
                'which uses "' + ("\", \"").join(export_limitations) + '"',
                    'limited group export',
                    indent='     ',
            ):
                raise PermissionError()

@@ -772,11 +779,18 @@ class Entrypoint:
        # Confirm project is exportable
        export_limitations = input_gitlab.project_export_limitations(
            input_project.path_with_namespace)
        if export_limitations and not Entrypoint.confirm(
                'Limited project export',
        if export_limitations:
            print(f'{Colors.BOLD}   - Limited project export detected: '
                  f'{Colors.RESET}')
            for export_limitation in export_limitations:
                print(f'{Colors.BOLD}     - Limited feature export: '
                      f'{Colors.CYAN}{export_limitation}')
            if not Entrypoint.confirm(
                    '',
                    input_project.path_with_namespace,
                    not options.confirm,
                'which uses "' + ("\", \"").join(export_limitations) + '"',
                    'limited project export',
                    indent='     ',
            ):
                raise PermissionError()

@@ -984,11 +998,18 @@ class Entrypoint:
            # Confirm subgroup is exportable
            export_limitations = input_gitlab.group_export_limitations(
                input_subgroup.full_path)
            if export_limitations and not Entrypoint.confirm(
                    'Limited subgroup export',
            if export_limitations:
                print(f'{Colors.BOLD}   - Limited subgroup export detected: '
                      f'{Colors.RESET}')
                for export_limitation in export_limitations:
                    print(f'{Colors.BOLD}     - Limited feature export: '
                          f'{Colors.CYAN}{export_limitation}')
                if not Entrypoint.confirm(
                        '',
                        input_subgroup.full_path,
                        not options.confirm,
                    'which uses "' + ("\", \"").join(export_limitations) + '"',
                        'limited subgroup export',
                        indent='     ',
                ):
                    raise PermissionError()