fix(package-rules): respect each dep update's fetchChangeLogs value#42671
Open
justfalter wants to merge 1 commit intorenovatebot:mainfrom
Open
fix(package-rules): respect each dep update's fetchChangeLogs value#42671justfalter wants to merge 1 commit intorenovatebot:mainfrom
justfalter wants to merge 1 commit intorenovatebot:mainfrom
Conversation
Ensures that changelog fetching respects each dep update's specific `fetchChangeLogs` value. Given the following renovate configuration: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/fb9e070d0f9a4d6fc742c4a22edee2c9b055fece/.github/renovate.json5#L42-L61 My expectation is that Renovate would never fetch changelogs for `lodash`. However, when grouped together with `chalk` and `tar` under `group of unrelated packages`, we find that renovate fetches changelogs all packages, including `lodash`. Before this change (`lodash` logs fetched): - Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24480887343/job/71544876893 - (wrong) lodash, tar, and chalk all have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#9 After this change, the PR created by renovate only contains changelogs for `chalk` and `tar`, but not `lodash`: - Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24481738609/job/71547632550 - (expected) lodash does not have changelogs, but tar and chalk have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#10 ---- We can further explore the effectiveness of the change with a more elaborate configuration, where the top-level has `fetchChangeLogs: off`: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/0ea69c18b9171e38c56440c762faa68109d3d0d5/.github/renovate.json5#L41-L95 Before the change: - Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24482213234/job/71549162174 - (wrong) lodash, tar, and chalk all have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#15 - (expected) typescript (inherited `off`) does not have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#17 - (expected) grunt (overridden `pr`) has changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#13 After the change:: - Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24482561172/job/71550255278 - (expected) lodash does not have changelogs, but tar and chalk have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#22 - (expected) typescript (inherited `off`) does not have changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#24 - (expected) grunt (overridden `pr`) has changelogs: justfalter/renovate-test-packagerules-fetchchangelogs#20 Portions of this PR previously appeared in renovatebot#42368
12 tasks
Contributor
Author
justfalter
commented
Apr 15, 2026
Comment on lines
+49
to
+60
| function resolveFetchChangeLogs( | ||
| fetchChangeLogs?: FetchChangeLogsOptions, | ||
| upgradeFetchChangeLogs?: FetchChangeLogsOptions, | ||
| ): FetchChangeLogsOptions { | ||
| // Default to 'pr' if top-level fetchChangeLogs is undefined. | ||
| let fetchChangeLogsResolved: FetchChangeLogsOptions = fetchChangeLogs ?? 'pr'; | ||
| if (upgradeFetchChangeLogs) { | ||
| // Override using the upgrade's fetchChangeLogs value. | ||
| fetchChangeLogsResolved = upgradeFetchChangeLogs; | ||
| } | ||
| return fetchChangeLogsResolved; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I agree with viceice's comment from from my old PR that an upgrade will probably always have fetchChangeLogs set, but the underlying types have them as optional. I feel like this resolve function is a good compromise for avoiding having to delve deep into renovate's types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Ensures that changelog fetching respects each dep update's specific
fetchChangeLogsvalue.Given the following renovate configuration: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/fb9e070d0f9a4d6fc742c4a22edee2c9b055fece/.github/renovate.json5#L42-L61
My expectation is that Renovate would never fetch changelogs for
lodash. However, when grouped together withchalkandtarundergroup of unrelated packages, we find that renovate fetches changelogs for all packages, includinglodash.Before this change (
lodashlogs fetched):After this change, the PR created by renovate only contains changelogs for
chalkandtar, but notlodash:We can further explore the effectiveness of the change with a more elaborate configuration, where the top-level has
fetchChangeLogs: off: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/0ea69c18b9171e38c56440c762faa68109d3d0d5/.github/renovate.json5#L41-L95Before the change:
off) does not have changelogs: Update dependency typescript to v6 justfalter/renovate-test-packagerules-fetchchangelogs#17pr) has changelogs: Update dependency grunt to v1.6.2 justfalter/renovate-test-packagerules-fetchchangelogs#13After the change::
off) does not have changelogs: Update dependency typescript to v6 justfalter/renovate-test-packagerules-fetchchangelogs#24pr) has changelogs: Update dependency grunt to v1.6.2 justfalter/renovate-test-packagerules-fetchchangelogs#20Portions of this PR previously appeared in #42368
Context
Please select one of the following:
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.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: