What Renovate type are you using?
I'm running renovate self-hosted on a self-hosted GitLab instance using the official docker container.
Describe the bug
In my CI pipeline for renovate, i usually first check with --dry-run to see if there are any errors that might occur due to a renovate update or anything else (as renovate also submits PRs to update itself :D ).
When giving the Renovate Bot access to a repository with the correct permissions, it will scan the repository and notice, that it has to create an onboarding PR, which is correct. Then in the next step, it throws an error (only logs it due to dry-run) about checking the non-existant renovate/configure branch. But this branch would have been created in the prior step, if i would not have used --dry-run.
It would be nice, if the modification check / onboarding branch check would recognize the --dry-run and check if it would have been created prior.
This makes the dry-run check unusable in my pipeline at the moment. :(
Relevant debug logs
INFO: Repository started (repository=REPO)
"renovateVersion": "22.7.0"
INFO: DRY-RUN: Would commit files to onboarding branch (repository=REPO)
INFO: Dependency extraction complete (repository=REPO)
"baseBranch": "master",
"stats": {
"managers": {
"dockerfile": {"fileCount": 1, "depCount": 1},
"gitlabci": {"fileCount": 1, "depCount": 2}
},
"total": {"fileCount": 2, "depCount": 3}
}
ERROR: Repository has unknown error (repository=REPO)
"err": {
"message": "Cannot check modification for branch that does not exist: renovate/configure",
"stack": "Error: Cannot check modification for branch that does not exist: renovate/configure\n at Object.isBranchModified (/usr/src/app/node_modules/renovate/lib/util/git/index.ts:406:11)\n at Object.ensureOnboardingPr (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/pr/index.ts:69:7)\n at Object.renovateRepository (/usr/src/app/node_modules/renovate/lib/workers/repository/index.ts:40:5)\n at Object.start (/usr/src/app/node_modules/renovate/lib/workers/global/index.ts:66:7)\n at /usr/src/app/node_modules/renovate/lib/renovate.ts:10:22"
}
INFO: Repository finished (repository=REPO)
"durationMs": 6379
To Reproduce
renovate --dry-runThe only thing that would be possible is to exit and abort the repo, so it won't really be testing anything. Dry run wasn't intended to be run on non-on boarded repos when we wrote it.
I get that, but as a user, i would assume, that dry-run would not throw errors, if they would not occur on a normal "run". As dry-run is usually used as a safety check beforehand.
OK. We'd welcome a PR to have Renovate skip out usual processing in case of a repo that's not onboarded.
Seeing this too now 馃檲
@saibotk Any plans to send a pr?
@viceice I am pretty busy atm and don't have time left to dive into the codebase, as i have never even touched it 馃槙
maybe unrelated, but can we silently catch this error:
ERROR: git fetch error (repository=viceice-tests/renovate-terraform)
"err": {
"task": {
"concatStdErr": true,
"format": "utf-8",
"commands": ["fetch", "--depth=10"]
},
"message": "fatal: couldn't find remote ref refs/heads/renovate/configure\n",
"stack": "Error: fatal: couldn't find remote ref refs/heads/renovate/configure\n\n at GitExecutorChain.onFatalException (~\\projects\\gh\\renovatebot\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.ts:66:77)\n at GitExecutorChain.<anonymous> (~\\projects\\gh\\renovatebot\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.ts:58:21)\n at Generator.throw (<anonymous>)\n at rejected (~\\projects\\gh\\renovatebot\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:6:65)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"
Whenever git fetch fails we delete and clone to recover, so I didn't consider it a serious problem and instead just "something that happens".
:tada: This issue has been resolved in version 23.19.0 :tada:
The release is available on:
23.19.0Your semantic-release bot :package::rocket: