Skip to content

Commit

Permalink
Merge branch 'main' into alfus/validate
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Feb 8, 2024
2 parents da66af9 + c1f813c commit cb5f478
Show file tree
Hide file tree
Showing 1,051 changed files with 3,655 additions and 2,444 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
cmd/buf/buf
cmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking
cmd/protoc-gen-buf-lint/protoc-gen-buf-lint
private/buf/buftesting/cache/
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
private/buf/cmd/buf/command/alpha/protoc/test.txt
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/buf-binary-size.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: binary-size
on: push
# Prevent writing to the repository using the CI token.
# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions
permissions: read-all
env:
MAKEFLAGS: "-j 2"
jobs:
buf-binary-size:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: cache
uses: actions/cache@v4
with:
path: |
~/.cache/buf/${{ runner.os }}/x86_64/bin
~/.cache/buf/${{ runner.os }}/x86_64/go/pkg/mod
~/.cache/buf/${{ runner.os }}/x86_64/gocache
~/.cache/buf/${{ runner.os }}/x86_64/include
~/.cache/buf/${{ runner.os }}/x86_64/versions
key: ${{ runner.os }}-buf-${{ hashFiles('**/go.sum', 'make/**') }}
restore-keys: |
${{ runner.os }}-buf-
- name: make-bufbinarysize
run: make bufbinarysize
4 changes: 2 additions & 2 deletions .github/workflows/buf-shadow-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
fetch-depth: 0 # fetch all branches and commits, so we can loop them
- run: git remote set-head origin --auto # set a HEAD for remote/origin, so buf sync can pickup the current default branch
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- name: Install Local Buf
run: GOBIN="$HOME/go/bin" go install ./cmd/buf # use CLI version from the checked out code
- run: buf --version
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.28.1
- uses: bufbuild/buf-setup-action@v1.29.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-lint-action@v1.1.0
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.28.1
- uses: bufbuild/buf-setup-action@v1.29.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-breaking-action@v1.1.3
Expand All @@ -33,7 +33,7 @@ jobs:
- breaking
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.28.1
- uses: bufbuild/buf-setup-action@v1.29.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-push-action@v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
with:
token: ${{ steps.app_token.outputs.token }}
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
go-version: '1.22.x'
- name: Set up Git name and email
run: |
git config user.name "${{ github.actor }}"
Expand Down
44 changes: 23 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/buf/${{ runner.os }}/x86_64/bin
Expand All @@ -28,7 +28,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buf-lint-
- name: golangci-lint-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/golangci-lint
# https://github.com/golangci/golangci-lint-action#caching-internals includes an interval number in the cache
Expand All @@ -48,11 +48,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/buf/${{ runner.os }}/x86_64/bin
Expand Down Expand Up @@ -94,23 +94,25 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: set-tag
# See the following links for setting job outputs
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
id: tag
run: |
if echo "${GITHUB_REF}" | grep ^refs/heads/main$ >/dev/null; then
echo "tag=latest" >> $GITHUB_OUTPUT
elif echo "${GITHUB_REF}" | grep ^refs/tags/v >/dev/null; then
echo "tag=${GITHUB_REF}" | sed "s|refs/tags/v||" >> $GITHUB_OUTPUT
fi
- name: docker-meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
bufbuild/buf
tags: |
type=edge,branch=main
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{version}}
flavor: |
latest=auto
- name: docker-build-push
uses: docker/build-push-action@v5
with:
file: Dockerfile.buf
platforms: ${{ steps.qemu.outputs.platforms }}
push: true
tags: |
bufbuild/buf:latest
bufbuild/buf:${{ steps.tag.outputs.tag }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- name: initialize
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
# Limit analysis to Go for now.
# Available languages: https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#changing-the-languages-that-are-analyzed
languages: go
- name: autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
- name: analyze
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
6 changes: 3 additions & 3 deletions .github/workflows/previous.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.20.x'
go-version: '1.21.x'
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/buf/${{ runner.os }}/x86_64/bin
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
- name: windows-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.DOWNLOAD_CACHE }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/cmd/buf/buf
/cmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking
/cmd/protoc-gen-buf-lint/protoc-gen-buf-lint
/private/buf/buftesting/cache/
/private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
/private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
/private/buf/cmd/buf/command/alpha/protoc/test.txt
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ linters-settings:
- '^log\.'
- '^print$'
- '^println$'
govet:
enable:
- nilness
importas:
alias:
- pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

- No changes yet.

## [v1.29.0] - 2024-01-24

- Add support for `yaml` format. All commands that take image inputs, output images,
or convert between message formats, now take `yaml` as a format, in addition to
the existing `binpb` and `txtpb` formats. Some examples:
Expand All @@ -12,6 +16,9 @@
`use_enum_numbers`. This affects output serialization. Some examples:
- `buf convert --type foo.Bar --from input.binpb --to output.yaml#use_proto_names=true`
- `buf convert --type foo.Bar --from input.binpb --to -#format=yaml,use_enum_numbers=true`
- Fix issue where `buf format` would inadvertently mangle files that used
the [expanded `Any` syntax](https://protobuf.com/docs/language-spec#any-messages)
in option values.

## [v1.28.1] - 2023-11-15

Expand Down Expand Up @@ -999,7 +1006,8 @@ buf check breaking proto --against .git#branch=master,subdir=proto

Initial beta release.

[Unreleased]: https://github.com/bufbuild/buf/compare/v1.28.1...HEAD
[Unreleased]: https://github.com/bufbuild/buf/compare/v1.29.0...HEAD
[v1.29.0]: https://github.com/bufbuild/buf/compare/v1.28.1...v1.29.0
[v1.28.1]: https://github.com/bufbuild/buf/compare/v1.28.0...v1.28.1
[v1.28.0]: https://github.com/bufbuild/buf/compare/v1.27.2...v1.28.0
[v1.27.2]: https://github.com/bufbuild/buf/compare/v1.27.1...v1.27.2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.buf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine3.18 as builder
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine3.19 as builder

WORKDIR /workspace

Expand All @@ -13,7 +13,7 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags "-s -w" -trimpath -buildvcs=false -o /go/bin/buf ./cmd/buf

FROM --platform=${TARGETPLATFORM} alpine:3.18.4
FROM --platform=${TARGETPLATFORM} alpine:3.19.1

RUN apk add --update --no-cache \
ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.workspace
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18
FROM golang:1.22-alpine3.19

ARG PROJECT
ARG GO_MODULE
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2022 Buf Technologies, Inc.
Copyright 2020-2024 Buf Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

# Buf

[![License](https://img.shields.io/github/license/bufbuild/buf?color=blue)][badges_license]
[![Release](https://img.shields.io/github/v/release/bufbuild/buf?include_prereleases)][badges_release]
[![CI](https://github.com/bufbuild/buf/workflows/ci/badge.svg)][badges_ci]
[![Docker](https://img.shields.io/docker/pulls/bufbuild/buf)][badges_docker]
[![Homebrew](https://img.shields.io/homebrew/v/buf)][badges_homebrew]
[![License](https://img.shields.io/github/license/bufbuild/buf?color=blue)](https://github.com/bufbuild/buf/blob/main/LICENSE)
[![Release](https://img.shields.io/github/v/release/bufbuild/buf?include_prereleases)](https://github.com/bufbuild/buf/releases)
[![CI](https://github.com/bufbuild/buf/workflows/ci/badge.svg)](https://github.com/bufbuild/buf/actions?workflow=ci)
[![Docker](https://img.shields.io/docker/pulls/bufbuild/buf)](https://hub.docker.com/r/bufbuild/buf)
[![Homebrew](https://img.shields.io/homebrew/v/buf)](https://github.com/bufbuild/homebrew-buf)
[![Slack](https://img.shields.io/badge/slack-buf-%23e01563)][badges_slack]

The [`buf`][buf] CLI is a tool for working with [Protocol Buffers][protobuf].
The [`buf`][buf] CLI is the best tool for working with [Protocol Buffers][protobuf]. It provides:

<a id="features"></a>

- The ability to manage Protobuf assets on the [Buf Schema Registry][bsr] (BSR).
- A [linter][lint_usage] that enforces good API design choices and structure.
- A [breaking change detector][breaking_usage] that enforces compatibility at the source code or wire level.
- A [generator][generate_usage] that invokes your plugins based on configurable [templates][templates].
Expand Down Expand Up @@ -108,12 +105,6 @@ For updates on the Buf CLI, [follow this repo on GitHub][repo].

For feature requests, bugs, or technical questions, email us at [dev@buf.build][email_dev]. For general inquiries or inclusion in our upcoming feature betas, email us at [info@buf.build][email_info].

[badges_aur]: https://aur.archlinux.org/packages/buf
[badges_ci]: https://github.com/bufbuild/buf/actions?workflow=ci
[badges_docker]: https://hub.docker.com/r/bufbuild/buf
[badges_homebrew]: https://github.com/bufbuild/homebrew-buf
[badges_license]: https://github.com/bufbuild/buf/blob/main/LICENSE
[badges_release]: https://github.com/bufbuild/buf/releases
[badges_slack]: https://buf.build/links/slack
[bash]: https://www.gnu.org/software/bash
[binary]: https://docs.buf.build/installation#binary
Expand Down
2 changes: 1 addition & 1 deletion cmd/buf/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/protoc-gen-buf-breaking/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/protoc-gen-buf-lint/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit cb5f478

Please sign in to comment.