buf.star¶
Bump Buf remote plugins, module dependencies and the buf.yaml format.
Edits are line-based, so comments in buf.yaml and buf.gen.yaml stay as they were.
| Function | What it does |
|---|---|
set_plugin_version |
Moves a remote plugin to a new version in every buf.gen.yaml. |
set_dep_ref |
Pins a module dependency in buf.yaml to a label or commit, such as buf.build/googleapis/googleapis:<commit>. |
set_plugin_version¶
Moves a remote plugin to a new version in every buf.gen.yaml.
Covers remote: (v1) and plugin: / remote: under plugins (v2),
written as buf.build/<owner>/<plugin>:<version>.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
plugin |
The plugin, such as buf.build/protocolbuffers/go. |
version |
The new version, such as v1.35.1. |
Returns: The list of paths that changed.
Example
Used in: buf-plugins
set_dep_ref¶
Pins a module dependency in buf.yaml to a label or commit, such as buf.build/googleapis/googleapis:<commit>.
Dependencies listed without a ref get one. buf.lock isn't updated; run
buf dep update (or buf mod update for v1) in a run step.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
module |
The module, such as buf.build/googleapis/googleapis. |
ref |
The label or commit. |
Returns: The list of paths that changed.
Example
set_dep_ref(repo, "buf.build/googleapis/googleapis", "e7f8d366f5264595bcc4cd4139af9973")
set_dep_ref(repo, "buf.build/bufbuild/protovalidate", "v0.8.0")
# returns ["buf.yaml"]