Migrating from Buf to EasyP
Step-by-step migration guide for transitioning configurations and commands from Buf CLI to EasyP.
This guide maps Buf configuration to the EasyP v1 files and commands. Review each setting against the v1 schema rather than copying the old configuration unchanged.
Direct Conceptual & File Mapping
| Buf Construct | EasyP Equivalent | Key Distinction |
|---|---|---|
buf.yaml (deps section) | protobuf.mod | Tool-neutral dependency DSL; uses Git URLs instead of proprietary BSR names. |
buf.yaml (lint section) | easyp.yaml (linters) | Uses presets and rule lists; each policy section comes whole from its nearest definition. extends explicitly loads a section base from a local file or an existing locked module. |
buf.yaml (breaking section) | easyp.yaml (breaking) | Explicit git baseline comparison (e.g. git:main). |
buf.gen.yaml | easyp.gen.yaml | Resides at consumer project level and selects complete modules. |
buf.gen.yaml (managed) | easyp.gen.yaml (generate.managed) | Explicit managed mode; options.go.package_prefix is a separate Go-only convenience. |
buf.lock | protobuf.lock | Includes Git commit SHAs and content hashes. |
buf dep update | easyp mod tidy | Resolves declared requirements with MVS and writes the lock; review version updates separately. |
buf lint | easyp lint | Cascades through nearest easyp.yaml. |
buf breaking | easyp breaking | CI gate against explicit baseline. |
buf generate | easyp generate | Selects the nearest enclosing generator file; use --project or explicit recursive --all. |
Step-by-Step Migration Steps
Step 1: Initial Setup
Run easyp init in a new project root to create protobuf.mod, easyp.yaml, and easyp.gen.yaml. Pass --module when the canonical Git module identity cannot be derived from the repository's origin remote.
easyp init --module github.com/acme/my-serviceAutomatic Buf Registry dependency conversion is deferred. If buf.yaml or buf.yml exists, easyp init stops before writing files because a buf.build/... identity cannot be safely treated as a Git module URL. Choose the Git source for each dependency, then create the v1 files explicitly.
Step 2: Separate Dependencies into protobuf.mod
Extract module dependencies from buf.yaml into protobuf.mod:
// protobuf.mod
module github.com/acme/my-service
require (
github.com/googleapis/googleapis v1.5.0
)Step 3: Convert Lint & Breaking Rules to easyp.yaml
Convert buf.yaml lint/breaking configurations into easyp.yaml:
# easyp.yaml
version: v1
linters:
default: STANDARD
breaking:
baseline: git:mainStep 4: Select Modules for Generation
Replace legacy inputs blocks with module selection. In this example, the root protobuf.mod owns the schemas, and backend/easyp.gen.yaml selects that root module using .. Module roots come from the manifest:
# backend/easyp.gen.yaml
version: v1
generate:
modules:
- .
plugins:
- name: go
out: ./gen/go
opts:
paths: source_relativeThe local go plugin requires protoc-gen-go in the build environment. Fix its version there; local plugins reject a YAML version. Remote plugins require a separate pinned semantic version. generate.packages selects exact protobuf package names within the selected modules.
Step 5: Tidy and Verify
From the repository root, resolve dependencies, lint schemas, and generate the selected project:
easyp mod tidy
easyp lint
easyp generate --project ./backendReview and commit protobuf.mod and protobuf.lock. Active local replacements must be removed before tidy or update; both commands reject them. In CI, use easyp mod download to verify locked dependencies and run easyp breaking --against main with the baseline available locally.
Only FILE is supported in breaking.categories; ignore_unstable is available. Check the policy reference before translating Buf breaking settings, and compare generated output and consumer tests before retiring the old workflow.