Repository navigation
Output default values for plugin config fields from plz query config - #3529
marcuscaisey wants to merge 3 commits into
Conversation
857c8ae to
b0c42df
Compare
|
Thanks for having a look at that build failure pebers, I missed that 🤦♂️ I don't really understand the cause (maybe the Now the failure we're hitting in the |
21c6a91 to
376ea0b
Compare
|
Okay took a while but I think that failure is fixed now. Have rebased this and hopefully this time it should work 🤞 |
Problem
plz query configcorrectly outputs the values of a plugin config field if it has been explicitly set in.plzconfig. However, it errors if not.For example, in this repository:
plz query config plugin.go.gotooloutputs//third_party/go:toolchain|gowhich has been explicitly set in .plzconfigplz query config plugin.go.delvetoolerrors withFailed to get plugin.go.delvetool: Settable field not defined: plugin.go.delvetoolThis is annoying for external consumers of these values as they have to hardcode the default values in their logic.
Solution
Update
config.Configso that when we fail to look up a value from the"plugin"section of the configuration, we attempt to read the default values from the plugin's.plzconfig.Default values which look like build labels are normalised. For example:
plz query config plugin.go.pleasegotooloutputs///go//tools:please_goinstead of//tools:please_gowhich was what was actually specified by the go plugin. This allows consumers of the values to not care were they came from (if they want to build the target for example).