-
Notifications
You must be signed in to change notification settings - Fork 1
feat: init repo and migrate hystrix from dubbo-go #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a695238
feat: init repo and migrate hystrix from dubbo-go
zbchi 6604aaf
add readme_cn
zbchi b356211
ci: modernize GitHub Actions workflow
zbchi db77e03
ci: add imports-formatter check to CI workflow
zbchi 9cfb1a5
Update filter/hystrix/filter.go
zbchi 5b678e7
rename COrP to isConsumer
zbchi e84c279
remove parameter types from getResourceName()
zbchi 64254d8
rename failByHystrix to circuitOpen
zbchi 5e54147
fix: update .golangci-lint config to v2 version
zbchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| github: | ||
| features: | ||
| wiki: true | ||
| issues: true | ||
| projects: true | ||
| notifications: | ||
| commits: commits@dubbo.apache.org | ||
| issues: notifications@dubbo.apache.org | ||
| pullrequests: notifications@dubbo.apache.org | ||
| jira_options: link label link label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # To get started with Dependabot version updates, you'll need to specify which | ||
| # package ecosystems to update and where the package manifests are located. | ||
| # Please see the documentation for all configuration options: | ||
| # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
|
||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "gomod" # See documentation for possible values | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "weekly" | ||
| target-branch: "main" | ||
|
|
||
| - package-ecosystem: "github-actions" | ||
| # Workflow files stored in the | ||
| # default location of `.github/workflows` | ||
| directory: "/" | ||
| schedule: | ||
| interval: "monthly" | ||
| target-branch: "main" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| # Cancel in-progress runs for the same branch or PR | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| license-check-and-import-format: | ||
| name: License Check and Import Format | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
|
|
||
| - name: Cache imports-formatter | ||
| id: cache-go-bin | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/go/bin | ||
| key: ${{ runner.os }}-go-imports-formatter-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go-imports-formatter- | ||
|
|
||
| - name: Download imports-formatter if not cached | ||
| if: steps.cache-go-bin.outputs.cache-hit != 'true' | ||
| run: | | ||
| go install github.com/dubbogo/tools/cmd/imports-formatter@latest | ||
|
|
||
| - name: Check License Header | ||
| uses: apache/skywalking-eyes/header@main # NOSONAR | ||
|
|
||
| - name: Check Golang fmt | ||
| run: | | ||
| gofmt -s -w . | ||
| git diff --exit-code | ||
|
|
||
| - name: Check Import Formatting | ||
| run: | | ||
| imports-formatter | ||
| git diff --exit-code | ||
|
|
||
| golangci-lint: | ||
| needs: license-check-and-import-format | ||
| name: Golang Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
|
|
||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v8 # NOSONAR | ||
| with: | ||
| version: v2.4.0 | ||
|
|
||
| unit-test: | ||
| needs: golangci-lint | ||
| name: Unit Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
|
|
||
| - name: Run Tests and Generate Coverage | ||
| run: | | ||
| go test ./... -race -coverprofile=coverage.txt -covermode=atomic | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 # NOSONAR | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: ./coverage.txt | ||
| flags: unittests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Binaries for programs and plugins | ||
| *.exe | ||
| *.exe~ | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
| *.DS_Store | ||
| *__debug_bin* | ||
|
|
||
| dist/ | ||
| *.log | ||
| # Test binary, build with `go test -c` | ||
| *.test | ||
|
|
||
| # Output of the go coverage tool, specifically when used with LiteIDE | ||
| *.out | ||
| coverage.txt | ||
|
|
||
| # .env is a user-specific environment configuration file | ||
| *.env | ||
|
|
||
| *.idea | ||
| *.iml | ||
| target/ | ||
| classes | ||
| dubbo.json | ||
|
|
||
| # Gopkg.lock | ||
| vendor/ | ||
|
|
||
| logs/ | ||
| .vscode/ | ||
| cache/ | ||
| log/ | ||
| coverage.txt | ||
|
|
||
| # maven | ||
| .classpath | ||
| .project | ||
| .settings/ | ||
|
|
||
| # license header | ||
| /license-header-checker-linux/ | ||
| /license-header-checker-linux.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| version: "2" | ||
| linters-settings: | ||
| gocyclo: | ||
| min-complexity: 10 | ||
| dupl: | ||
| threshold: 100 | ||
| goconst: | ||
| min-len: 2 | ||
| min-occurrences: 2 | ||
| depguard: | ||
| rules: | ||
| main: | ||
| deny: | ||
| - pkg: "github.com/sirupsen/logrus" | ||
| desc: logging is allowed only by logutils.Log, logrus, is allowed to use only in logutils package | ||
| lll: | ||
| line-length: 140 | ||
| goimports: | ||
| local-prefixes: github.com/apache/dubbo-go-extensions | ||
| gocritic: | ||
| enabled-tags: | ||
| - performance | ||
| - style | ||
| - experimental | ||
| disabled-checks: | ||
| - wrapperFunc | ||
|
|
||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| - staticcheck | ||
| - ineffassign | ||
| - misspell | ||
|
|
||
| issues: | ||
| exclude-dirs: | ||
| - test/testdata_etc | ||
| - pkg/golinters/goanalysis/(checker|passes) | ||
| exclude-rules: | ||
| - text: "weak cryptographic primitive" | ||
| linters: | ||
| - gosec | ||
| - linters: | ||
| - staticcheck | ||
| text: "SA1019:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| header: | ||
| license: | ||
| spdx-id: Apache-2.0 | ||
| content: | | ||
| Licensed to the Apache Software Foundation (ASF) under one or more | ||
| contributor license agreements. See the NOTICE file distributed with | ||
| this work for additional information regarding copyright ownership. | ||
| The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| paths-ignore: | ||
| - '**/*.md' | ||
| - '**/*.json' | ||
| - '**/*.yaml' | ||
| - '**/*.yml' | ||
| - '**/*.properties' | ||
| - '**/*.proto' | ||
| - '**/*.tpl' | ||
| - '**/go.mod' | ||
| - '**/go.sum' | ||
| - '.git/' | ||
| - '.github/**' | ||
| - '.gitignore' | ||
| - '.gitmodules' | ||
| - 'LICENSE' | ||
| - 'NOTICE' | ||
|
|
||
| comment: on-failure | ||
|
|
||
| # If you don't want to check dependencies' license compatibility, remove the following part | ||
| dependency: | ||
| files: | ||
| - go.mod |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.