What's the future of the local platform?
#40970
Replies: 2 comments 4 replies
-
|
Based on your description I think this should be two different platforms e.g.
The flag combination could IMO be rather confusing and splitting up the platforms would give us cleaner code.
LocalWould be in some sense a catch it all for use cases where people want to update package manager. Similar to CLIs which are focused right now on that. This would be basically your Local-gitWould cover the unsupported platform case and debugging then. |
Beta Was this translation helpful? Give feedback.
-
|
My common usecase: I have a tricky renovate rule I need to write (regex matching is a common example) and I want to be able to repeatedly run it on my local machine and I only need to SEE what changes would be made. Wanted behavior: I throw 1 or 2 test files in a directory, add a renovate.json5 file and quickly and repeatedly have the ability to see what would happen. My preferred form is to have renovate run from docker because that would avoid any need to install it at all. Suggestion: Add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Tell us more.
Renovate's
localplatform is a powerful capability, and one that Renovate has that other competing other tools do not.The
platform=localmode can be very useful when testing Renovate config changes locally, as an alternative to using the reconfigure branch approach.Although not as widely used compared to our remote platforms (like
platform=githuborplatform=forgejo), this may be due to known limitations.Right now, the
localplatform only allows running indryRun=extractordryRun=lookupmodes.Because the
localplatform doesn't need to be running against a Git repository, but can instead run against a local directory without a.gitfolder, running indryRun=fullcurrently throws an error.As per user feedback, and utility to the maintainers, we've been thinking about what the future of the
localplatform could be, and what improvements we can make that benefit the general community.Making it possible for the
localplatform to run indryRun=full, or even making changes to the local filesystem would be useful.Additionally, given the new agentic world we live in, it may be useful to give a way for Renovate to run on a local repo so an agent loop can test config changes.
Below are the considerations I'd see for where we can go next with
platform=local, and what it will unlock.For improved configuration development
As noted above, using
platform=localcan be very useful when testing Renovate configuration changes locally, to get a more in-depth feel for the changes that Renovate will make.Separately, I'm (still) working on writing a blog post about the different approaches I take to testing configuration changes, and
platform=localdoes feature heavily.Adding support for
dryRun=fullwould give additional options for fully understanding what Renovate is going to do, without the additional network hop(s) of needing to push changes to a remote Git repository and wait for Renovate to run.Changes on a local Git repo
In cases where Renovate knows it's running in
--platform=local --dry-run=null, and there is a Git repository found locally, it could then make changes, as if it were operating against another Platform.(Because
dryRun=lookupby default when usingplatform=local, this would be something a user would opt-in for withdryRun=null, and so we shouldn't need additional flags to allow this - perhaps a check to make sure that the work tree isn't dirty, and if so, error out)Renovate would process the repository, as if it had cloned it from another Platform, create the relevant branches, and then switch back to the default branch.
This would not attempt to push the branches to a remote, if there is one.
Changes on a directory/file without a Git repo
This would need to be even more cautious than when running against a Git repo, as there's no way to undo changes that Renovate's performed.
This would require an explicit opt-in via an additional flag.
This would allow for cases where you want to i.e. say "update this
go.modorMakefileto the latest versions of everything, given this configuration".Operating on platforms Renovate doesn't yet support
In cases where folks are using platforms that Renovate doesn't (yet) support, it would be possible to use
platform=localto at least drive the code changes.This would at least allow a Git repo to receive the changes, and then it would be up to the user to push them to the remote and/or create a Pull Request (or their platform equivalent)
Not at the cost of maintainability of other platforms
We should not add this functionality at the cost of other platforms Renovate supports.
Although there are some areas that this would improve usage for users of Renovate,
platform=localis - currently - very low on the usage scale (based on the "gut feel" we get based on Discussions/Issues - Renovate has no telemetry) compared to other platforms.Suggested roadmap items
platform=localas "experimental"local>presets should come fromplatform=localspecific lookup, with a specific flag i.e.--platform-local-presets-platformwhich allows for using Host Rules to then look it up based onhostType=${platform-local-presets-platform}local>presets, and redirect them to the right Platformplatform=local dryRun=nullbut the Git work tree is dirtyplatform=local dryRun=nullto perform code changes when there is a Git repositorybasebranchpatterns? Use whatever the branch name was when it started?platform=local dryRun=nullto perform code changes when there is not a Git repositoryplatform=local dryRun=fullto run when there is a Git repositoryplatform=local dryRun=fullto run when there is not a Git repositorydryRun=lookupmode when inplatform=localdryRun=lookup, so it's then explicitly requested to run indryRun=fullordryRun=nullplatform=localrepository=$(basename $PWD)repository=local, it would show as the directory being run from, for slightly more impactful outputplatform=localto only operate on a single package filemcp.jsonhas"Related issues/discussions
`local` platform must be onboarded #25203Also related:
Beta Was this translation helpful? Give feedback.
All reactions