Skip to content

Commit

Permalink
Merge pull request #8902 from alibaba/develop
Browse files Browse the repository at this point in the history
Upgrade 2.1.1
  • Loading branch information
KomachiSion authored Aug 8, 2022
2 parents b584531 + bf76143 commit 41859be
Show file tree
Hide file tree
Showing 438 changed files with 9,797 additions and 2,668 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ A clear and concise description of what the bug is.
**Expected behavior**
A clear and concise description of what you expected to happen.

**Acutally behavior**
**Actually behavior**
A clear and concise description of what you actually to happen.

**How to Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
4. See errors

**Desktop (please complete the following information):**
- OS: [e.g. Centos]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ jobs:
- name: Build with Maven
run: mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
- name: Test With Maven
run: mvn -Prelease-nacos clean test -DforkCount=0
run: mvn -Prelease-nacos clean test -DtrimStackTrace=false
- name: Codecov
uses: codecov/[email protected]
with:
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./plugin-default-impl/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,42 @@ Nacos welcome new participants of any role, including user, contributor, committ
![](http://acm-public.oss-cn-hangzhou.aliyuncs.com/contributor_definition.png)


We encourage new comers actively join in Nacos projects and involving from user role to committer role, and even PMC role. In order to accomplish this, new comers needs to actively contribute in Nacos project. The following paragraph introduce how to contribute in Nacos way.
We encourage newcomers actively joining in Nacos projects and involving from user roles to committer roles, and even PMC roles. In order to accomplish this, new comers needs to actively contribute in Nacos project. The following paragraph introduce how to contribute in Nacos way.

#### Open / pickup an issue for preparation

If you find a typo in document, find a bug in code, or want new features, or want to give suggestions, you can [open an issue on GitHub](https://github.com/alibaba/Nacos/issues/new) to report it.
If you find a typo in a document, find a bug in code or want new features, or want to give suggestions, you can [open an issue on GitHub](https://github.com/alibaba/Nacos/issues/new) to report it.

If you just want to contribute directly you can choose the issue below.

- [Contribution Welcome](https://github.com/alibaba/nacos/labels/contribution%20welcome): Heavily needed issue, but currently short of hand.

- [good first issue](https://github.com/alibaba/nacos/labels/good%20first%20issue): Good for newcomers, new comer can pickup one for warm-up.
- [good first issue](https://github.com/alibaba/nacos/labels/good%20first%20issue): Good for newcomers, newcomers can pick up one for warm-up.


We strongly value documentation and integration with other projects such as Spring Cloud, Kubernetes, Dubbo, etc. We are very glad to work on any issue for these aspects.

Please note that any PR must be associated with a valid issue. Otherwise the PR will be rejected.
Please note that any PR must be associated with a valid issue. Otherwise, the PR will be rejected.

#### Begin your contribute
#### Begin your contribution

Now if you want to contribute, please create a new pull request.

We use the `develop` branch as the development branch, which indicates that this is a unstable branch.
We use the `develop` branch as the development branch, which indicates that this is an unstable branch.

Further more, our branching model complies to [https://nvie.com/posts/a-successful-git-branching-model/](https://nvie.com/posts/a-successful-git-branching-model/). We strongly suggest new comers walk through the above article before creating PR.
Furthermore, our branching model complies with [https://nvie.com/posts/a-successful-git-branching-model/](https://nvie.com/posts/a-successful-git-branching-model/). We strongly suggest new comers walk through the above article before creating PR.

Now, if you are ready to create PR, here is the workflow for contributors:

1. Fork to your own

2. Clone fork to local repository
2. Clone fork to a local repository

3. Create a new branch and work on it

4. Keep your branch in sync

5. Commit your changes (make sure your commit message concise)
5. Commit your changes (make sure your commit message is concise)

6. Push your commits to your forked repository

Expand All @@ -73,7 +73,7 @@ When creating pull request:

6. After creating a PR, one or more reviewers will be assigned to the pull request.

7. Before merging a PR, squash any fix review feedback, typo, merged, and rebased sorts of commits. The final commit message should be clear and concise.
7. Before merging a PR, squash any fix review feedback, typo, merged and rebased sorts of commits. The final commit message should be clear and concise.


If your PR contains large changes, e.g. component refactor or new components, please write detailed documents about its design and usage.
Expand All @@ -86,7 +86,7 @@ Some principles:

- Readability - Important code should be well-documented. API should have Javadoc. Code style should be complied with the existing one.

- Elegance: New functions, classes or components should be well designed.
- Elegance: New functions, classes or components should be well-designed.

- Testability - 80% of the new code should be covered by unit test cases.

Expand All @@ -106,18 +106,18 @@ Generally speaking, contribute 8 non-trivial patches and get at least three diff
- ability to write good code (last but certainly not least)


A current committer nominates you by slacking the team on the Nacos issue with label "nomination"
A current committer nominates you by slacking the team on the Nacos issue with the label "nomination"

- your first and last name

- a link to your Git profile

- an explanation of why you should be a committer,

- Elaborate the top 3 PR and the associated issues the nominator has worked with you that can demonstrate your ability.
- Elaborate on the top 3 PR and the associated issues the nominator has worked with you that can demonstrate your ability.


Two other committer need to second your nomination. If no one objects in 5 working days (China), you're a committer. If anyone objects or wants more information, the committers discuss and usually come to a consensus (within the 5 working days). If issues cannot be resolved, there's a vote among current committers.
Two other committers need to second your nomination. If no one objects in 5 working days (China), you're a committer. If anyone objects or wants more information, the committers discuss and usually come to a consensus (within the 5 working days). If issues cannot be resolved, there's a vote among current committers.

![](http://acm-public.oss-cn-hangzhou.aliyuncs.com/nomination_process.png)

Expand Down
6 changes: 3 additions & 3 deletions REPORTING-BUGS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# How to Reporting bugs
# How to report bugs

If any part of the Nacos project has bugs or documentation mistakes, please let us know by [opening an issue][Nacos-issue]. We treat bugs and mistakes very seriously and believe no issue is too small, anyOne is implement. Before creating a bug report, please check that an issue reporting the same problem does not already exist.

To make the bug report accurate and easy to understand, please try to create bug reports that are:

- Specific. Include as much details as possible: which version, what environment, what configuration, etc. If the bug is related to running the Nacos server, please attach the Nacos log (the starting log with Nacos configuration is especially important).
- Specific. Include as many details as possible: which version, what environment, what configuration, etc. If the bug is related to running the Nacos server, please attach the Nacos log (the starting log with Nacos configuration is especially important).

- Reproducible. Include the steps to reproduce the problem. We understand some issues might be hard to reproduce, please includes the steps that might lead to the problem. If possible, please attach the affected Nacos data dir and stack strace to the bug report.

- Unique. Do not duplicate existing bug report.
- Unique. Do not duplicate the existing bug report.


It may be worthwhile to read [Elika Etemad’s article on filing good bug reports][filing-good-bugs] before creating a bug report.
Expand Down
5 changes: 5 additions & 0 deletions address/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 1999-2022 Alibaba Group Holding Ltd.
*
* Licensed 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.
*/

package com.alibaba.nacos.address.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
* nacos web security configuration.
* @author onewe
*/
@Configuration
@Order(99)
public class AddressServerSecurityConfiguration extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(requestMatcherRegistry -> requestMatcherRegistry.mvcMatchers("/nacos/v1/as/**").authenticated())
.csrf().disable().httpBasic();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.alibaba.nacos.naming.core.Service;
import com.alibaba.nacos.naming.core.ServiceManager;
import com.alibaba.nacos.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -48,14 +47,19 @@
@RequestMapping({AddressServerConstants.ADDRESS_SERVER_REQUEST_URL + "/nodes"})
public class AddressServerClusterController {

@Autowired
private ServiceManager serviceManager;
private final ServiceManager serviceManager;

@Autowired
private AddressServerManager addressServerManager;
private final AddressServerManager addressServerManager;

private final AddressServerGeneratorManager addressServerGeneratorManager;

public AddressServerClusterController(ServiceManager serviceManager, AddressServerManager addressServerManager,
AddressServerGeneratorManager addressServerGeneratorManager) {
this.serviceManager = serviceManager;
this.addressServerManager = addressServerManager;
this.addressServerGeneratorManager = addressServerGeneratorManager;
}

@Autowired
private AddressServerGeneratorManager addressServerGeneratorManager;

/**
* Create new cluster.
Expand Down Expand Up @@ -146,7 +150,7 @@ public ResponseEntity<String> deleteCluster(@RequestParam(required = false) Stri
List<Instance> instanceList = addressServerGeneratorManager
.generateInstancesByIps(serviceName, rawProductName, clusterName, ipArray);
serviceManager.removeInstance(Constants.DEFAULT_NAMESPACE_ID, serviceName, false,
instanceList.toArray(new Instance[instanceList.size()]));
instanceList.toArray(new Instance[0]));
} else {
responseEntity = ResponseEntity.status(HttpStatus.BAD_REQUEST).body(checkResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.alibaba.nacos.naming.core.Cluster;
import com.alibaba.nacos.naming.core.Service;
import com.alibaba.nacos.naming.core.ServiceManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -38,11 +37,15 @@
@RestController
public class ServerListController {

@Autowired
private ServiceManager serviceManager;
private final ServiceManager serviceManager;

@Autowired
private AddressServerGeneratorManager addressServerBuilderManager;
private final AddressServerGeneratorManager addressServerBuilderManager;

public ServerListController(ServiceManager serviceManager,
AddressServerGeneratorManager addressServerBuilderManager) {
this.serviceManager = serviceManager;
this.addressServerBuilderManager = addressServerBuilderManager;
}

/**
* Get cluster.
Expand Down
Loading

0 comments on commit 41859be

Please sign in to comment.