ManageIQ / manageiq-ui-classic

Classic UI of ManageIQ
Apache License 2.0
50 stars 357 forks source link

Unable to add a Git Repository with `file://` URL #9192

Open agrare opened 4 months ago

agrare commented 4 months ago

The error message on the URL field indicates that file:// is a valid protocol but when I try to pass a file:///path/to/repo it fails.

image

But creating it via rails c works and sync successfully ManageIQ::Providers::Workflows::AutomationManager::ConfigurationScriptSource.create!(:name => "adam-workflows", :scm_url => "file:///home/grare/adam/src/manageiq/adam-workflows")

Looks like we have a custom url validator: https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/javascript/components/workflow-repository-form/helpers.jsx

    {
      component: componentTypes.TEXT_FIELD,
      label: __('URL'),
      maxLength: 128,
      id: 'scm_url',
      name: 'scm_url',
      isRequired: true,
      validate: [
        (value) => (customUrlValidator(value)
          ? undefined
          // eslint-disable-next-line max-len
          : 'URL must include a protocol (http://, https:// or file://) with path or be a valid SSH path (user@server:path or ssh://user@address:port/path)'),
      ],
    },
agrare commented 4 months ago

cc @Fryguy @jeffibm

Fryguy commented 4 months ago

I kinda want file for development, but not for production (I can't think of a production use case). @jeffibm Is that possible?

Fryguy commented 4 months ago

This happens on any form that has repository create/edit (workflows, ansible, etc).

miq-bot commented 3 weeks ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.