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

fix(pre-commit): Gitlab Custom RegistryUrl not honored #25682

Merged

Conversation

gone-for-coding
Copy link
Contributor

Changes

The pre-commit manager does not return custom registryUrls to the gitlab-tags datasource which then always defaults to gitlab.com.

This PR always returns a registryUrl back to the datasource which fixes the behaviour. The tests have been edited accordingly to pass.

Context

Fixes #25157

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Nov 10, 2023

CLA assistant check
All committers have signed the CLA.

@gone-for-coding gone-for-coding changed the title Fix/pre commit gitlab custom registry Fix: pre-commit Manager With Gitlab Custom Registry Nov 10, 2023
@gone-for-coding gone-for-coding changed the title Fix: pre-commit Manager With Gitlab Custom Registry fix(pre-commit): Gitlab Custom RegistryUrl not honored Nov 10, 2023
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to understand why other parts of this function return registryUrls: [hostname] and it seems to work. I had though that registryUrls must start with https:// so wonder if they're being massaged somewhere else

@gone-for-coding
Copy link
Contributor Author

Yes, the https:// prefix ist stripped here:

regEx('^https?://(?<hostname>[^/]+)/(?<depName>\\S*)'),
So I readd it as the gitlab-tags datasource seems to require the https:// prefix to work properly.

Regarding the other parts of the function which return registryUrls, they have the https:// prefix as it is added here:

const hostUrl = 'https://' + hostname;

As the function already returns before line 39 I needed to add it.

Currently I'm wondering if anything below line 39 is actually every executed.

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but you need to fix the git author and then force push changes

- registryUrl is only returned to the gitlab-tags
datasource for custom URLs
- Added new test cases for custom gitlab URL.
@gone-for-coding gone-for-coding force-pushed the fix/pre-commit-gitlab-custom-registry branch from 6c67529 to ccabecd Compare November 13, 2023 11:14
@rarkins rarkins added this pull request to the merge queue Nov 13, 2023
Merged via the queue into renovatebot:main with commit c8c0e1b Nov 13, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.57.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants