Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable URL replacements for the analyzer / downloader #6698

Open
Tracked by #8556
dgutson opened this issue Mar 17, 2023 · 6 comments
Open
Tracked by #8556

Configurable URL replacements for the analyzer / downloader #6698

dgutson opened this issue Mar 17, 2023 · 6 comments
Labels
analyzer About the analyzer tool configuration About configuration topics downloader About the downloader tool enhancement Issues that are considered to be enhancements

Comments

@dgutson
Copy link

dgutson commented Mar 17, 2023

We need to set some connection configuration of the vcs in general and git in particular, for example whether to use https instead of ssh.
Our current workaround is to place this in the docker entry point:
IMG-20230317-WA0004

@sschuberth sschuberth changed the title Git configuration in ort.yml Configurable URL replacements for the analyzer Mar 17, 2023
@sschuberth sschuberth added enhancement Issues that are considered to be enhancements analyzer About the analyzer tool configuration About configuration topics labels Mar 17, 2023
@sschuberth
Copy link
Member

Similar feature requests occasionally came up in the past already, I remember @heliocastro having similar requirements. A configurable analyzer mechanism to do regex-based search & replace on URLs could also be used to replace hard-coded substitutions like not using git:// anymore for GitHub repos, see

// Avoid using the unauthenticated Git protocol, which is blocked by many VCS hosts.
if (url.startsWith("git://")) {
url = "https://${url.removePrefix("git://")}"
}

@fviernau
Copy link
Member

fviernau commented Mar 17, 2023

A configurable analyzer mechanism to do regex-based search & replace on URLs could also be used to replace hard-coded substitutions like not using git:// anymore for GitHub repos, see

Note that this needs to work for submodules as well. (As long as we rely on recursive cloning)

@dgutson
Copy link
Author

dgutson commented Mar 17, 2023

@fviernau s/not/note/ ?

If so, indeed I think a substitution wouldn't work for automatic submodules cloning, where ORT does not control the URL.

@dgutson
Copy link
Author

dgutson commented Mar 17, 2023

I found more configuration rules that we had to set, which I'm not sure that can be specified as regexes:

git config --global url."https://github.com/".insteadOf ssh://git@github.com/
git config --global url."https://github.com/".insteadOf git@github.com:

@sschuberth
Copy link
Member

Thanks to #6387 this could probably quite elegantly implemented as a special curation providers that does regex search & replaces on URLs from package metadata.

@sschuberth
Copy link
Member

Note that this needs to work for submodules as well.

True, so any such URL replacement would also need to be applied by the downloader, not only the analyzer. A repo to test this with could be https://github.com/TritonDataCenter/node-http-signature/blob/v1.2.0/.gitmodules as it uses SSH / SCP URLs like url = git@github.com:davepacheco/javascriptlint for submodules.

@sschuberth sschuberth changed the title Configurable URL replacements for the analyzer Configurable URL replacements for the analyzer / downloader Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool configuration About configuration topics downloader About the downloader tool enhancement Issues that are considered to be enhancements
Projects
None yet
Development

No branches or pull requests

3 participants