Skip to content

docs:add license checker. #573

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 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: License checker

on:
push:
branches:
- main
- release*
pull_request:
branches:
- main
- release*
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Check License Header
uses: apache/skywalking-eyes@v0.4.0
23 changes: 23 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
header:
license:
content: |
Tencent is pleased to support the open source community by making Polaris available.

Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.

Licensed under the BSD 3-Clause License (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://opensource.org/licenses/BSD-3-Clause

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:
- "**/tencent/**"
language:
Java:
extensions:
- ".java"
10 changes: 8 additions & 2 deletions polaris-distribution/polaris-all/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<artifactId>polaris-parent</artifactId>
Expand All @@ -24,6 +24,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-test-common</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-test-mock-discovery</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public RouteResult router(RouteInfo routeInfo, ServiceInstances serviceInstances
String.format("can not find any instance by level %s", minLevel.name()));
}
//已经循环了一圈
return new RouteResult(selectInstances(
serviceInstances, minAvailableLevel, clientLocationInfo), RouteResult.State.Next);
return new RouteResult(instances, RouteResult.State.Next);
}
CheckResult checkResult = new CheckResult();
for (int i = minLevel.ordinal(); i <= maxLevel.ordinal(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,15 @@ private boolean matchSource(List<RoutingProto.Source> sources, Service sourceSer
matched = false;
continue;
}
// 如果服务名不等于“*”,且服务名规则以“!”开头,则使用取反匹配
if (!RuleUtils.MATCH_ALL.equals(service) && StringUtils.startsWith(service, "!")) {
String realService = StringUtils.substring(service, 1);
if (StringUtils.equals(realService, sourceService.getService())) {
matched = false;
continue;
}
}
// 如果服务名不等于“*”,且服务名规则以“*”开头,则使用正则匹配
if (!RuleUtils.MATCH_ALL.equals(service) && StringUtils.startsWith(service, "*")) {
String regex = StringUtils.substring(service, 1);
Pattern pattern = Pattern.compile(regex);
Expand Down
Loading