Skip to content

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

@agrare

Description

@agrare

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)'),
      ],
    },

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions