Skip to content

fix(package-rules): make fetchChangeLogs work at update level - #42368

Closed
justfalter wants to merge 10 commits into
renovatebot:mainfrom
justfalter:disableChangelog
Closed

justfalter wants to merge 10 commits into
renovatebot:mainfrom
justfalter:disableChangelog

Conversation

@justfalter

@justfalter justfalter commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Adds packageRules.fetchChangeLogs, a means for overriding changelog fetching for matching packages.

The goal of this change is to provide package-level control over the fetching of changelogs. It allows users to weigh the tradeoff between changelogs and runtime for things like large monorepos (ex: https://github.com/aws/aws-sdk-go-v2), or perhaps to simply disable changelogs for problematic hosts.

My personal motivation, as outlined in a discussion thread I started the other day, centers around my need to mitigate the impact that fetching changelogs on a GitHub Enterprise instance for monorepos with a large number of tags, as well as eliminate redundancy (I have internal tooling for handling changelogs).

The packageRules.disableChangeLog option will allow me to add a shared preset to my organization for disabling changelog generation for packages sourced from my internal monorepo via the simple:

{
  packageRules: [
   {
      matchSourceUrls: ["https://my.github.server.com/biz/monorepo{/**,}"],
      fetchChangeLogs: "off"
   } 
  ]
}

Relevant renovate runs in GitHub actions:

image

Run w/ disableChangeLog: true for aws-sdk-go-v2 and aws-sdk-js-v3: 1m54s - changelogs were produced for all updates (example), except the targeted aws-sdk packages (PR).

Context

Please select one of the following:

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

Please see #42358

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):

Used Claude to understand the codebase, tracing connections between configuration and affecting change, as well as to help generate the tests (which I reviewed).

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: https://github.com/justfalter/renovate-test-repo

@github-actions
github-actions Bot requested a review from viceice April 5, 2026 02:18

@jamietanna jamietanna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread docs/usage/configuration-options.md Outdated
Comment thread lib/config/options/index.ts Outdated
description:
'Set to true to disable fetching of changelogs for matching packages.',
type: 'boolean',
stage: 'pr',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This might also be branch-level - if fetchChangeLogs=branch

@jamietanna

Copy link
Copy Markdown
Contributor

I think this seems reasonable - I'd like @viceice's view of it too before we merge

@viceice viceice left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer to allow using the existing fetch changelog option at package level instead of branch level.

Comment thread docs/usage/configuration-options.md Outdated

For more details on supported syntax see Renovate's [string pattern matching documentation](./string-pattern-matching.md).

### packageRules.disableChangeLog

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not using the existing fetch changelog option 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I chose packageRules.disableChangeLog over packageRules.fetchChangeLogs only to keep things simple, but I am open to change.

If we were add packageRules.fetchChangeLogs, I suppose that the package rule would simply override the top-level. This should still allow for what I am looking to accomplish (disabling changelogs for specific packages), while also affording greater flexibility.

This would mean moving more decision-making into embedChangelog, which I think is reasonable.

Adds `packageRules.disableChangeLog`, a means for disabling changelog
fetching for matching packages.
- replace `packageRules.disableChangeLog` with a
`packageRules.fetchChangeLogs`.

- Update docs and tests.
Comment thread test/docs/documentation.spec.ts Outdated
header !== 'managerFilePatterns' && header !== 'enabled',
header !== 'managerFilePatterns' &&
header !== 'enabled' &&
header !== 'fetchChangeLogs',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was required in order to get documentation tests to pass as the configuration.md now contains a fetchChangeLogs and a packageRules.fetchChangeLogs header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remote packageRules.fetchChangeLogs and add a note to fetchChangeLogs. We've other options which are using same (eg enabled)

@justfalter

justfalter commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor Author

I have refactored things into patchRules.fetchChangeLogs, which can be used to override the top-level fetchChangeLogs.
This means that fetching of changelogs may occur if there are packageRules that override a top-level fetchChangeLogs: "off".

Here's my renovate config: https://github.com/justfalter/renovate-test-repo/blob/main/.github/renovate.json5

Here's an action run w/ the above config (note: only takes 1m17s w/ fetchConfigs: off): https://github.com/justfalter/renovate-test-repo/actions/runs/24112320401/job/70350567061

@justfalter
justfalter requested review from jamietanna and viceice April 7, 2026 22:34
Comment thread lib/config/options/index.ts Outdated
allowedValues: ['off', 'branch', 'pr'],
default: 'pr',
cli: false,
parents: ['packageRules', '.'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
parents: ['packageRules', '.'],
parents: ['.', 'packageRules'],

global option should still be first. @jamietanna WDYT?

Comment thread test/docs/documentation.spec.ts Outdated
header !== 'managerFilePatterns' && header !== 'enabled',
header !== 'managerFilePatterns' &&
header !== 'enabled' &&
header !== 'fetchChangeLogs',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remote packageRules.fetchChangeLogs and add a note to fetchChangeLogs. We've other options which are using same (eg enabled)

>;

export interface EmbedChangelogsOptions {
branches: BranchUpgradeConfig[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wrong name

Suggested change
branches: BranchUpgradeConfig[];
upgrades: BranchUpgradeConfig[];


// The Extend utility type just ensures that U is a subset of T, making sure that we get a typescript error should
// 'branch' or 'pr' ever be removed from the FetchChangeLogOptions union.
type Extends<T, U extends T> = U;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

move to lib/types/...

}

export async function embedChangelogs({
branches,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
branches,
upgrades,

fetchChangeLogs,
}: EmbedChangelogsOptions): Promise<void> {
// Filter down to branch upgrades that match the stage and fetchChangeLogs configuration.
const upgrades = branches.filter(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const upgrades = branches.filter(
const filteredUpgrades = upgrades.filter(

resolveFetchChangeLogs(fetchChangeLogs, upgrade.fetchChangeLogs) ===
stage,
);
await p.map(upgrades, embedChangelog, { concurrency: 10 });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
await p.map(upgrades, embedChangelog, { concurrency: 10 });
await p.map(filteredUpgrades, embedChangelog, { concurrency: 10 });

// Merges the top-level fetchChangeLogs value with the upgrade's fetchChangeLogs value (prioritizing the latter, if defined).
function resolveFetchChangeLogs(
fetchChangeLogs?: FetchChangeLogsOptions,
upgradeFetchChangeLogs?: FetchChangeLogsOptions,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think this is always set on upgrades object 🤔

please create another reproduction:

  1. set fetchChangeLogs=off globally
  2. set fetchChangeLogsPr for a single dep
  3. group deps to single PR
  4. show us the link 😁

@viceice viceice changed the title feat(package-rules): add disableChangeLog option feat(package-rules): allow fetchChangeLogs option Apr 8, 2026
@justfalter justfalter changed the title feat(package-rules): allow fetchChangeLogs option feat(package-rules): add fetchChangeLogs option Apr 8, 2026
@justfalter

Copy link
Copy Markdown
Contributor Author

I've spent the morning doing additional testing outside of this pull-request, and it looks like Renovate already supports specifying fetchChangeLogs in a package rule, and behaves as expected w.r.t overriding the top-level.
In my testing, it looks like this all started working at some point with Renovate 38.x.

I'll be honest, I am really not certain how I had gotten this far without validating that it could not already be set in this way. I had been working off the documentation, and I thought I had attempted a packageRules.fetchChangeLogs at some point --- it's very possible that I had been testing this with a repository that was using an ancient version of Renovate.

This is all to say that this pull-request is not needed.
The documentation for what configuration can be applied via packageRules could be made more clear. The JSON schema, too, seems to be lacking.

@justfalter justfalter closed this Apr 8, 2026
@justfalter justfalter reopened this Apr 15, 2026
@justfalter

Copy link
Copy Markdown
Contributor Author

I'm re-opening this pull request after I found that the fetchChangeLogs settings tend to get lost/ignored if that package is later grouped together with others using groupName. I am fairly certain that the BranchConfig generation code just uses the alphabetically first package's fetchChangeLog setting, and all others are ignored.

- Revert chanages that added `fetchChangeLogs` to types --- they were already present.
- Remove docs for `packageRules.fetchChangeLogs` and put it under `fetchChangeLogs`.
- Revert changes to options - they are not nescessary, as is the case for most other
  options that can be overridden at the packageRules level.
@justfalter

Copy link
Copy Markdown
Contributor Author

First update: 9873069 and simplifying documentation.

- top-level: only choose options that are implicitly root level (no parents) or explicitly have root ('.') as parent.
- sub-options: only choose options that have parents and none of them are root-level ('.').

This means that we no longer have to exclude for `enabled`
@justfalter justfalter changed the title feat(package-rules): add fetchChangeLogs option fix(package-rules): make fetchChangeLogs work at update level Apr 15, 2026
justfalter added a commit to justfalter/renovate that referenced this pull request Apr 15, 2026
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
@justfalter

Copy link
Copy Markdown
Contributor Author

Closing this pull request in favor of #42671

@justfalter justfalter closed this Apr 15, 2026
pull Bot pushed a commit to moovy2/renovate that referenced this pull request Apr 27, 2026
…enovatebot#42671)

* fix(package-rules): respect each dep update's fetchChangeLogs value

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

* pre feedback: just use fetchChangeLogs from upgrade

* revert documentation.spec.ts changes

They've already been integrated with renovatebot#42846
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants