Skip to content

Commit ae6d598

Browse files
committed
docs:add license checker.
1 parent f25064c commit ae6d598

File tree

5 files changed

+53
-4
lines changed

5 files changed

+53
-4
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: License checker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release*
8+
pull_request:
9+
branches:
10+
- main
11+
- release*
12+
jobs:
13+
check-license:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout codes
17+
uses: actions/checkout@v4
18+
- name: Check License Header
19+
uses: apache/[email protected]

.licenserc.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
header:
2+
license:
3+
content: |
4+
Tencent is pleased to support the open source community by making Polaris available.
5+
6+
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
7+
8+
Licensed under the BSD 3-Clause License (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
https://opensource.org/licenses/BSD-3-Clause
13+
14+
Unless required by applicable law or agreed to in writing, software distributed
15+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
16+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations under the License.
18+
paths:
19+
- "**/tencent/**"
20+
language:
21+
Java:
22+
extensions:
23+
- ".java"

polaris-distribution/polaris-all/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55

66
<parent>
77
<artifactId>polaris-parent</artifactId>
@@ -24,6 +24,12 @@
2424
<version>${project.version}</version>
2525
<scope>compile</scope>
2626
</dependency>
27+
<dependency>
28+
<groupId>com.tencent.polaris</groupId>
29+
<artifactId>polaris-test-common</artifactId>
30+
<version>${project.version}</version>
31+
<scope>compile</scope>
32+
</dependency>
2733
<dependency>
2834
<groupId>com.tencent.polaris</groupId>
2935
<artifactId>polaris-test-mock-discovery</artifactId>

polaris-plugins/polaris-plugins-router/router-nearby/src/main/java/com/tencent/polaris/plugins/router/nearby/NearbyRouter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ public RouteResult router(RouteInfo routeInfo, ServiceInstances serviceInstances
156156
String.format("can not find any instance by level %s", minLevel.name()));
157157
}
158158
//已经循环了一圈
159-
return new RouteResult(selectInstances(
160-
serviceInstances, minAvailableLevel, clientLocationInfo), RouteResult.State.Next);
159+
return new RouteResult(instances, RouteResult.State.Next);
161160
}
162161
CheckResult checkResult = new CheckResult();
163162
for (int i = minLevel.ordinal(); i <= maxLevel.ordinal(); i++) {

polaris-plugins/polaris-plugins-router/router-rule/src/main/java/com/tencent/polaris/plugins/router/rule/RuleBasedRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ private boolean matchSource(List<RoutingProto.Source> sources, Service sourceSer
141141
matched = false;
142142
continue;
143143
}
144+
// 如果服务名不等于“*”,且服务名规则以“!”开头,则使用取反匹配
144145
if (!RuleUtils.MATCH_ALL.equals(service) && StringUtils.startsWith(service, "!")) {
145146
String realService = StringUtils.substring(service, 1);
146147
if (StringUtils.equals(realService, sourceService.getService())) {
147148
matched = false;
148149
continue;
149150
}
150151
}
152+
// 如果服务名不等于“*”,且服务名规则以“*”开头,则使用正则匹配
151153
if (!RuleUtils.MATCH_ALL.equals(service) && StringUtils.startsWith(service, "*")) {
152154
String regex = StringUtils.substring(service, 1);
153155
Pattern pattern = Pattern.compile(regex);

0 commit comments

Comments
 (0)