You can now resolve remote presets when using Renovate's local platform in renovate-graph

In Utilising Renovate's local platform to make renovate-graph more efficient I mentioned that you can take advantage of Renovate's local platform to run against a local directory.
During a hackathon week at work, I've recently been using renovate-graph --platform local alongside my new renovate-packagedata-diff tool to provide a diff of dependencies in a PR, to present relevant information to the user, which has been working very well so far ππΌ
One wrinkle in the plan is that as an organisation we take advantage of shared config presets to centralise some common customManagers to extract common internal package files, or have other tweaks to different things, which is super useful.
However, there's a long-standing issue in renovate-graph, inherited from Renovate's known limitations in the local platform where Renovate rightfully so can't determine how to resolve a local> or github> preset, as in local mode, it doesn't have any way to know how to look these up.
This means that if in your repository, you had a renovate.json:
{
"extends": [
"github>abc/foo:xyz.json5",
"local>abc/foo:xyz"
]
}
This would then result in i.e.:
INFO: Throwing preset error
"validationError": "Preset caused unexpected error (local>elastic/renovate-config:platform-devflow)"
ERROR: Failed to read repository information for "local": Error: config-validation
"error": {
"name": "Error",
"message": "config-validation",
However, today I've managed to add support to renovate-graph to add the ability to look up presets, even when running in --platform local π
This is only possible in renovate-graph, due to additional metadata that gets as part of running with --platform local i.e.:
# linebreaks for readability
env RG_LOCAL_PLATFORM=github
RG_LOCAL_ORGANISATION=elastic
RG_LOCAL_REPO=kibana
npx @jamietanna/renovate-graph@latest --platform local
In this case, because we're explicitly telling renovate-graph that we're running against GitHub, renovate-graph will assume that this is
It doesn't support self-hosted setups or non-GitHub hosts (for now), but does at least allow now resolving any presets in a config.js as well as a repo-level renovate.json ππΌ
If you'd prefer not to follow presets, one option I've found useful is to use ignorePresets:
env RENOVATE_IGNORE_PRESETS='github>.../renovate-config:some-preset,local>.../renovate-config:another-preset' renovate-graph --platform local