Skip to content

Conversation

jalil-salame
Copy link
Contributor

Changes

Context

Please select one of the below:

  • This closes an existing Issue: #
  • 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

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

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

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository:

This ensures an update with both an newValue and a newDigest is accepted
by renovate (before only one of them worked, if both were updated it
would fail).
Also do `replaceWithoutReplaceString` if `replaceString` is missing and
more than one value changed (e.g. `digest` and `version`).

See renovatebot#36461 and the regression test.
@viceice viceice added the auto:no-done-comments Don't say "Done" or "Please review" - request a review instead label Sep 19, 2025
Copy link
Contributor

Hi there,

You are using done comments which cause a lot of noise/notifications. Instead, please use GitHub's web interface to request another review. Please read our contributing guidelines to reduce noise.

Good luck,

The Renovate team

@viceice viceice enabled auto-merge September 19, 2025 17:07
@viceice viceice added this pull request to the merge queue Sep 19, 2025
Merged via the queue into renovatebot:main with commit 15c1fa6 Sep 19, 2025
40 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 41.119.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jalil-salame jalil-salame deleted the fix-36461 branch September 19, 2025 22:07
@RahulGautamSingh
Copy link
Collaborator

We are basing it on the fact that when only currentDigest is getting updated currentDigestShort will also be defined, which makes the change count > 1, right? @jalil-salame

@jalil-salame
Copy link
Contributor Author

Did it cause a regression? I don't know if both currentDigest and currentDigestShort are defined

@jalil-salame
Copy link
Contributor Author

In my tests only currentDigest was defined

@RahulGautamSingh
Copy link
Collaborator

Did it cause a regression?

No such cases as of now. I am just trying to understand the thinking behind the change

@jalil-salame
Copy link
Contributor Author

Originally, if replaceString was undefined the code would set it to currentValue (version) or currentDigest (the first that was not undefined). Then it would try to replace the value in replaceString with the newValue and newDigest.

E.g regex manager:

# From this data
replaceString = "python:3.12@sha256:badbeef"
currentValue = "3.12"
currentDigest = "badbeef"
newValue = "3.13"
newDigest = "abcdef"
# It generates this string
replaceWith = "python:3.13@sha256:abcdef"

This doesn't work for the jsonata manager, since it doesn't provide a replaceString:

# From this data
replaceString = undefined (thus defaulted to currentValue)
currentValue = "3.12"
currentDigest = "badbeef"
newValue = "3.13"
newDigest = "abcdef"
# It generates this string
replaceWith = "3.13" # notice the digest is missing

It will then perform the update with replaceString === currentValue thus missing the currentDigest and failing to update.

The code changes the logic so it doesn't set the replaceString if there is more than one update:

# From this data
replaceString = undefined (thus defaulted to currentValue)
currentValue = "3.12"
currentDigest = "badbeef"
newValue = "3.13"
newDigest = "abcdef"
# Don't use replaceString since it was undefined and we have a newValue and newDigest

This reuses the codepath that was used to update the depName.

@RahulGautamSingh
Copy link
Collaborator

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:no-done-comments Don't say "Done" or "Please review" - request a review instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants