-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: skip repo clone when not necessary #39834
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
base: main
Are you sure you want to change the base?
fix: skip repo clone when not necessary #39834
Conversation
…and requireConfig is required
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder about this:
Even after this, we will do one API call per "disabled" repo each time Renovate runs in autodiscover mode. Won't it be better for your case if you run a script which pushes a renovate.json file to said repos with the setting, enabled: false?
Then turn on optimizeForDisabled and you get what you want with no code changes. I just don't see any other real benefit, except your use-case.
Also, we have autodiscoverFilter for this exact use-case.
But why the unnecessary clone if the response is already telling us that the repo doesn't contain a config file?
Yes, I'm fully aware that there will still be one API call per repository, as it's that API call that tells us that the repository doesn't contain a I'm not comfortable running a script that makes one commit to thousands of repos, many of which haven't been committed to in many, many years.
I'm not sure what you mean by "no real benefit." As I mentioned in the discussion, there might be a use case I'm not fully aware of for why a git clone is made, but if there isn't, I really don't see the point of the current behavior. |
|
Why is it not possible to use |
Because we have two collections in Azure DevOps Server, each with a couple of thousand repositories, we can’t use autodiscovery, in its current form, since Renovate tries to clone every repository, which takes a long time. Instead we want each team to onboard themselves to Renovate by simply creating a Since any team with any repository can onboard themselves, we don’t know the repository names in advance, which if I understand the documentation correctly, makes it hard to target them using |
|
Okay. Try adding |
Thanks for the suggestion. I just tried it out but the running time for all repos (2579) was still about 75 minutes (same as before). Seems like Renovate still clones each repo. See {"name":"renovate","hostname":"renovate-company-cronjob-29434800-c9qgp","pid":9,"level":30,"logContext":"0pJYyZ4PQakP_pxIW2a3j","repository":"Project/Repo","renovateVersion":"42.62.0","msg":"Repository started","time":"2025-12-18T20:00:13.026Z","v":0}
{"name":"renovate","hostname":"renovate-company-cronjob-29434800-c9qgp","pid":9,"level":30,"logContext":"0pJYyZ4PQakP_pxIW2a3j","repository":"Project/Repo","msg":"Repository is disabled - skipping","time":"2025-12-18T20:00:14.734Z","v":0}
{"name":"renovate","hostname":"renovate-company-cronjob-29434800-c9qgp","pid":9,"level":30,"logContext":"0pJYyZ4PQakP_pxIW2a3j","repository":"Project/Repo","msg":"Repository is disabled - skipping","time":"2025-12-18T20:00:14.734Z","v":0}
{"name":"renovate","hostname":"renovate-company-cronjob-29434800-c9qgp","pid":9,"level":30,"logContext":"0pJYyZ4PQakP_pxIW2a3j","repository":"Project/Repo","cloned":true,"durationMs":1721,"result":"disabled-no-config","status":"disabled","enabled":false,"msg":"Repository finished","time":"2025-12-18T20:00:14.744Z","v":0}Just to make sure I haven't made a configuration error, here's my config: - name: RENOVATE_PLATFORM
value: 'azure'
- name: RENOVATE_ENDPOINT
value: 'https://devops.company.local/Company/'
- name: RENOVATE_REQUIRE_CONFIG
value: 'required'
- name: RENOVATE_OPTIMIZE_FOR_DISABLED
value: 'true'
- name: RENOVATE_GLOBAL_EXTENDS
value: '[":disableRenovate"]'
- name: RENOVATE_AUTODISCOVER
value: 'true'
- name: RENOVATE_ONBOARDING
value: 'false'
- name: RENOVATE_ONBOARDING_NO_DEPS
value: 'disabled'
- name: RENOVATE_ONBOARDING_CONFIG
value: |
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabled": true,
"extends": ["config:recommended"]
}
- name: RENOVATE_GIT_AUTHOR
value: 'Renovate Bot <[email protected]>' |
|
You need to use normal |
Oh okay. Is that done by changing RENOVATE_GLOBAL_EXTENDS to RENOVATE_EXTENDS in my config? |
Yes |
Changes
This PR updates the logic for deciding when to proceed with cloning a repo.
If all of the following conditions are met, a clone will be skipped. If any of these conditions are not met, the current logic is applied.
onboardingisfalseoptimizeForDisabledistruerequireConfigis not"optional"or"ignored", in other words, it must be set to"required"Context
I accept the risk, this PR solves #39831
AI assistance disclosure
Code and unit tests generated using GitHub Copilot in "Plan" and "Agent" mode using the model Claude Opus 4.5 (Preview). Commit messages and PR descriptions are manual.
Did you use AI tools to create any part of this pull request?
Documentation
Not sure if this change should be reflected elsewhere, but I've updated the parts that I read while researching the current behavior.
How I've tested my work
I have verified these changes via:
The public repository: