-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(helm): Add repo alias support #4844
Conversation
lib/manager/common.ts
Outdated
@@ -18,6 +18,7 @@ export interface ExtractConfig extends ManagerConfig { | |||
endpoint?: string; | |||
global?: any; | |||
gradle?: { timeout?: number }; | |||
helm?: { aliases?: Record<string, string> }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the right way to add additional config?
also there's this
Line 1057 in 84d5632
"helm-requirements": { |
but the key is
helm-requirements
which doesn't play well in javascript land, will it get auto converted to helmRequirements
or am I on the wrong track?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can surround it in 'helm-requirements'
anywhere necessary
Thanks @timja. Can you give a description of how this is intended to work. e.g. are |
There's no way to detect them, we could add the stable one by default, It would be expected to add something like:
|
Also see this comment for more details: |
Isn't it possible to detect aliases from elsewhere in the repo? We can manage it even if it's in different files. i.e. isn't "my-company" in your example configured somewhere else within your repo, instead of each developer needing to manually provision it locally on their computer? BTW we can't support unstructured key:value JSON configuration like you've done because it breaks JSON-schema validation. |
#4681 (comment)
could you link to a sample please? |
I like the top level option name you suggested - {
"aliases": [
{
"aliasKey": "my-company",
"aliasValue": "https://my-registry.gcr.io/"
},
{
"aliasKey": "stable",
"aliasValue": "https://kubernetes-charts.storage.googleapis.com/"
}
]
} This way our JSON schema can specify A second challenge is we'd want to make aliases overridable, e.g. a default "stable" value built into Renovate but allowing people to override it in their config. With a native object like you suggest then overriding would happen automatically when you merge the objects whereas it would need to be done explicitly with the above JSON schema approach. @viceice @JamieMagee @felixfbecker do any of you have opinions on this? |
Pretty sure you can declare a JSON schema for an object map, e.g. "properties" {
"aliases": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
} You can add a regex constraint to the key and value too. |
@felixfbecker that's great advice, thanks. I found a reference for it here: https://json-schema.org/understanding-json-schema/reference/object.html Based on this I think we may be able to keep @timja's proposed config structure. |
PTAL not sure if I've handled the schema side properly, but I tested the json schema with vs-code and it enforced the keyValue being a URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move aliases default to inside helm-requirements
Thanks @timja ! |
🎉 This PR is included in version 19.69.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Add repo alias support
Closes #4681
Note: Only tested via unit tests, any docs need updating?