Path-based hostRules #21678
Replies: 4 comments
-
🤔 I like the idea to add hostRules from managers (eg read from |
Beta Was this translation helpful? Give feedback.
-
If parsing
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Platforms should save the token or username/password passed during Platforms could return one rule for the hostName alone, and another for hostName + hostType, to allow for cases where managers search for rules by hostType. hostRules order:
|
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
Support greater granularity of
hostRules
. There may be cases where they are specific to a certain path, for example.Describe the solution you'd like
Concrete example: npm
.npmrc
or Composerauth.json
could be found within subdirectories, and maybe more than one per repo if it's a monorepo.Describe alternatives you've considered
Currently our
hostRules
are "global" for the repo. This was partly to save ourselves passing extra config around, but also as a part security feature that decreased the chance that thehostRules
config is accidentally leaked.Additional context
There's may be three possible ways to implement this:
Approach 1: add optional path and package awareness to hostRules
This would retain the "global" hostRules but allow them to be configured with paths and maybe package names. However this solution would require all calls to our
got
wrapper to include filename and/or package name information.Approach 2: refactor
hostRules
so that they are kept in config likepackageRules
are, and passed "down the chain". This would allow a hostRule to be returned from an extract function, for example - or maybe even embedded within a packageRule. This would require that the config is passed all the way to ourgot
wrapper so thathostRules
can be read.Approach 3: deprecate
hostRules
and merge all concepts intopackageRules
. Not sure this is really feasible though.Beta Was this translation helpful? Give feedback.
All reactions