Skip to content

fix(platform): preserve explicit local dryRun#43129

Open
zeitlinger wants to merge 4 commits intorenovatebot:mainfrom
zeitlinger:codex/preserve-local-dry-run-extract
Open

fix(platform): preserve explicit local dryRun#43129
zeitlinger wants to merge 4 commits intorenovatebot:mainfrom
zeitlinger:codex/preserve-local-dry-run-extract

Conversation

@zeitlinger
Copy link
Copy Markdown

@zeitlinger zeitlinger commented May 6, 2026

Changes

When the local platform initializer is called with an explicit dryRun value, preserve it instead of always overwriting with lookup. Only extract is preserved — anything else (including full, which would error against the local platform) falls back to lookup.

Context

  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).

Used Claude Code for the initial diagnosis, code change, and test additions.

Documentation (please check one with an [x])

  • No documentation update is required

How I've tested my work (please select one)

  • Newly added/modified unit tests

@jamietanna jamietanna added the auto:reproduction A minimal reproduction is necessary to proceed label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Hi there,

Please help this Discussion progress by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. Discussions without reproductions are less likely to be converted to Issues.

Please follow these steps:

  1. Read our guide on creating a minimal reproduction.
  2. Go to our minimal reproduction template repository.
  3. Select the Use this template button to create a new repository based on the template.
  4. Work on the reproduction in your own repository. Ensure it's actually minimal (no unnecesary dependencies or config), or it will be rejected by maintainers.
  5. Install the Renovate app to verify that what you say happens (or doesn't happen) reproduces.
  6. Fill out the information in your repository's README.md. What you describe there should reflect what you see in this repo, with the hosted app, and not what you saw in your original repo/environment.
  7. Add the link to your reproduction to the first post of your Discussion. If you are not the original author, you can post a new comment with the link.
  8. Add a Discussion comment mentioning that the reproduction repo is now available and linked.

If you need help with running Renovate on your minimal reproduction repository, please refer to our Running Renovate guide.
Good luck,

The Renovate team

@jamietanna
Copy link
Copy Markdown
Contributor

I'm not sure I've seen this behaviour before - please share a case where you're seeing this happen (and the version of Renovate)

Also, when raising PRs, please follow our PR template

Copy link
Copy Markdown
Author

Observed with Renovate 43.141.6, and main still appears to behave the same in lib/modules/platform/index.ts + lib/modules/platform/local/index.ts.

Concrete case:

LOG_LEVEL=debug LOG_FORMAT=json \
RENOVATE_CONFIG_FILE=.github/renovate.json5 \
renovate --platform=local --require-config=ignored --dry-run=extract

Expected: effective dryRun=extract, so repository processing stops after extraction.

Actual on the affected versions: local platform init sets dryRun: 'lookup', and initPlatform(config) merges ...config, ...platformInfo, so the explicit CLI/config dryRun=extract is overwritten. In the resulting Combined config log, dryRun is lookup, and repository processing continues into lookup.

The practical symptom we saw was that a caller intentionally invoking local mode with --dry-run=extract still got lookup-phase behavior and datasource/network activity.

The minimal code path behind the behavior is:

  • lib/modules/platform/local/index.ts returns dryRun: 'lookup'
  • lib/modules/platform/index.ts applies ...config, ...platformInfo
  • explicit caller dryRun loses to platform defaults

This PR only changes local platform behavior to preserve an explicit incoming dryRun while keeping the existing default of lookup when none was supplied.

@zeitlinger zeitlinger marked this pull request as ready for review May 7, 2026 06:31
@github-actions github-actions Bot requested a review from viceice May 7, 2026 06:31
@zeitlinger
Copy link
Copy Markdown
Author

I'm not sure I've seen this behaviour before - please share a case where you're seeing this happen (and the version of Renovate)

Also, when raising PRs, please follow our PR template

My last comment is not a complete repo - please tell me if it's still needed.

Copy link
Copy Markdown
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the PR description to follow the template.

Else, LGTM.

Comment thread lib/modules/platform/local/index.ts Outdated
…p otherwise

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger
Copy link
Copy Markdown
Author

Updated the PR description to follow the template. Thanks!

@zeitlinger zeitlinger requested a review from viceice May 8, 2026 14:26
viceice
viceice previously approved these changes May 8, 2026
@viceice
Copy link
Copy Markdown
Member

viceice commented May 8, 2026

docs should be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:reproduction A minimal reproduction is necessary to proceed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants