Are non-FQDN host rule environment variables supported at all? #33204
Replies: 2 comments 3 replies
-
It's possible that the if statement we have should be more generous:
Do you have the ability to run from source to test that it "just works" otherwise if you make a simple change to allow it? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Converted to issue: #33607 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
GitLab-CE with Renovate 39.31.4
Please tell us more about your question or problem
I recently had to regenerate access tokens for our on-premise Azure DevOps Server NuGet feed, and because it was a good reason to try it, I wanted to remove it from the host rules in favor of a GitLab CI variable (that ends up as environment variable). I thought I tried the same thing before and failed, which is why I had the token hardcoded/plaintext (which is never a good idea, but I just wanted to get things to work back in the day).
The (relevant part of the) config looks like this:
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [...], "nuget": { "registryUrls": [ "https://api.nuget.org/v3/index.json", "https://tfs/MainCollection/_packaging/NUGET_PACKAGES/nuget/v3/index.json" ] }, "hostRules": [ { "hostType": "nuget", "matchHost": "https://tfs/MainCollection/", - "password": "old token" } ], "configMigration": true, "platformAutomerge": true, "extends": [...] }
After removing the
password
member, I added a CI variable namedNUGET_TFS_PASSWORD
instead with the new token and used the various masking/protection features of GitLab to prevent them from showing up in a log accidentally.However, the following run failed to access the NuGet feed with this:
I did find #10211 and apparently, single-word hostnames always trigger this warning (then skip the rule). We don't use the FQDN to access the NuGet feed, and changing this configuration across many projects (and even more developer machines) isn't really something we want to do if we can avoid it. "tfs" is just a DNS alias, in case we ever migrate to a different server.
The way I understand
renovate/lib/config/env.ts
Line 114 in 854d0a8
...it seems that those hostnames are not supported at all. Is there anything I can do about it, other than changing the hostname everywhere else to a FQDN?
Putting it back into the json config does the trick, but isn't really optimal.
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions