Skip to content

Conversation

@masih
Copy link
Collaborator

@masih masih commented Sep 9, 2025

Integrate the very basic unified CI process for bare minimum linting of Go files.

Note: changes here are mechanical only.

Integrate the very basic unified CI process for bare minimum linting of
Go files.
@github-actions
Copy link

github-actions bot commented Sep 9, 2025

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 24, 2025, 9:27 AM

@masih masih changed the title Masih/uci lint integration Integrate go lint unified CI Sep 9, 2025
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.26%. Comparing base (a337701) to head (6e6bef0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
- Coverage   57.36%   57.26%   -0.10%     
==========================================
  Files         257      257              
  Lines       34597    34597              
==========================================
- Hits        19847    19813      -34     
- Misses      13164    13198      +34     
  Partials     1586     1586              
Files with missing lines Coverage Δ
internal/mempool/mempool.go 70.48% <ø> (ø)

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

uint64 nonce = 2;
// buf:lint:ignore FIELD_LOWER_SNAKE_CASE We have caught this late; keeping to avoid breaking changes.
string txHash = 3;
// buf:lint:ignore FIELD_LOWER_SNAKE_CASE We have caught this late; keeping to avoid breaking changes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have slipped through in the past and not worth the refactor, since I believe they will result in breaking API changes during JSON serialisation. Hence the ignore comment.

@@ -0,0 +1,3 @@
package sei_tendermint

//go:generate ./scripts/proto-gen.sh
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nice thing about this is that we now can generate all the go related resources with go generate ./... which is more convenient for both DX and CI setup.

ifeq (,$(shell which protoc-gen-gogofaster))
$(error "gogofaster plugin for protoc is required. Run 'go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest' to install")
endif
@go install github.com/gogo/protobuf/protoc-gen-gogofaster@v1.3.2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified dependency checking here since go install is clever enough to not re-install it if it's already present. There is therefore little point in hassling the user. This way it just works.

proto-format: check-proto-deps
@echo "Formatting Protobuf files"
@find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
@$(BUF) format -w
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped clang-format entirely in favour of simply using buf; we are using it for generation and linting. Why not for formatting too. As an added bonus this is more IDE friendly since most IDEs use proto formatting by default for proto files.

.PHONY: proto-check-breaking

proto-all: proto-gen proto-format proto-check-breaking
proto-all: proto-gen proto-format proto-lint proto-check-breaking
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were missing proto-lint here; added.

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buf ecosystem now comes with fancy GitHub actions, which is worth using instead of inventing our own.

@masih masih marked this pull request as ready for review September 9, 2025 14:12
# Conflicts:
#	proto/tendermint/blocksync/types.proto
#	proto/tendermint/types/canonical.pb.go
#	proto/tendermint/types/canonical.proto
#	proto/tendermint/types/types.pb.go
#	proto/tendermint/types/types.proto
@masih masih merged commit 5eeed73 into main Sep 24, 2025
47 of 49 checks passed
@masih masih deleted the masih/uci-lint-integration branch September 24, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants