Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix: ensure configs from a plugin are cached separately (fixes #8792) #8798
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (#8792)
What changes did you make? (Give an overview)
Config files are cached by file path to avoid needing to load the same config file twice. However, configs provided by plugins all have the same file path (the index file of the plugin). This created a bug when loading multiple configs for the same plugin where only the highest-precedence config from that plugin would be loaded. All other configs from that plugin would be considered identical by the cache, so they would all end up getting pulled from the cache as the same config.
This commit updates the caching logic to use the config full name as a cache index. This is still the file path when resolving a config from the filesystem, but it is the unique plugin config identifier (e.g. 'plugin:foo/node-config') when resolving a plugin config.
Is there anything you'd like reviewers to focus on?
Are there any other places where we assume that the
No worries -- the codebase probably should have had more tests for this even before you started working on it.
Configs are complicated. It's hard to tell whether a change will break something if it's untested, especially if you haven't worked on the codebase before.