nebari icon indicating copy to clipboard operation
nebari copied to clipboard

[BUG] - Nebari init fails when using a GitLab repo for the GitOps approach

Open marcelovilla opened this issue 1 year ago â€Ē 5 comments

Describe the bug

When running nebari init and specifying a GitLab repo, the command fails with the following error:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────â•Ū
│ /usr/local/bin/nebari:8 in <module>                                                              │
│                                                                                                  │
│   5 from nebari.__main__ import main                                                             │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(main())                                                                         │
│   9                                                                                              │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/nebari/__main__.py:8 in main                             │
│                                                                                                  │
│    5                                                                                             │
│    6 def main():                                                                                 │
│    7 │   cli = create_cli()                                                                      │
│ ❱  8 │   cli()                                                                                   │
│    9                                                                                             │
│   10                                                                                             │
│   11 # get the click object from the typer app so that we can autodoc the cli                    │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/typer/main.py:328 in __call__                            │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/typer/main.py:311 in __call__                            │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:1130 in __call__                           │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/typer/core.py:778 in main                                │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/typer/core.py:216 in _main                               │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:1655 in invoke                             │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:920 in make_context                        │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:1378 in parse_args                         │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:2360 in handle_parse_result                │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/click/core.py:2322 in process_value                      │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/typer/main.py:994 in wrapper                             │
│                                                                                                  │
│ /usr/local/lib/python3.11/site-packages/_nebari/subcommands/init.py:797 in guided_init_wizard    │
│                                                                                                  │
│   794 │   │   │   │   qmark=qmark,                                                               │
│   795 │   │   │   ).unsafe_ask()                                                                 │
│   796 │   │   │                                                                                  │
│ ❱ 797 │   │   │   inputs.repository = repo_url.format(                                           │
│   798 │   │   │   │   git_provider=git_provider, org_name=org_name, repo_name=repo_name          │
│   799 │   │   │   )                                                                              │
│   800                                                                                            │
│                                                                                                  │
│ in pydantic.main.BaseModel.__setattr__:384                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────â•Ŋ
ValidationError: 1 validation error for InitInputs
repository
  string does not match regex "^(https://)?github.com/([^/]+)/([^/]+)/?$" (type=value_error.str.regex; pattern=^(https://)?github.com/([^/]+)/([^/]+)/?$)

Expected behavior

I expect nebari init to work properly and create the configuration file according to the options I selected.

OS and architecture in which you are running Nebari

Linux ip-172-31-3-104 6.2.0-1017-aws #17~22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

How to Reproduce the problem?

Go over the nebari init --guided-init and in the GitOps section try the following:

ðŸŠī  This next section is optional but recommended. If you wish to adopt a GitOps approach to managing this platform, we will walk you through a set of questions to get that 
setup. With this setup, Nebari will use GitHub Actions workflows (or GitLab equivalent) to automatically handle the future deployments of your infrastructure.


   Would you like to adopt a GitOps approach to managing Nebari? Yes
   Which git provider would you like to use? gitlab.com
   Which user or organization will this repository live under? (https://gitlab.com/<org-name>/) some-org
   And what will the name of this repository be? (https://gitlab.com/some-org/<repo-name>) some-repo

Command output

No response

Versions and dependencies used.

nebari==2024.1.1

Compute environment

None

Integrations

No response

Anything else?

@kalpanachinnappan originally found about this issue

marcelovilla avatar Feb 21 '24 14:02 marcelovilla