Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure when release notes are fetched, defaulting to latest/laziest #20476

Closed
HonkingGoose opened this issue Feb 17, 2023 · 3 comments · Fixed by #22781
Closed

Configure when release notes are fetched, defaulting to latest/laziest #20476

HonkingGoose opened this issue Feb 17, 2023 · 3 comments · Fixed by #22781
Assignees
Labels
breaking Breaking change, requires major version bump core:changelogs Related to changelogs/release notes fetching priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality) v36

Comments

@HonkingGoose
Copy link
Collaborator

HonkingGoose commented Feb 17, 2023

What would you like Renovate to be able to do?

Make it mandatory to configure which stage the notes are fetched at, defaulting to latest/laziest. 1

If you have any ideas on how this should be implemented, please tell us here.

Make fetchReleaseNotes an enum with values off, branch or pr. 2

export function needsChangelogs(
upgrade: BranchUpgradeConfig,
fields = exposedConfigOptions.filter((o) => o !== 'commitBody')
): boolean {
// commitBody is now compiled when commit is done
for (const field of fields) {
// fields set by `getChangeLogJSON`
if (containsTemplates(upgrade[field], ['logJSON', 'releases'])) {
return true;
}
}
return false;
}

Called from here:

if (config.fetchReleaseNotes && config.repoIsOnboarded) {
const branches = branchUpgrades[branchName].filter((upg) =>
needsChangelogs(upg)
);
if (branches.length) {
logger.warn(
{
branches: branches.map((b) => b.branchName),
docs: 'https://docs.renovatebot.com/templates/',
},
'Fetching changelogs early is deprecated. Remove `logJSON` and `releases` from config templates. They are only allowed in `commitBody` template. See template docs for allowed templates'
);
await embedChangelogs(branches);
}
}

Is this a feature you are interested in implementing yourself?

No

Footnotes

  1. https://github.com/renovatebot/renovate/discussions/20451#discussioncomment-4998357

  2. https://github.com/renovatebot/renovate/discussions/20451#discussioncomment-4998368

@HonkingGoose HonkingGoose added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready core:changelogs Related to changelogs/release notes fetching labels Feb 17, 2023
@HonkingGoose
Copy link
Collaborator Author

Should this change go in a new major version of Renovate? The goal is to make it mandatory for users to decide when release notes are fetched, with a new default of latest/laziest.

@rarkins rarkins added the breaking Breaking change, requires major version bump label Jun 5, 2023
@RahulGautamSingh
Copy link
Collaborator

RahulGautamSingh commented Jun 14, 2023

To summarize:

The new config option will look like this:

  {
    name: 'fetchReleaseNotes',
    description: 'Controls if and during which stage release notes are fetched.',
    type: 'string',
    allowedValues: ['off', 'branch', 'pr'],
    default: 'pr',
    cli: false,
    env: false,
  },

And, after the new change we fetch release notes like this:

stage condition
updates/branchify if fetchReleaseNotes=off && needsChangelogs()=true
update/branch if fetchReleaseNotes=branch OR
config.commitBody && fetchReleaseNotes!=off && needsChangelogs()=true
update/pr if fetchReleaseNotes=pr

rarkins pushed a commit that referenced this issue Jun 18, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
@rarkins rarkins added status:in-progress Someone is working on implementation v36 and removed status:ready labels Jun 18, 2023
rarkins pushed a commit that referenced this issue Jun 18, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jun 18, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jun 27, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jun 27, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jul 1, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jul 4, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jul 4, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jul 4, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
rarkins pushed a commit that referenced this issue Jul 4, 2023
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr.

Closes #20476

BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
@rarkins rarkins closed this as completed in c2d3ca8 Jul 4, 2023
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 36.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change, requires major version bump core:changelogs Related to changelogs/release notes fetching priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality) v36
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants