Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support local git/clone run #3609

Closed
rarkins opened this issue Apr 27, 2019 · 8 comments
Closed

Support local git/clone run #3609

rarkins opened this issue Apr 27, 2019 · 8 comments
Labels
help wanted Help is needed or welcomed on this issue priority-2-high Bugs impacting wide number of users or very important features type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Apr 27, 2019

What would you like Renovate to be able to do?

Allow Renovate to do a type of "dry run" on a locally cloned repo, particularly to be able to test config changes.

Describe the solution you'd like

Run Renovate on a local git clone. It shouldn't matter if it's github/gitlab/bitbucket/azure as the interface will be gitFs.

First step would be to perform a dry run, maybe later even to create the branches too - but PRs/Issues cannot be created or updated.

Describe alternatives you've considered

Forking a hosted repository to test against.

Additional context

Requested by @hongarc in renovatebot/config-help#223

@rarkins rarkins added type:feature Feature (new functionality) help wanted Help is needed or welcomed on this issue ready priority-4-low Low priority, unlikely to be done unless it becomes important to more people labels Apr 27, 2019
@jnewland
Copy link
Contributor

I'd like something like this to be able test something slighly different than config changes: I'd like to confirm in a CI job that packages added to a repository in a pull request are properly parsed and managed by renovate. Right now I'm able to parse the logs of a dry run to be able to see when a package can't be resolved, but only after a package or configuration rules that manage it are on a repository's default branch. Allowing a dry-run to be triggered against a branch would allow this case to be detected and resolved before merge using CI guardrails.

@rarkins rarkins added status:blocked Issue is blocked by another issue or external requirement status:in-progress Someone is working on implementation and removed status:in-progress Someone is working on implementation labels Jan 12, 2021
@rarkins rarkins added status:ready priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed status:blocked Issue is blocked by another issue or external requirement priority-4-low Low priority, unlikely to be done unless it becomes important to more people labels Sep 12, 2021
@rarkins
Copy link
Collaborator Author

rarkins commented Apr 11, 2022

I think this should be possible if combined with dryRun concepts.

  • New global option local which defaults to false. e.g. you can run renovate --local=true
  • It will skip all cloning and initializing and essentially do the same as the new dryRun=extract before exiting

In a subsequent feature issue later we can support also `dryRun=lookup although we'll need to think if there's any problems if the platform isn't initialized etc.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 22, 2023

I suggest we use --platform=local, which implicitly enables --dry-run=lookup.

We could support the cwd by default, e.g. renovate --platform=local means the current directory, but possibly also allow a path, e.g. renovate --platform=local ../foo.

@nielsbasjes
Copy link
Contributor

I'm not sure what these dryrun settings do. What would be awesome if a command like this would output the changes it would output in a diff or something similar.

@viceice
Copy link
Member

viceice commented Feb 23, 2023

i think this can be implemented as platform, where issues are not supported. maybe renovate can clone the selected repo via file url and then doing normal work. just return success for PR creation.

PR merge could be push local branch to remote base branch.
status check should always return success.

@nielsbasjes
Copy link
Contributor

nielsbasjes commented Feb 23, 2023

Extending what @rarkins sketched yesterday.
The --platform=local and the part of working on either the current or a specified directory sound great tome.

I am in doubt about the --dry-run=lookup though as this does not seem to produce the changes the tool will propose (couldn't find it when trying).
I see two useful ways of providing the output from renovate in this --platform=local situation:

  1. Branches in this local repository (i.e. similar to the normal operating way).
  2. Patch/diff files in a separate directory.

I'm not sure what is easiest to you to build.
My primary usecase is local development/debugging of the config that I put in the for example the renovate.json (especially manual pattern matching with regex managers like this one ), both of these options would be fine for this.

@rarkins rarkins added priority-2-high Bugs impacting wide number of users or very important features and removed priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Apr 21, 2023
@rarkins
Copy link
Collaborator Author

rarkins commented May 7, 2023

Draft PR: #22010

@rarkins
Copy link
Collaborator Author

rarkins commented May 10, 2023

I'm going to mark this as Closed by #22010 although it does not contain every idea mentioned within here. Once it's released, please start new Discussions on any further ideas and we'll decide whether to convert them into feature requests

@rarkins rarkins closed this as completed May 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Help is needed or welcomed on this issue priority-2-high Bugs impacting wide number of users or very important features type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

4 participants