Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-2820

galaxy-importer not allowing underscores in legacy namespace names

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None

      Old galaxy did a lot of swapping of hyphens to underscores for namespace names, which doesn't conform to github's username requirements.

      [I 231030 22:47:09 fetch_and_diff_old_new:278] --------------------------------------------------
      [I 231030 22:47:09 fetch_and_diff_old_new:279] 1
      [I 231030 22:47:09 fetch_and_diff_old_new:280] --------------------------------------------------
      [I 231030 22:47:09 fetch_and_diff_old_new:283]  KEEP 35736 radek_sprta.docker 100%
      [I 231030 22:47:09 fetch_and_diff_old_new:289]  DELETE 23439 radek-sprta.docker 80%
      [I 231030 22:47:09 fetch_and_diff_old_new:291]          summary_fields.namespace.name radek-sprta -> radek_sprta
      [I 231030 22:47:09 fetch_and_diff_old_new:324]          DELETE https://galaxy.ansible.com/api/v1/roles/23439/
      [I 231030 22:47:09 fetch_and_diff_old_new:294]          204
      [W 231030 22:47:09 fetch_and_diff_old_new:299]  reimporting radek_sprta.docker to recovering missing tags ['v1.0.0']
      [I 231030 22:47:09 fetch_and_diff_old_new:312]  ansible-galaxy role import -s https://galaxy.ansible.com --role-name=docker radek-sprta ansible-role-docker
      Successfully submitted import request 2053626989228472145217248830081447771
      running
      namespace radek_sprta is invalid
        File "/venv/lib64/python3.11/site-packages/pulpcore/tasking/tasks.py", line 66, in _execute_task
          result = func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^
        File "/app/galaxy_ng/app/api/v1/tasks.py", line 370, in legacy_role_import
          result = import_legacy_role(checkout_path, namespace.name, importer_config, logger)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/venv/lib64/python3.11/site-packages/galaxy_importer/legacy_role.py", line 51, in import_legacy_role
          return _import_legacy_role(dirname, namespace, cfg, logger)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/venv/lib64/python3.11/site-packages/galaxy_importer/legacy_role.py", line 57, in _import_legacy_role
          data = LegacyRoleLoader(dirname, namespace, cfg, logger).load()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/legacy_role.py", line 39, in load
          self._validate_namespace()
        File "/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/legacy_role.py", line 61, in _validate_namespace
          raise exc.ImporterError(f"namespace {self.namespace} is invalid")
      > /home/jtanner/workspace/github/jctanner.redhat/galaxy-hacking/beta.scripts.2023-10-18/fetch_and_diff_old_new.py(317)compare_and_fix()
      

              jtanner@redhat.com James Tanner
              jtanner@redhat.com James Tanner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: