Skip to content
Snippets Groups Projects
Unverified Commit a347a049 authored by Joe Zou's avatar Joe Zou Committed by GitHub
Browse files

Merge pull request #938 from zouyx/add1.5.5

Ftr: Release 1.5.5-rc1
parents c0fdfa55 c5f002bb
No related branches found
No related tags found
No related merge requests found
Showing
with 485 additions and 238 deletions
<!-- Thanks for sending a pull request!
<!-- Thanks for sending a pull request!
Read https://github.com/apache/dubbo-go/blob/master/contributing.md before commit pull request.
-->
**What this PR does**:
......
# 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: "develop"
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
\ No newline at end of file
name: "CodeQL"
on:
push:
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 4 * * 5'
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
......@@ -19,49 +19,92 @@ jobs:
os:
- ubuntu-latest
env:
DING_TOKEN: ${{ secrets.DING_TOKEN }}
DING_SIGN: ${{ secrets.DING_SIGN }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
id: go
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
# Cache
path: ~/go/pkg/mod
# Cache key
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
else
go get -v -t -d ./...
fi
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Verify
run: |
make verify
- name: Cache dependencies
uses: actions/cache@v2
with:
# Cache
path: ~/go/pkg/mod
# Cache key
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-go-
- name: Integrate Test
run: |
chmod +x integrate_test.sh && ./integrate_test.sh
- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
else
go get -v -t -d ./...
fi
- name: Post Coverage
run: bash <(curl -s https://codecov.io/bash)
- name: License Check
run: |
go fmt ./... && [[ -z `git status -s` ]]
sh before_validate_license.sh
chmod u+x /tmp/tools/license/license-header-checker
/tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]]
- name: Hello world
run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }}
- name: Test
run: |
chmod u+x before_ut.sh && ./before_ut.sh
go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic
chmod +x integrate_test.sh && ./integrate_test.sh
# Because the contexts of push and PR are different, there are two Notify.
# Notifications are triggered only in the dubbogo/gost repository.
- name: DingTalk Message Notify only Push
uses: zcong1993/actions-ding@v3.0.1
# Whether job is successful or not, always () is always true.
if: |
always() &&
github.event_name == 'push' &&
github.repository == 'apache/dubbo-go'
with:
# DingDing bot token
dingToken: ${{ env.DING_TOKEN }}
secret: ${{ env.DING_SIGN }}
# Post Body to send
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "Github Actions",
"text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: ${{ github.ref }} \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.compare }})"
}
}
- name: Coverage
run: bash <(curl -s https://codecov.io/bash)
\ No newline at end of file
- name: DingTalk Message Notify only PR
uses: zcong1993/actions-ding@v3.0.1
if: |
always() &&
github.event_name == 'pull_request' &&
github.repository == 'dubbogo/gost'
with:
dingToken: ${{ env.DING_TOKEN }}
secret: ${{ env.DING_SIGN }}
body: |
{
"msgtype": "markdown",
"markdown": {
"title": "Github Actions",
"text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - pr_title: **${{ github.event.pull_request.title }}** \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: [${{ github.ref }}](${{ github.event.pull_request._links.html.href }}) \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.pull_request._links.html.href }})"
}
}
......@@ -36,3 +36,5 @@ config_center/apollo/mockDubbog.properties.json
# vim stuff
*~
.*.sw?
/license-header-checker-linux/
/license-header-checker-linux.zip
......@@ -16,15 +16,7 @@ install: true
# define ci-stage
script:
# license-check
- echo 'start license check'
- go fmt ./... && [[ -z `git status -s` ]]
- sh before_validate_license.sh
- chmod u+x /tmp/tools/license/license-header-checker
- /tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]]
# unit-test
- echo 'start unit-test'
- chmod u+x before_ut.sh && ./before_ut.sh
- go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic
- make verify
# integrate-test
- chmod +x integrate_test.sh && ./integrate_test.sh
......
# Release Notes
---
## 1.5.5
### New Features
- [Add Address notification batch mode](https://github.com/apache/dubbo-go/pull/741)
- [Add dubbo-gen stream support](https://github.com/apache/dubbo-go/pull/794)
- [Add Change verify to Makefile](https://github.com/apache/dubbo-go/pull/831)
- [Add more automatic components](https://github.com/apache/dubbo-go/pull/832)
- [Add grpc max message size config](https://github.com/apache/dubbo-go/pull/824)
### Enhancement
- [when it need local ip, it will get it every time. We can get local ip once, and reused it](https://github.com/apache/dubbo-go/pull/807)
- [enhance client's connectivity](https://github.com/apache/dubbo-go/pull/800)
- [Imp: get local ip once and reused it](https://github.com/apache/dubbo-go/pull/808)
- [Remove unmeaning logic](https://github.com/apache/dubbo-go/pull/855)
### Bugfixes
- [Fix: nacos registry can not get namespaceId](https://github.com/apache/dubbo-go/pull/778) [@peaman](https://github.com/peaman)
- [Fix: url encode](https://github.com/apache/dubbo-go/pull/802)
- [Fix: try to fix too many files open error](https://github.com/apache/dubbo-go/pull/797)
- [Fix: refact heartbeat](https://github.com/apache/dubbo-go/pull/889)
- [Fix: router_config add &url to url](https://github.com/apache/dubbo-go/pull/910)
- [Fix: Router chain can not build immediately when started](https://github.com/apache/dubbo-go/pull/927)
- [Fix: client block until timeout when provider return with PackageResponse_Exception](https://github.com/apache/dubbo-go/pull/926)
### Dependencies
- [Bump github.com/mitchellh/mapstructure from 1.2.3 to 1.3.3](https://github.com/apache/dubbo-go/pull/838)
- [Bump github.com/go-resty/resty/v2 from 2.1.0 to 2.3.0](https://github.com/apache/dubbo-go/pull/837)
- [Bump github.com/opentracing/opentracing-go from 1.1.0 to 1.2.0](https://github.com/apache/dubbo-go/pull/836)
- [Bump github.com/creasty/defaults from 1.3.0 to 1.5.1](https://github.com/apache/dubbo-go/pull/835)
- [Bump github.com/dubbogo/gost from 1.9.1 to 1.9.2](https://github.com/apache/dubbo-go/pull/834)
- [Bump github.com/zouyx/agollo/v3 from 3.4.4 to 3.4.5](https://github.com/apache/dubbo-go/pull/845)
- [Bump github.com/golang/mock from 1.3.1 to 1.4.4](https://github.com/apache/dubbo-go/pull/844)
- [Bump github.com/nacos-group/nacos-sdk-go from 1.0.0 to 1.0.1](https://github.com/apache/dubbo-go/pull/843)
- [Bump github.com/magiconair/properties from 1.8.1 to 1.8.4](https://github.com/apache/dubbo-go/pull/861)
- [Bump github.com/prometheus/client_golang from 1.1.0 to 1.8.0 ](https://github.com/apache/dubbo-go/pull/860)
- [Bump go.uber.org/atomic from 1.6.0 to 1.7.0](https://github.com/apache/dubbo-go/pull/859)
- [](https://github.com/apache/dubbo-go/pull/843)
Milestone: [https://github.com/apache/dubbo-go/milestone/5](https://github.com/apache/dubbo-go/milestone/5?closed=1)
## 1.4.5
### Bugfixes
- [Fix too many files open error](https://github.com/apache/dubbo-go/pull/828) [@wenxuwan](https://github.com/wenxuwan) Milestone: [https://github.com/apache/dubbo-go/milestone/6](https://github.com/apache/dubbo-go/milestone/6?closed=1)
## 1.5.4
### Bugfixes
- [Fix etcd cluster reconnect](https://github.com/apache/dubbo-go/pull/828)
- [Fix zookeeper deadlock problem](https://github.com/apache/dubbo-go/pull/826)
- [Fix generic struct2MapAll](https://github.com/apache/dubbo-go/pull/822)
- [Fix Consumer panic when restart provider](https://github.com/apache/dubbo-go/pull/803)
- [Fix etcd can not registry](https://github.com/apache/dubbo-go/pull/819) [@lin-jianjun](https://github.com/lin-jianjun)
- [Fix cannot call go provider service when used by java dubbo 2.7.7 version](https://github.com/apache/dubbo-go/pull/815) [@jack15083](https://github.com/jack15083)
- [Fix go client quit abnormally when it connects java server](https://github.com/apache/dubbo-go/pull/820) [@wenxuwan](https://github.com/wenxuwan)
- [Fix sentinel windows issue](https://github.com/apache/dubbo-go/pull/821) [@louyuting](https://github.com/louyuting)
- [Fix metadata default port](https://github.com/apache/dubbo-go/pull/821) [@sanxun0325](https://github.com/sanxun0325)
- [Fix consul can not destory](https://github.com/apache/dubbo-go/pull/788) [@LaurenceLiZhixin](https://github.com/LaurenceLiZhixin)
Milestone: [https://github.com/apache/dubbo-go/milestone/6](https://github.com/apache/dubbo-go/milestone/6?closed=1)
## 1.5.3
### New Features
- [Add consul service discovery](https://github.com/apache/dubbo-go/pull/701) [@zhangshen023](https://github.com/zhangshen023)
- [Add File system service discovery](https://github.com/apache/dubbo-go/pull/732) [@DogBaoBao](https://github.com/DogBaoBao)
- [Migrate travis Ci to Github Actions](https://github.com/apache/dubbo-go/pull/752) [@sdttttt](https://github.com/sdttttt)
- [Add sentinel-golang flow control/circuit breaker](https://github.com/apache/dubbo-go/pull/748) [@louyuting](https://github.com/louyuting)
- [Add dubbo-go docs and blog into doc directory](https://github.com/apache/dubbo-go/pull/767) [@oaoit](https://github.com/oaoit)
### Enhancement
- [Add address notification batch mode](https://github.com/apache/dubbo-go/pull/741) [@beiwei30](https://github.com/beiwei30)
- [Refactor network and codec model](https://github.com/apache/dubbo-go/pull/673) [@fangyincheng](https://github.com/fangyincheng) [@georgehao](https://github.com/georgehao)
- [Remove unnecessary return and judgement](https://github.com/apache/dubbo-go/pull/730) [@YongHaoWu](https://github.com/YongHaoWu)
- [Improve exporter append method](https://github.com/apache/dubbo-go/pull/722) [@gaoxinge](https://github.com/gaoxinge)
- [Refactor for proxyInvoker cannot be extended](https://github.com/apache/dubbo-go/pull/747) [@cvictory](https://github.com/cvictory)
- [Refactor attachment type from map\[string\]stiring to map\[string\]interface{}](https://github.com/apache/dubbo-go/pull/713) [@cvictory](https://github.com/cvictory)
- [Improve map access concurrency](https://github.com/apache/dubbo-go/pull/739) [@skyao](https://github.com/skyao)
- [Improve code quantity](https://github.com/apache/dubbo-go/pull/763) [@gaoxinge](https://github.com/gaoxinge)
### Bugfixes
- [Fix etcdv3 lease](https://github.com/apache/dubbo-go/pull/738) [@zhangshen023](https://github.com/zhangshen023)
- [Fix rename SethealthChecker to SetHealthChecker](https://github.com/apache/dubbo-go/pull/746) [@watermelo](https://github.com/watermelo)
- [Fix init config problem in HystrixFilter](https://github.com/apache/dubbo-go/pull/731) [@YGrylls](https://github.com/YGrylls)
- [Fix zookeeper listener report error after started](https://github.com/apache/dubbo-go/pull/735) [@wenxuwan](https://github.com/wenxuwan)
Milestone: [https://github.com/apache/dubbo-go/milestone/4](https://github.com/apache/dubbo-go/milestone/4?closed=1)
Project: [https://github.com/apache/dubbo-go/projects/10](https://github.com/apache/dubbo-go/projects/10)
## 1.5.4
......
Makefile 0 → 100644
#
# 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.
#
VERSION ?= latest
GO = go
GO_PATH = $(shell $(GO) env GOPATH)
GO_OS = $(shell $(GO) env GOOS)
ifeq ($(GO_OS), darwin)
GO_OS = mac
endif
GO_BUILD = $(GO) build
GO_GET = $(GO) get
GO_TEST = $(GO) test
GO_BUILD_FLAGS = -v
GO_BUILD_LDFLAGS = -X main.version=$(VERSION)
GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS)
GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker
LICENSE_DIR = /tmp/tools/license
ARCH = amd64
# for add zookeeper fatjar
ZK_TEST_LIST=config_center/zookeeper registry/zookeeper cluster/router/chain cluster/router/condition cluster/router/tag metadata/report/zookeeper
ZK_JAR_NAME=zookeeper-3.4.9-fatjar.jar
ZK_FATJAR_BASE=/zookeeper-4unittest/contrib/fatjar
ZK_JAR_PATH=remoting/zookeeper$(ZK_FATJAR_BASE)
ZK_JAR=$(ZK_JAR_PATH)/$(ZK_JAR_NAME)
SHELL = /bin/bash
prepareLic:
$(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.2.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && mkdir -p $(GO_PATH)/bin/ && cp $(GO_LICENSE_CHECKER_DIR)/64bit/license-header-checker $(GO_PATH)/bin/)
ls /tmp/tools/license/license.txt || wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt
prepareZk:
ls $(ZK_JAR) || (mkdir -p $(ZK_JAR_PATH)&& wget -P $(ZK_JAR_PATH) https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${ZK_JAR_NAME})
@for i in $(ZK_TEST_LIST); do \
mkdir -p $$i$(ZK_FATJAR_BASE);\
cp ${ZK_JAR} $$i$(ZK_FATJAR_BASE);\
done
prepare: prepareZk prepareLic
.PHONE: test
test: clean prepareZk
$(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic
deps: prepare
$(GO_GET) -v -t -d ./...
.PHONY: license
license: clean prepareLic
$(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]]
.PHONY: verify
verify: clean license test
.PHONY: clean
clean: prepare
rm -rf coverage.txt
rm -rf license-header-checker*
......@@ -16,6 +16,8 @@ Apache License, Version 2.0
## Release note ##
[v1.4.5 - Nov 18, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.5)
[v1.5.4 - Nov 1, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.4)
[v1.5.3 - Sep 23, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.3)
......@@ -24,15 +26,7 @@ Apache License, Version 2.0
[v1.5.1 - Aug 23, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.1)
[v1.5.0 - Jul 24, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.0)
[v1.4.4 - Aug 11, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.4)
[v1.4.3 - Jul 29, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.3)
[v1.4.2 - Jun 7, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.2)
[v1.4.1 - Apr 20, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.1)
[v1.5.0 - July 24, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.0)
[v1.4.0 - Mar 17, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.0)
......@@ -74,7 +68,7 @@ Finished List:
* Jsonrpc2.0
* [gRPC](https://github.com/apache/dubbo-go/pull/311)
* [RESTful](https://github.com/apache/dubbo-go/pull/352)
- Router
* [Condition router](https://github.com/apache/dubbo-go/pull/294)
* [Health check router](https://github.com/apache/dubbo-go/pull/389)
......@@ -119,7 +113,7 @@ Finished List:
- Invoke
* [generic invoke](https://github.com/apache/dubbo-go/pull/122)
- Monitor
* Opentracing API
* [Prometheus](https://github.com/apache/dubbo-go/pull/342)
......@@ -158,28 +152,26 @@ https://dubbogo.github.io/dubbo-go-website (**Improving**)
## Quick Start
[dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples) shows how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/dubbogo/dubbo-samples/blob/master/golang/README.md) carefully to learn how to dispose the configuration and compile the program.
[dubbo-go-samples](https://github.com/apache/dubbo-go-samples) shows how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/apache/dubbo-go-samples/blob/master/README.md) carefully to learn how to dispose the configuration and compile the program.
## Running unit tests
### Prepare
### Run
Mac/Linux
```bash
sh ./before_ut.sh
make verify
```
Windows
### Verify license
```bash
before_ut.bat
make license
```
### Run
```bash
go test ./...
### Run unit test
# coverage
go test ./... -coverprofile=coverage.txt -covermode=atomic
```bash
make test
```
## Build
......@@ -226,8 +218,49 @@ If you are using [apache/dubbo-go](github.com/apache/dubbo-go) and think that it
<img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://festatic.estudy.cn/assets/xhx-web/layout/logo.png">
</a>
</td>
</tr>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="http://www.j.cn" target="_blank">
<img width="222px" src="http://image.guang.j.cn/bbs/imgs/home/pc/icon_8500.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.genshuixue.com/" target="_blank">
<img width="222px" src="https://i.gsxcdn.com/0cms/d/file/content/2020/02/5e572137d7d94.png">
</a>
</td>
<td align="center" valign="middle">
<a href="http://www.51h5.com" target="_blank">
<img width="222px" src="https://fs-ews.51h5.com/common/hw_220_black.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.zto.com" target="_blank">
<img width="222px" src="https://fscdn.zto.com/fs8/M02/B2/E4/wKhBD1-8o52Ae3GnAAASU3r62ME040.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.icsoc.net/" target="_blank">
<img width="222px" src="https://oss.icsoc.net/icsoc-ekt-test-files/icsoc.png">
</a>
</td>
</tr>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="http://www.mgtv.com" target="_blank">
<img width="222px" src="https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png">
</a>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
......@@ -15,6 +15,8 @@ Apache License, Version 2.0
## 发布日志 ##
[v1.4.5 - 2020年11月18日](https://github.com/apache/dubbo-go/releases/tag/v1.4.5)
[v1.5.4 - 2020年11月1日](https://github.com/apache/dubbo-go/releases/tag/v1.5.4)
[v1.5.3 - 2020年9月23日](https://github.com/apache/dubbo-go/releases/tag/v1.5.3)
......@@ -25,14 +27,6 @@ Apache License, Version 2.0
[v1.5.0 - 2020年7月24日](https://github.com/apache/dubbo-go/releases/tag/v1.5.0)
[v1.4.4 - 2020年8月11日](https://github.com/apache/dubbo-go/releases/tag/v1.4.4)
[v1.4.3 - 2020年7月29日](https://github.com/apache/dubbo-go/releases/tag/v1.4.3)
[v1.4.2 - 2020年6月7日](https://github.com/apache/dubbo-go/releases/tag/v1.4.2)
[v1.4.1 - 2020年4月20日](https://github.com/apache/dubbo-go/releases/tag/v1.4.1)
[v1.4.0 - 2020年3月17日](https://github.com/apache/dubbo-go/releases/tag/v1.4.0)
[v1.3.0 - 2020年3月1日](https://github.com/apache/dubbo-go/releases/tag/v1.3.0)
......@@ -111,6 +105,7 @@ Apache License, Version 2.0
* [AccessLogFilter](https://github.com/apache/dubbo-go/pull/214)
* [TpsLimitFilter](https://github.com/apache/dubbo-go/pull/237)
* [ExecuteLimitFilter](https://github.com/apache/dubbo-go/pull/246)
* [GenericServiceFilter](https://github.com/apache/dubbo-go/pull/291)
* [Auth/Sign](https://github.com/apache/dubbo-go/pull/323)
* [Metrics filter](https://github.com/apache/dubbo-go/pull/342)
* [Tracing filter](https://github.com/apache/dubbo-go/pull/335)
......@@ -160,29 +155,27 @@ https://dubbogo.github.io/dubbo-go-website (**完善中**)
## 运行单测
### 准备
### 执行全部校验
Mac/Linux
```bash
sh ./before_ut.sh
make verify
```
Windows
### 校验许可证
```bash
before_ut.bat
make license
```
### 执行
```bash
go test ./...
### 执行单元测试
# coverage
go test ./... -coverprofile=coverage.txt -covermode=atomic
```bash
make test
```
## 编译
请移步 [dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples)
请移步 [dubbo-go-samples](https://github.com/apache/dubbo-go-samples)
## 如何贡献
......@@ -223,8 +216,49 @@ go test ./... -coverprofile=coverage.txt -covermode=atomic
<img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://festatic.estudy.cn/assets/xhx-web/layout/logo.png">
</a>
</td>
</tr>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="http://www.j.cn" target="_blank">
<img width="222px" src="http://image.guang.j.cn/bbs/imgs/home/pc/icon_8500.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.genshuixue.com/" target="_blank">
<img width="222px" src="https://i.gsxcdn.com/0cms/d/file/content/2020/02/5e572137d7d94.png">
</a>
</td>
<td align="center" valign="middle">
<a href="http://www.51h5.com" target="_blank">
<img width="222px" src="https://fs-ews.51h5.com/common/hw_220_black.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.zto.com" target="_blank">
<img width="222px" src="https://fscdn.zto.com/fs8/M02/B2/E4/wKhBD1-8o52Ae3GnAAASU3r62ME040.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.icsoc.net/" target="_blank">
<img width="222px" src="https://oss.icsoc.net/icsoc-ekt-test-files/icsoc.png">
</a>
</td>
</tr>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="http://www.mgtv.com" target="_blank">
<img width="222px" src="https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png">
</a>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
</div>
\ No newline at end of file
::
:: 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.
set zkJarName=zookeeper-3.4.9-fatjar.jar
set remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/%zkJarName%"
set zkJarPath=remoting/zookeeper/zookeeper-4unittest/contrib/fatjar
set zkJar=%zkJarPath%/%zkJarName%
if not exist "%zkJar%" (
md "%zkJarPath%"
curl -L %remoteJarUrl% -o %zkJar%
)
md config_center\zookeeper\zookeeper-4unittest\contrib\fatjar
xcopy /f "%zkJar%" "config_center/zookeeper/zookeeper-4unittest/contrib/fatjar/"
md registry\zookeeper\zookeeper-4unittest\contrib\fatjar
xcopy /f "%zkJar%" "registry/zookeeper/zookeeper-4unittest/contrib/fatjar/"
md cluster\router\chain\zookeeper-4unittest\contrib\fatjar
xcopy /f "%zkJar%" "cluster/router/chain/zookeeper-4unittest/contrib/fatjar/"
md cluster\router\condition\zookeeper-4unittest\contrib\fatjar
xcopy /f "%zkJar%" "cluster/router/condition/zookeeper-4unittest/contrib/fatjar/"
mkdir -p cluster/router/tag/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} cluster/router/tag/zookeeper-4unittest/contrib/fatjar
md metadata\report\zookeeper\zookeeper-4unittest\contrib\fatjar
xcopy /f "%zkJar%" "metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar/"
\ No newline at end of file
#
# 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.
zkJarName="zookeeper-3.4.9-fatjar.jar"
remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${zkJarName}"
zkJarPath="remoting/zookeeper/zookeeper-4unittest/contrib/fatjar"
zkJar="${zkJarPath}/${zkJarName}"
if [ ! -f "${zkJar}" ]; then
mkdir -p ${zkJarPath}
wget -P "${zkJarPath}" ${remoteJarUrl}
fi
mkdir -p config_center/zookeeper/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} config_center/zookeeper/zookeeper-4unittest/contrib/fatjar
mkdir -p registry/zookeeper/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} registry/zookeeper/zookeeper-4unittest/contrib/fatjar
mkdir -p cluster/router/chain/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} cluster/router/chain/zookeeper-4unittest/contrib/fatjar
mkdir -p cluster/router/condition/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} cluster/router/condition/zookeeper-4unittest/contrib/fatjar
mkdir -p cluster/router/tag/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} cluster/router/tag/zookeeper-4unittest/contrib/fatjar
mkdir -p metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar
cp ${zkJar} metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar
\ No newline at end of file
#
# 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.
remoteLicenseCheckerPath="https://github.com/dubbogo/resources/raw/master/tools/license"
remoteLicenseCheckerName="license-header-checker"
remoteLicenseCheckerURL="${remoteLicenseCheckerPath}/${remoteLicenseCheckerName}"
remoteLicenseName="license.txt"
remoteLicenseURL="${remoteLicenseCheckerPath}/${remoteLicenseName}"
licensePath="/tmp/tools/license"
mkdir -p ${licensePath}
wget -P "${licensePath}" ${remoteLicenseCheckerURL}
wget -P "${licensePath}" ${remoteLicenseURL}
......@@ -22,7 +22,6 @@ import (
)
import (
gxnet "github.com/dubbogo/gost/net"
perrors "github.com/pkg/errors"
"go.uber.org/atomic"
)
......@@ -32,6 +31,7 @@ import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
)
......@@ -51,7 +51,7 @@ func newBaseClusterInvoker(directory cluster.Directory) baseClusterInvoker {
}
}
func (invoker *baseClusterInvoker) GetUrl() common.URL {
func (invoker *baseClusterInvoker) GetUrl() *common.URL {
return invoker.directory.GetUrl()
}
......@@ -72,7 +72,7 @@ func (invoker *baseClusterInvoker) IsAvailable() bool {
//check invokers availables
func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, invocation protocol.Invocation) error {
if len(invokers) == 0 {
ip, _ := gxnet.GetLocalIP()
ip := common.GetLocalIp()
return perrors.Errorf("Failed to invoke the method %v. No provider available for the service %v from "+
"registry %v on the consumer %v using the dubbo version %v .Please check if the providers have been started and registered.",
invocation.MethodName(), invoker.directory.GetUrl().SubURL.Key(), invoker.directory.GetUrl().String(), ip, constant.Version)
......@@ -84,7 +84,7 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in
//check cluster invoker is destroyed or not
func (invoker *baseClusterInvoker) checkWhetherDestroyed() error {
if invoker.destroyed.Load() {
ip, _ := gxnet.GetLocalIP()
ip := common.GetLocalIp()
return perrors.Errorf("Rpc cluster invoker for %v on consumer %v use dubbo version %v is now destroyed! can not invoke any more. ",
invoker.directory.GetUrl().Service(), ip, constant.Version)
}
......@@ -120,6 +120,10 @@ func (invoker *baseClusterInvoker) doSelect(lb cluster.LoadBalance, invocation p
}
func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invocation protocol.Invocation, invokers []protocol.Invoker, invoked []protocol.Invoker) protocol.Invoker {
if len(invokers) == 0 {
logger.Errorf("the invokers of %s is nil. ", invocation.Invoker().GetUrl().ServiceKey())
return nil
}
if len(invokers) == 1 {
return invokers[0]
}
......@@ -134,6 +138,8 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc
for _, invoker := range invokers {
if !invoker.IsAvailable() {
logger.Infof("the invoker of %s is not available, maybe some network error happened or the server is shutdown.",
invoker.GetUrl().Ip)
continue
}
......@@ -145,6 +151,7 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc
if len(reslectInvokers) > 0 {
selectedInvoker = lb.Select(reslectInvokers, invocation)
} else {
logger.Errorf("all %d invokers is unavailable for %s.", len(invokers), selectedInvoker.GetUrl().String())
return nil
}
}
......
......@@ -24,12 +24,12 @@ import (
)
import (
gxnet "github.com/dubbogo/gost/net"
perrors "github.com/pkg/errors"
)
import (
"github.com/apache/dubbo-go/cluster"
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
......@@ -51,6 +51,7 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr
result protocol.Result
invoked []protocol.Invoker
providers []string
ivk protocol.Invoker
)
invokers := invoker.directory.List(invocation)
......@@ -75,7 +76,7 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr
return &protocol.RPCResult{Err: err}
}
}
ivk := invoker.doSelect(loadBalance, invocation, invokers, invoked)
ivk = invoker.doSelect(loadBalance, invocation, invokers, invoked)
if ivk == nil {
continue
}
......@@ -88,10 +89,17 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr
}
return result
}
ip, _ := gxnet.GetLocalIP()
ip := common.GetLocalIp()
invokerSvc := invoker.GetUrl().Service()
invokerUrl := invoker.directory.GetUrl()
if ivk == nil {
logger.Errorf("Failed to invoke the method %s of the service %s .No provider is available.", methodName, invokerSvc)
return &protocol.RPCResult{
Err: perrors.Errorf("Failed to invoke the method %s of the service %s .No provider is available because can't connect server.",
methodName, invokerSvc),
}
}
return &protocol.RPCResult{
Err: perrors.Wrap(result.Error(), fmt.Sprintf("Failed to invoke the method %v in the service %v. "+
"Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. "+
......
......@@ -45,7 +45,7 @@ import (
// nolint
type MockInvoker struct {
url common.URL
url *common.URL
available bool
destroyed bool
......@@ -53,7 +53,7 @@ type MockInvoker struct {
}
// nolint
func NewMockInvoker(url common.URL, successCount int) *MockInvoker {
func NewMockInvoker(url *common.URL, successCount int) *MockInvoker {
return &MockInvoker{
url: url,
available: true,
......@@ -63,7 +63,7 @@ func NewMockInvoker(url common.URL, successCount int) *MockInvoker {
}
// nolint
func (bi *MockInvoker) GetUrl() common.URL {
func (bi *MockInvoker) GetUrl() *common.URL {
return bi.url
}
......
......@@ -56,7 +56,7 @@ func (invoker *forkingClusterInvoker) Invoke(ctx context.Context, invocation pro
}
var selected []protocol.Invoker
forks := int(invoker.GetUrl().GetParamInt(constant.FORKS_KEY, constant.DEFAULT_FORKS))
forks := invoker.GetUrl().GetParamByIntValue(constant.FORKS_KEY, constant.DEFAULT_FORKS)
timeouts := invoker.GetUrl().GetParamInt(constant.TIMEOUT_KEY, constant.DEFAULT_TIMEOUT)
if forks < 0 || forks > len(invokers) {
selected = invokers
......
......@@ -65,8 +65,8 @@ func (dir *BaseDirectory) SetRouterChain(routerChain router.Chain) {
}
// GetUrl Get URL
func (dir *BaseDirectory) GetUrl() common.URL {
return *dir.url
func (dir *BaseDirectory) GetUrl() *common.URL {
return dir.url
}
// GetDirectoryUrl Get URL instance
......
......@@ -24,7 +24,6 @@ import (
)
import (
gxnet "github.com/dubbogo/gost/net"
"github.com/stretchr/testify/assert"
)
......@@ -41,21 +40,18 @@ var (
)
func TestNewBaseDirectory(t *testing.T) {
directory := NewBaseDirectory(&url)
assert.NotNil(t, directory)
assert.Equal(t, url, directory.GetUrl())
assert.Equal(t, &url, directory.GetDirectoryUrl())
dir := NewBaseDirectory(url)
assert.Equal(t, url, dir.GetUrl())
assert.Equal(t, url, dir.GetDirectoryUrl())
}
func TestBuildRouterChain(t *testing.T) {
regURL := url
regURL.AddParam(constant.INTERFACE_KEY, "mock-app")
directory := NewBaseDirectory(&regURL)
directory := NewBaseDirectory(regURL)
assert.NotNil(t, directory)
localIP, _ := gxnet.GetLocalIP()
localIP := common.GetLocalIp()
rule := base64.URLEncoding.EncodeToString([]byte("true => " + " host = " + localIP))
routeURL := getRouteURL(rule, anyURL)
routeURL.AddParam(constant.INTERFACE_KEY, "mock-app")
......@@ -67,19 +63,19 @@ func TestBuildRouterChain(t *testing.T) {
assert.NotNil(t, chain)
}
func getRouteURL(rule string, u common.URL) *common.URL {
func getRouteURL(rule string, u *common.URL) *common.URL {
ru := u
ru.AddParam("rule", rule)
ru.AddParam("force", "true")
ru.AddParam(constant.ROUTER_KEY, "router")
return &ru
return ru
}
func TestIsProperRouter(t *testing.T) {
regURL := url
regURL.AddParam(constant.APPLICATION_KEY, "mock-app")
d := NewBaseDirectory(&regURL)
localIP, _ := gxnet.GetLocalIP()
d := NewBaseDirectory(regURL)
localIP := common.GetLocalIp()
rule := base64.URLEncoding.EncodeToString([]byte("true => " + " host = " + localIP))
routeURL := getRouteURL(rule, anyURL)
routeURL.AddParam(constant.APPLICATION_KEY, "mock-app")
......@@ -88,7 +84,7 @@ func TestIsProperRouter(t *testing.T) {
regURL.AddParam(constant.APPLICATION_KEY, "")
regURL.AddParam(constant.INTERFACE_KEY, "com.foo.BarService")
d = NewBaseDirectory(&regURL)
d = NewBaseDirectory(regURL)
routeURL = getRouteURL(rule, anyURL)
routeURL.AddParam(constant.INTERFACE_KEY, "com.foo.BarService")
rst = d.isProperRouter(routeURL)
......@@ -96,14 +92,14 @@ func TestIsProperRouter(t *testing.T) {
regURL.AddParam(constant.APPLICATION_KEY, "")
regURL.AddParam(constant.INTERFACE_KEY, "")
d = NewBaseDirectory(&regURL)
d = NewBaseDirectory(regURL)
routeURL = getRouteURL(rule, anyURL)
rst = d.isProperRouter(routeURL)
assert.True(t, rst)
regURL.SetParam(constant.APPLICATION_KEY, "")
regURL.SetParam(constant.INTERFACE_KEY, "")
d = NewBaseDirectory(&regURL)
d = NewBaseDirectory(regURL)
routeURL = getRouteURL(rule, anyURL)
routeURL.AddParam(constant.APPLICATION_KEY, "mock-service")
rst = d.isProperRouter(routeURL)
......@@ -111,7 +107,7 @@ func TestIsProperRouter(t *testing.T) {
regURL.SetParam(constant.APPLICATION_KEY, "")
regURL.SetParam(constant.INTERFACE_KEY, "")
d = NewBaseDirectory(&regURL)
d = NewBaseDirectory(regURL)
routeURL = getRouteURL(rule, anyURL)
routeURL.AddParam(constant.INTERFACE_KEY, "mock-service")
rst = d.isProperRouter(routeURL)
......
......@@ -34,15 +34,18 @@ type staticDirectory struct {
// NewStaticDirectory Create a new staticDirectory with invokers
func NewStaticDirectory(invokers []protocol.Invoker) *staticDirectory {
var url common.URL
var url *common.URL
if len(invokers) > 0 {
url = invokers[0].GetUrl()
}
return &staticDirectory{
BaseDirectory: NewBaseDirectory(&url),
dir := &staticDirectory{
BaseDirectory: NewBaseDirectory(url),
invokers: invokers,
}
dir.routerChain.SetInvokers(invokers)
return dir
}
//for-loop invokers ,if all invokers is available ,then it means directory is available
......@@ -69,7 +72,7 @@ func (dir *staticDirectory) List(invocation protocol.Invocation) []protocol.Invo
return invokers
}
dirUrl := dir.GetUrl()
return routerChain.Route(invokers, &dirUrl, invocation)
return routerChain.Route(dirUrl, invocation)
}
// Destroy Destroy
......@@ -88,10 +91,11 @@ func (dir *staticDirectory) BuildRouterChain(invokers []protocol.Invoker) error
return perrors.Errorf("invokers == null")
}
url := invokers[0].GetUrl()
routerChain, e := chain.NewRouterChain(&url)
routerChain, e := chain.NewRouterChain(url)
if e != nil {
return e
}
routerChain.SetInvokers(dir.invokers)
dir.SetRouterChain(routerChain)
return nil
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment