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

fix: dont allow release-please to update workspace changelogs #398

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions lib/release/node-workspace-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,6 @@ module.exports = class extends ManifestPlugin {
return `${link(scope, url)}: ${wrapSpecs(`${name}@${version}`)}`
})

// remove the other release please dependencies list which always starts with
// the following line and then each line is indented. so we search for the line
// and remove and indented lines until the next non indented line.
let foundRemoveStart = false
let foundRemoveEnd = false
release.notes = release.notes
.split('\n')
.filter((line) => {
if (line === '* The following workspace dependencies were updated') {
foundRemoveStart = true
} else if (foundRemoveStart && !foundRemoveEnd) {
// TODO: test when inserted dependencies is not the last thing in the changelog
/* istanbul ignore next */
if (!line || !line.startsWith(' ')) {
foundRemoveEnd = true
}
}
// If we found the start, remove all lines until we've found the end
return foundRemoveStart ? foundRemoveEnd : true
})
.join('\n')

// Find the associated changelog and update that too
const path = this.#pathsByComponent.get(release.component)
for (const update of candidate.pullRequest.updates) {
Expand Down
7 changes: 7 additions & 0 deletions lib/release/node-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ const { WORKSPACE_MESSAGE } = require('./node-workspace-format')
// release-please ourselves.
/* istanbul ignore next: TODO fix flaky tests and enable coverage */
class NpmNodeWorkspace extends NodeWorkspace {
updateCandidate (pr) {
// no-op so release-please node-workspace plugin does not add
// its broken changelog to the workspace releases. our changelog
// formatting and the preconfigure method below fix this.
return pr
}

async preconfigure (strategiesByPath, commitsByPath, releasesByPath) {
// First build a list of all releases that will happen based on the
// conventional commits
Expand Down