This is an automated email from the ASF dual-hosted git repository.
Similarityoung pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git
The following commit(s) were added to refs/heads/develop by this push:
new 192414aa7 ci(lint): enable staticcheck SA1019 for new
deprecated-symbol usage (#964)
192414aa7 is described below
commit 192414aa7849ed60cd217ce7674a9696349917ca
Author: 承潜 <[email protected]>
AuthorDate: Sun Jul 26 13:20:06 2026 +0800
ci(lint): enable staticcheck SA1019 for new deprecated-symbol usage (#964)
* ci(lint): enable staticcheck SA1019 for new deprecated-symbol usage
Remove the global SA1019 exclusion from .golangci.yaml so golangci-lint
flags new uses of deprecated symbols. With the existing issues.new: true
gate, only newly changed code is checked, leaving pre-existing third-party
deprecations untouched.
Annotate the intentional deprecated AutoResolve read with a narrow
//nolint:staticcheck. Add a `make lint` target so the check is runnable
locally.
Closes #945
* fix(lint): improve Makefile lint target with proper syntax and error
handling
- Add .PHONY declarations for lint and check-lint targets
- Fix dependency syntax: 'lint: check-lint' instead of 'lint:check-lint'
- Add exit 1 to check-lint so make fails early with clear message when
golangci-lint is missing
- Improve error message formatting
Addresses Copilot review feedback on PR #964.
* ci(lint): fetch parent for new issue filtering
* fix(ci): fix SA1019 new-issue detection for multi-commit push
- Remove issues.new from .golangci.yaml; move diff-base logic to workflow
- Add 'Resolve lint base' step: use pull_request.base.sha for PRs,
github.event.before for pushes, fetch that commit to fix shallow-clone
'fatal: bad revision' error
- Pass --new-from-rev explicitly so golangci-lint always diffs against
the correct base regardless of push batch size
* fix(ci): restore issues.new for local lint; workflow uses --new-from-rev
---
.github/workflows/github-actions.yml | 17 +++++++++++++++++
.golangci.yaml | 3 ---
Makefile | 8 ++++++++
pkg/filter/http/remote/call.go | 4 +++-
4 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/github-actions.yml
b/.github/workflows/github-actions.yml
index 762d4c144..42f3c60a1 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -66,6 +66,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
+ with:
+ fetch-depth: 2
+ - name: Resolve lint base
+ id: lint_base
+ run: |
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
+ base="${{ github.event.pull_request.base.sha }}"
+ else
+ base="${{ github.event.before }}"
+ fi
+ if [ "$base" = "0000000000000000000000000000000000000000" ] || [ -z
"$base" ]; then
+ base=""
+ else
+ git fetch --depth=1 origin "$base" 2>/dev/null || true
+ fi
+ echo "sha=$base" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
@@ -74,6 +90,7 @@ jobs:
uses: golangci/golangci-lint-action@v8 # NOSONAR
with:
version: v2.4.0
+ args: ${{ steps.lint_base.outputs.sha != '' &&
format('--new-from-rev={0}', steps.lint_base.outputs.sha) || '' }}
unit-test:
needs: golangci
diff --git a/.golangci.yaml b/.golangci.yaml
index 4570cfc7a..f979a2507 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -49,9 +49,6 @@ linters:
- linters:
- gosec
text: weak cryptographic primitive
- - linters:
- - staticcheck
- text: 'SA1019:'
- linters:
- staticcheck
text: 'QF1008:'
diff --git a/Makefile b/Makefile
index cb2c6577b..a7159c701 100644
--- a/Makefile
+++ b/Makefile
@@ -68,6 +68,14 @@ test:
sh before_ut.sh
go test ./pkg/... -gcflags=-l -coverprofile=coverage.txt
-covermode=atomic
+.PHONY: lint check-lint
+
+lint: check-lint
+ @golangci-lint run
+
+check-lint:
+ @type golangci-lint >/dev/null 2>&1 || (echo "golangci-lint not
installed. Install: go install
github.com/golangci/golangci-lint/v2/cmd/[email protected]"; exit 1)
+
integrate-test:
sh start_integrate_test.sh
diff --git a/pkg/filter/http/remote/call.go b/pkg/filter/http/remote/call.go
index ab571e54d..0845cfc77 100644
--- a/pkg/filter/http/remote/call.go
+++ b/pkg/filter/http/remote/call.go
@@ -109,7 +109,9 @@ func (factory *FilterFactory) Apply() error {
if factory.conf.DubboProxyConfig == nil {
return errors.New("expect the dubboProxyConfig config the
registries")
}
- if factory.conf.DubboProxyConfig.AutoResolve != nil {
+ // AutoResolve is read intentionally to reject the deprecated field and
+ // guide users to configure integrationRequest explicitly.
+ if factory.conf.DubboProxyConfig.AutoResolve != nil {
//nolint:staticcheck // SA1019: deliberately detect the removed option
return errors.New("dubboProxyConfig.auto_resolve is no longer
supported; remove it and configure integrationRequest explicitly in the API
definition")
}
initDubboClient(factory.conf.DubboProxyConfig)