Skip to content

Commit

Permalink
Merge branch 'naming-model-refactor' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigEditor/ConfigEditor.js
#	console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js
#	naming/src/main/java/com/alibaba/nacos/naming/misc/NetUtils.java
#	naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java
  • Loading branch information
nkorange committed Nov 16, 2018
2 parents 0f51707 + 57f2ae4 commit 93246b3
Show file tree
Hide file tree
Showing 55 changed files with 2,512 additions and 452 deletions.
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
90 changes: 69 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,79 @@
## How To Contribute
# Contributing to Nacos

We are always very happy to have contributions, whether for trivial cleanups or big new features.
We want to have high quality, well documented codes for each programming language.
Welcome to Nacos! This document is a guideline about how to contribute to Nacos.
If you find something incorrect or missing, please leave comments / suggestions.

Nor is code the only way to contribute to the project. We strongly value documentation, integration with other project, and gladly accept improvements for these aspects.
## Before you get started

## Contributing code
### Code of Conduct

To submit a change for inclusion, please do the following:
Please make sure to read and observe our [Code of Conduct](./CODE_OF_CONDUCT.md).

#### If the change is non-trivial please include some unit tests that cover the new functionality.
#### If you are introducing a completely new feature or API it is a good idea to start a wiki and get consensus on the basic design first.
#### It is our job to follow up on patches in a timely fashion. Nag us if we aren't doing our job (sometimes we drop things).

## Becoming a Committer
## Contributing

We are always interested in adding new contributors. What we look for are series of contributions, good taste and ongoing interest in the project. If you are interested in becoming a committer, please let one of the existing committers know and they can help you walk through the process.
We are always very happy to have contributions, whether for typo fix, bug fix or big new features.
Please do not ever hesitate to ask a question or send a pull request.

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


### Open or Pickup an issue / PR

We use [GitHub Issues](https://github.com/alibaba/Nacos/issues) and [Pull Requests](https://github.com/alibaba/Nacos/pulls) for trackers.

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.
Please follow the guideline message in the issue template.

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.

Now if you want to contribute, please follow the [contribution workflow](#github-workflow) and create a new pull request.

### Begin your contribution

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

Here is the workflow for contributors:

1. Fork to your own
2. Clone fork to 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)
6. Push your commits to your forked repository
7. Create a pull request.

When creating pull request:

1. Please follow [the pull request template](./.github/PULL_REQUEST_TEMPLATE.md).
2. Please make sure the PR has a corresponding issue.
3. If your PR contains large changes, e.g. component refactor or new components, please write detailed documents
about its design and usage.
4. Note that a single PR should not be too large. If heavy changes are required, it's better to separate the changes
to a few individual PRs.
5. After creating a PR, one or more reviewers will be assigned to the pull request.
6. 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.

### Code review guidance

Our PMC will rotate reviewing the code to make sure all the PR will be reviewed timely and by at least one committer before merge. If we aren't doing our job (sometimes we drop things). And as always, we welcome volunteers for code review.

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.
- Testability - 80% of the new code should be covered by unit test cases.
- Maintainability - Comply with our [PMD spec](style/codeStyle.xml), and 3-month-frequency update should be maintained at least.

Nowadays,we have several important contribution points:
#### Wiki & JavaDoc
#### Nacos Console
#### Nacos SDK(C++\.Net\Php\Python\Go\Node.js)

##### Prerequisite
If you want to contribute the above listing points, you must abide our some prerequisites:

###### Readability - API must have Javadoc,some very important methods also must have javadoc
###### Testability - 80% above unit test coverage about main process
###### Maintainability - Comply with our [PMD spec](style/codeStyle.xml), and at least 3 month update frequency
###### Deployability - We encourage you to deploy into [maven repository](http://search.maven.org/)
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ It is super easy to get started with your first project.

You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases).

Take release nacos-server-0.3.0.zip for example.
Take release nacos-server-0.4.0.zip for example.
```
unzip nacos-server-0.3.0.zip
unzip nacos-server-0.4.0.zip
cd nacos/bin
```

Expand Down Expand Up @@ -74,13 +74,12 @@ For more details, see [quick-start.](https://nacos.io/en-us/docs/quick-start.htm

You can view the full documentation from the [Nacos website](https://nacos.io/en-us/docs/what-is-nacos.html).

All the latest and long-term notice can also be found here from [Github notice issue](https://github.com/alibaba/nacos/labels/notice)

## Contributing

Contributors are welcome to join Nacos project.
## Contributing

- Contributing guide (constructing): describe general contributing procedure for Nacos project, such as issue submitting, milestone plan, etc.
- Developing guide (constructing): describe detailed developing procedure including how to fork, choosing correct branch, PR review procedure, etc.
Contributors are welcomed to join Nacos project. Please check [CONTRIBUTING](./CONTRIBUTING.md) about how to contribute to this project.

## Other Related Project Repositories

Expand All @@ -93,8 +92,11 @@ Contributors are welcome to join Nacos project.
* [Gitter](https://gitter.im/alibaba/nacos): Nacos's IM tool for community messaging, collaboration and discovery.
* [Twitter](https://twitter.com/nacos2): Follow along for latest nacos news on Twitter.
* [Weibo](https://weibo.com/u/6574374908): Follow along for latest nacos news on Weibo (Twitter of China version).
* [User Mail Group]([email protected]): Nacos usage general discussion.
* [Dev Mail Group]([email protected]): Nacos developer discussion (APIs, feature design, etc).
* [Commit Mail Group]([email protected]): Commits notice, very high frequency.
* [Nacos Segmentfault](https://segmentfault.com/t/nacos): Get latest notice and prompt help from Segmentfault.
* Email Group:
* [email protected]: Nacos usage general discussion.
* [email protected]: Nacos developer discussion (APIs, feature design, etc).
* [email protected]: Commits notice, very high frequency.
* Join us from wechat. Welcome words: Nacos.

![cwex](http://acm-public.oss-cn-hangzhou.aliyuncs.com/xuc.png)
4 changes: 2 additions & 2 deletions REPORTING-BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We might ask for further information to locate a bug. A duplicated bug report wi

# 如何提交错误报告

如果Nacos项目的任何部分存在问题或文档问题,请通过[opening an issue][Nacos-issue]告诉我们。我们非常认真地对待错误和错误,在产品面前没有不重要的问题。不过在创建错误报告之前,请检查是否存在报告相同问题的issues。
如果Nacos项目的任何部分存在问题或文档问题,请通过[opening an issue][Nacos-issue]告诉我们。我们非常认真地对待错误和缺陷,在产品面前没有不重要的问题。不过在创建错误报告之前,请检查是否存在报告相同问题的issues。

为了使错误报告准确且易于理解,请尝试创建以下错误报告:

Expand All @@ -36,4 +36,4 @@ We might ask for further information to locate a bug. A duplicated bug report wi
我们可能会要求您提供更多信息以查找错误。将关闭重复的错误报告。

[etcd-issue]:https://github.com/etcd-io/etcd/issues/new
[filing-good-bugs]:http://fantasai.inkedblade.net/style/talks/filing-good-bugs/
[filing-good-bugs]:http://fantasai.inkedblade.net/style/talks/filing-good-bugs/
3 changes: 1 addition & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.4.0</version>
<version>0.5.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -63,5 +63,4 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ public class PropertyKeyConst {
public final static String CONTEXT_PATH = "contextPath";
public final static String CLUSTER_NAME = "clusterName";
public final static String ENCODE = "encode";
public final static String NAMING_LOAD_CACHE_AT_START = "namingLoadCacheAtStart";

}
33 changes: 11 additions & 22 deletions api/src/main/java/com/alibaba/nacos/api/naming/pojo/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.nacos.api.common.Constants;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -58,14 +57,12 @@ public class Instance {
/**
* Cluster information of instance
*/
@JSONField(serialize = false)
private Cluster cluster = new Cluster();
private String clusterName;

/**
* Service information of instance
* Service name of instance
*/
@JSONField(serialize = false)
private Service service;
private String serviceName;

/**
* User extended attributes
Expand All @@ -80,14 +77,6 @@ public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}

public String serviceName() {
String[] infos = instanceId.split(Constants.NAMING_INSTANCE_ID_SPLITTER);
if (infos.length < Constants.NAMING_INSTANCE_ID_SEG_COUNT) {
return null;
}
return infos[Constants.NAMING_INSTANCE_ID_SEG_COUNT - 1];
}

public String getIp() {
return ip;
}
Expand Down Expand Up @@ -120,20 +109,20 @@ public void setHealthy(boolean healthy) {
this.healthy = healthy;
}

public Cluster getCluster() {
return cluster;
public String getClusterName() {
return clusterName;
}

public void setCluster(Cluster cluster) {
this.cluster = cluster;
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}

public Service getService() {
return service;
public String getServiceName() {
return serviceName;
}

public void setService(Service service) {
this.service = service;
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}

public Map<String, String> getMetadata() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Service {
private String app;

/**
* Service group which is meant to classify services into different sets.
* Service group is meant to classify services into different sets.
*/
private String group;

Expand All @@ -48,12 +48,12 @@ public class Service {
*/
private String healthCheckMode;

private Map<String, String> metadata = new HashMap<String, String>();

public Service(String name) {
this.name = name;
}

private Map<String, String> metadata = new HashMap<String, String>();

public String getName() {
return name;
}
Expand Down
25 changes: 24 additions & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.4.0</version>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -108,4 +108,27 @@
</dependency>

</dependencies>

<repositories>
<repository>
<id>central</id>
<url>http://mvnrepo.alibaba-inc.com/mvn/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://mvnrepo.alibaba-inc.com/mvn/repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
Loading

0 comments on commit 93246b3

Please sign in to comment.