-
Notifications
You must be signed in to change notification settings - Fork 380
feat(handshake): enum protobuf and capabilities #5105
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
8c475fd
eecb596
3a5d0da
1ad411d
0f2227c
518fac4
1050518
78d2018
1e3235e
419d387
f88ef72
ee677ea
27d7589
e9b9802
f8536f7
f6a9c2b
0c4e215
229271e
03bcd24
b0e6cb0
bd831b2
28e04bf
f4cc639
c45bf03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,126 +1,126 @@ | ||
| name: Go | ||
|
|
||
| on: | ||
| push: | ||
| paths-ignore: | ||
| - packaging/** | ||
| branches: | ||
| - 'master' | ||
| pull_request: | ||
| paths-ignore: | ||
| - packaging/** | ||
| branches: | ||
| - '**' | ||
| push: | ||
| paths-ignore: | ||
| - packaging/** | ||
| branches: | ||
| - "master" | ||
| pull_request: | ||
| paths-ignore: | ||
| - packaging/** | ||
| branches: | ||
| - "**" | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: true | ||
| go-version-file: go.mod | ||
| - name: Build | ||
| run: make build | ||
| - name: Test with race detector (Ubuntu and MacOS) | ||
| if: matrix.os != 'windows-latest' | ||
| run: make test-ci-race | ||
| - name: Test without race detector (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: make test-ci | ||
| test-flaky: | ||
| name: Test (flaky) | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: ${{ github.ref == 'refs/heads/master' }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: true | ||
| go-version-file: go.mod | ||
| - name: Run flaky test | ||
| run: make test-ci-flaky | ||
| continue-on-error: ${{ github.ref == 'refs/heads/master' }} | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Commit linting | ||
| if: github.ref != 'refs/heads/master' | ||
| uses: wagoid/commitlint-github-action@v5 | ||
| - name: GolangCI-Lint | ||
| uses: golangci/golangci-lint-action@v6 | ||
| with: | ||
| skip-cache: false | ||
| version: v1.64.5 | ||
| - name: Whitespace check | ||
| run: make check-whitespace | ||
| - name: go mod tidy check | ||
| uses: katexochen/go-tidy-check@v2 | ||
| coverage: | ||
| name: Coverage Report | ||
| if: github.ref == 'refs/heads/master' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Cache Go Modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-coverage-${{ hashFiles('**/go.sum') }} | ||
| - name: Test with code coverage | ||
| run: make cover=1 test-ci | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| fail_ci_if_error: true | ||
| files: ./cover.out | ||
| trigger-beekeeper: | ||
| name: Trigger Beekeeper | ||
| runs-on: ubuntu-latest | ||
| needs: [test, lint, coverage] | ||
| if: github.ref == 'refs/heads/master' | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Trigger Beekeeper | ||
| uses: peter-evans/repository-dispatch@v2 | ||
| with: | ||
| token: ${{ secrets.GHA_PAT_BASIC }} | ||
| repository: ${{ github.repository }} | ||
| event-type: trigger-beekeeper | ||
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' | ||
| test: | ||
| name: Test | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: true | ||
| go-version-file: go.mod | ||
| - name: Build | ||
| run: make build | ||
| - name: Test with race detector (Ubuntu and MacOS) | ||
| if: matrix.os != 'windows-latest' | ||
| run: make test-ci-race | ||
| - name: Test without race detector (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: make test-ci | ||
| test-flaky: | ||
| name: Test (flaky) | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: ${{ github.ref == 'refs/heads/master' }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: true | ||
| go-version-file: go.mod | ||
| - name: Run flaky test | ||
| run: make test-ci-flaky | ||
| continue-on-error: ${{ github.ref == 'refs/heads/master' }} | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Commit linting | ||
| if: github.ref != 'refs/heads/master' | ||
| uses: wagoid/commitlint-github-action@v5 | ||
| - name: GolangCI-Lint | ||
| uses: golangci/golangci-lint-action@v7 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bump required here as v2.1.6 of GolangCI-lint is only supported in |
||
| with: | ||
| skip-cache: false | ||
| version: v2.1.6 | ||
| - name: Whitespace check | ||
| run: make check-whitespace | ||
| - name: go mod tidy check | ||
| uses: katexochen/go-tidy-check@v2 | ||
| coverage: | ||
| name: Coverage Report | ||
| if: github.ref == 'refs/heads/master' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Cache Go Modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-coverage-${{ hashFiles('**/go.sum') }} | ||
| - name: Test with code coverage | ||
| run: make cover=1 test-ci | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| fail_ci_if_error: true | ||
| files: ./cover.out | ||
| trigger-beekeeper: | ||
| name: Trigger Beekeeper | ||
| runs-on: ubuntu-latest | ||
| needs: [test, lint, coverage] | ||
| if: github.ref == 'refs/heads/master' | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Trigger Beekeeper | ||
| uses: peter-evans/repository-dispatch@v2 | ||
| with: | ||
| token: ${{ secrets.GHA_PAT_BASIC }} | ||
| repository: ${{ github.repository }} | ||
| event-type: trigger-beekeeper | ||
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Migrates the golang CI yaml to version 2, given that the project now uses go 1.24.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| run: | ||
| timeout: 10m | ||
| version: "2" | ||
| linters: | ||
| enable: | ||
| - asciicheck | ||
|
|
@@ -13,10 +12,8 @@ linters: | |
| - forbidigo | ||
| - gochecknoinits | ||
| - goconst | ||
| - gofmt | ||
| - goheader | ||
| - goprintffuncname | ||
| - gosimple | ||
| - govet | ||
| - importas | ||
| - ineffassign | ||
|
|
@@ -29,47 +26,76 @@ linters: | |
| - promlinter | ||
| - staticcheck | ||
| - thelper | ||
| - typecheck | ||
| - unconvert | ||
| - unused | ||
| # - depguard disable temporary until this issue is resolved: https://github.com/golangci/golangci-lint/issues/3906 | ||
|
|
||
| linters-settings: | ||
| govet: | ||
| enable-all: true | ||
| disable: | ||
| - fieldalignment ## temporally disabled | ||
| - shadow ## temporally disabled | ||
| goheader: | ||
| values: | ||
| regexp: | ||
| date: "20[1-2][0-9]" | ||
| template: |- | ||
| Copyright {{date}} The Swarm Authors. All rights reserved. | ||
| Use of this source code is governed by a BSD-style | ||
| license that can be found in the LICENSE file. | ||
| paralleltest: | ||
| # Ignore missing calls to `t.Parallel()` and only report incorrect uses of `t.Parallel()`. | ||
| ignore-missing: true | ||
| issues: | ||
| exclude-rules: | ||
| - linters: | ||
| - goheader | ||
| text: "go-ethereum Authors" ## disable check for other authors | ||
| - path: _test\.go | ||
| linters: | ||
| - goconst ## temporally disable goconst in test | ||
| - linters: | ||
| - forbidigo | ||
| path: cmd/bee/cmd | ||
| text: "use of `fmt.Print" ## allow fmt.Print in cmd directory | ||
| - linters: | ||
| - dogsled | ||
| path: pkg/api/(.+)_test\.go # temporally disable dogsled in api test files | ||
| - linters: | ||
| - dogsled | ||
| path: pkg/pushsync/(.+)_test\.go # temporally disable dogsled in pushsync test files | ||
| # temporally disable paralleltest in following packages | ||
| - linters: | ||
| - paralleltest | ||
| path: pkg/log | ||
| settings: | ||
| goheader: | ||
| values: | ||
| regexp: | ||
| date: 20[1-2][0-9] | ||
| template: |- | ||
| Copyright {{date}} The Swarm Authors. All rights reserved. | ||
| Use of this source code is governed by a BSD-style | ||
| license that can be found in the LICENSE file. | ||
| govet: | ||
| disable: | ||
| - fieldalignment | ||
| - shadow | ||
| enable-all: true | ||
| paralleltest: | ||
| ignore-missing: true | ||
| exclusions: | ||
| generated: lax | ||
| presets: | ||
| - comments | ||
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| rules: | ||
| - linters: | ||
| - goheader | ||
| text: go-ethereum Authors | ||
| - linters: | ||
| - goconst | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. originally, next to the rules there we comments like "temporally disable...", but this is how temporal solutions work usually : D |
||
| path: _test\.go | ||
| - linters: | ||
| - forbidigo | ||
| path: cmd/bee/cmd | ||
| text: use of `fmt.Print | ||
| - linters: | ||
| - dogsled | ||
| path: pkg/api/(.+)_test\.go | ||
| - linters: | ||
| - dogsled | ||
| path: pkg/pushsync/(.+)_test\.go | ||
| - linters: | ||
| - paralleltest | ||
| path: pkg/log | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1008:" | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1001:" | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1002:" | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1003:" | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1006:" | ||
|
Comment on lines
+74
to
+88
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disregarded as these are general in nature |
||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| exclusions: | ||
| generated: lax | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| GO ?= go | ||
| GOBIN ?= $$($(GO) env GOPATH)/bin | ||
| GOLANGCI_LINT ?= $(GOBIN)/golangci-lint | ||
| GOLANGCI_LINT_VERSION ?= v1.64.5 | ||
| GOLANGCI_LINT_VERSION ?= v2.1.6 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Raising golangci-lint version to 2 involves a larger set of changes in this PR which as a different purpose. I would recommend to create a separate PR for improvimg golangci-lint usage. |
||
| GOGOPROTOBUF ?= protoc-gen-gogofaster | ||
| GOGOPROTOBUF_VERSION ?= v1.3.1 | ||
| BEEKEEPER_INSTALL_DIR ?= $(GOBIN) | ||
|
|
||
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.
unnecessary indentation doubling on each line.