-
Notifications
You must be signed in to change notification settings - Fork 359
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
feat: introduce generic updater #1157
Conversation
…ion with the generic updater
@@ -40,3 +40,27 @@ export class CompositeUpdater implements Updater { | |||
return content || ''; | |||
} | |||
} | |||
|
|||
export function mergeUpdates(updates: Update[]): Update[] { | |||
const updatesByPath: Record<string, Update[]> = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have Record<Update['path'], Update[]>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would probably work in case update's path's type changes, but I think for readability, string
might be easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of annotations. In practice, has is the list of files provided to update?
For the generic updater, this will be provided adhoc via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, but I think it would be good to ad a docs/customizing-releases.md
or something along those lines, where you speak to how someone can configure and use this functionality.
Opened: #1174 to follow up with |
@bcoe Added documentation in docs/customizing.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a great addition to functionality, and we can evolve the feature over time if we find supporting JSON files is a requirement.
🤖 I have created a release \*beep\* \*boop\* --- ## [13.1.0](https://github.com/googleapis/release-please/compare/v13.0.2...v13.1.0) (2021-12-29) ### Features * introduce generic updater ([#1157](https://github.com/googleapis/release-please/issues/1157)) ([c97598c](https://github.com/googleapis/release-please/commit/c97598c137b5018c76f5d62137e277b991f4bfa3)), closes [#435](https://github.com/googleapis/release-please/issues/435) [#305](https://github.com/googleapis/release-please/issues/305) [#1139](https://github.com/googleapis/release-please/issues/1139) [#1174](https://github.com/googleapis/release-please/issues/1174) --- This PR was generated with [Release Please](https:/googleapis/release-please). See [documentation](https:/googleapis/release-please#release-please).
This introduces a new
Generic
updater class that scans the file line by line for annotations.You can annotate a line (inline) via:
x-release-please-version
x-release-please-major
x-release-please-minor
x-release-please-patch
For these annotations, we will try to replace the value on that line only.
You can annotate a block by starting with a line containing:
x-release-please-start-version
x-release-please-start-major
x-release-please-start-minor
x-release-please-start-patch
and close the block with a line containing
x-release-please-end
. Within the block, we will attempt to replace version values.Additionally, all basic strategies now support the
extra-files
option which will apply this generic updater class.Fixes #435
Fixes #305
Fixes #1139
Fixes #1174