This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git
The following commit(s) were added to refs/heads/master by this push: new 3b1fb59 SCB-142 translate developers pages (#20) 3b1fb59 is described below commit 3b1fb5948bb72336a955e67e0c7a7e323cf7a25d Author: Yang, Bo <oaky...@gmail.com> AuthorDate: Fri Dec 29 18:38:12 2017 +0800 SCB-142 translate developers pages (#20) SCB-142 translate developers pages --- _developers/setup-develop-environment.md | 63 +++++++++++++---------- _developers/submit-codes.md | 88 +++++++++++++++----------------- 2 files changed, 77 insertions(+), 74 deletions(-) diff --git a/_developers/setup-develop-environment.md b/_developers/setup-develop-environment.md index 70ada48..6e3a330 100644 --- a/_developers/setup-develop-environment.md +++ b/_developers/setup-develop-environment.md @@ -1,63 +1,70 @@ --- -title: "开发环境准备" +title: "Setup Developing Environment" lang: en ref: setup-develop-environment permalink: /developers/setup-develop-environment/ -excerpt: "开发环境准备" +excerpt: "setup developing environment" last_modified_at: 2017-06-24T18:48:43+08:00 --- -## 基本环境准备 -在您开始前,请确保以下应用已安装: -* **Git**,安装详情可参考[Git安装教程](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git){:target="_blank"} -* **JDK 1.8**,安装详情可参考[JDK安装教程](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html){:target="_blank"} -* **Maven 3.x**,安装详情可参考[Maven安装教程](https://maven.apache.org/install.html){:target="_blank"} -* **Docker**,安装详情可参考[Docker 安装教程](https://docs.docker.com/engine/installation/){:target="_blank"} -* **Service Center**, 安装详情可参考[Service Center安装教程](/users/setup-environment/#运行service-center) -* **IntelliJ Idea IDE**(可选,您可以使用其他心仪的IDE,如eclipse),安装详情可参考[IntelliJ安装教程](https://www.jetbrains.com/help/idea/installing-and-launching.html){:target="_blank"} +## Install required tools +Before you start, make sure you have the following tools installed: +* **Git**,please refer to [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git){:target="_blank"} +* **JDK 1.8**,please refer to [Install JDK](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html){:target="_blank"} +* **Maven 3.x**,please refer to [Install Maven](https://maven.apache.org/install.html){:target="_blank"} +* **Docker**,please refer to [Install Docker](https://docs.docker.com/engine/installation/){:target="_blank"} +* **Service Center**, please refer to [Install Service Center](/users/setup-environment/#运行service-center) +* **IntelliJ Idea IDE**(optional, you can use any IDE you like, e.g. eclipse), please refer to[Install IntelliJ](https://www.jetbrains.com/help/idea/installing-and-launching.html){:target="_blank"} -## Git配置 -1. 注册Github。由于ServiceComb的代码是托管在Github上的,所以您需要有一个Github的帐号,可前往 [https://github.com/join?source=header-home](https://github.com/join?source=header-home) 进行注册,如您已有Github帐号,则可跳过此步。注册完成后直接在 [https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home](https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home) 进行登录即可。 -2. 配置Git。主要配置Git的个人信息和设置免密码提交代码。个人信息可通过以下指令进行配置: +## Setup git +1. Get a Github account. The ServiceComb projects is hosted on Github, so you will need a Github account. You can goto [https://github.com/join?source=header-home](https://github.com/join?source=header-home) for signup. Skip this if you already own an Github account. You can login on [https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home](https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home) after you finished the signup. + +2. Configure Git. Configure personal information and setup git for push without username/password. + Configure personal information: ```bash git config --global user.name <your-user-name> git config --global user.email <your-email-address> ``` - 其中,请将\<your-user-name\>和\<your-email-address\>替换为您在Github上注册用到的用户名和邮箱信息。设置免密码提交代码可参考[Git免密码提交代码教程](https://stackoverflow.com/a/8588786){:target="_blank"}。 -3. 获取项目代码。以 [ServiceComb-Java-Chassis](https://github.com/apache/incubator-servicecomb-java-chassis.git) 项目为例,可直接执行以下指令获取代码: + Substitute \<your-user-name\>和\<your-email-address\> with your name and email. Refer[Git push without username and password](https://stackoverflow.com/a/8588786){:target="_blank"}to setup pushing without username/password. + +3. Get the source code. For example, to get [ServiceComb-Java-Chassis](https://github.com/apache/incubator-servicecomb-java-chassis.git), execute the following command: ```bash git clone https://github.com/apache/incubator-servicecomb-java-chassis.git ``` - -## IDE 环境配置 -现有支持Java开发的IDE很多,如Eclipse, IntelliJ IDEA和STS等。我们在此推荐使用IntelliJ IDEA,对于日常开发,其社区版的功能已经足够了。在安装完IntelliJ IDEA后,您可以根据[初始化设置教程](https://www.jetbrains.com/help/idea/installing-and-launching.html#d325787e291)对IntelliJ IDEA进行配置,随后可通过阅读[必备快捷键](https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html)了解常用的快捷键。 + +## Configure IDE +There are many Java IDEs around, like Eclipse, IntelliJ IDEA and STS, etc. We suggest to use IntelliJ IDEA, it's community edition is good enough for daily usage. After you installed IntelliJ IDEA, follow [Initial Setup](https://www.jetbrains.com/help/idea/installing-and-launching.html#d325787e291) for basic configuration. For frequently used shortcuts, [Cannot Miss Shortcuts](https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html) -Java Chassis和Saga项目使用了[Google Code Style](https://github.com/google/styleguide)作为代码风格,配置文件可以在本项目 `etc` 目录下找到。其中,目录中也有Eclipse的代码风格,读者可以直接导入使用。 +The Java Chassis and Saga project uses [Google Code Style](https://github.com/google/styleguide). You can find the settings file under `etc` directory which can be imported to IDEA. There is also a settings file for Eclipse under the same directory. ![code style files]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.3.png){: .align-center} {% include toc %} -### IntelliJ IDEA 配置 -[IntelliJ IDEA](https://www.jetbrains.com/idea/download/)的配置方法如下 +### IntelliJ IDEA Configuration +Configure [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) -1. 打开IntelliJ配置 +1. Open IntelliJ Settings page ![IntelliJ Settings]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.4.png){: .align-center} -1. Import 配置文件 `etc/intellij-java-google-style.xml` +2. Import the coding style settings file `etc/intellij-java-google-style.xml` ![import code style]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.1.png){: .align-center} -1. 打开已修改而未提交的文件,并打开格式化文件对话框 + +3. Open a modified but uncommited file, then Choose [Code] > [Show Reformat File Dialog] ![reformat file dialog]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.5.png){: .align-center} -1. 选择只格式化修改部分 +4. Choose [Only VCS changed text], then click [Run] ![reformat options]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.2.png){: .align-center} -配置完成后,后续按快捷键 (Ctrl+Alt+i) 格式化修改文件即可。更多关于IntelliJ的使用技巧可阅读[IntelliJ教程](https://www.jetbrains.com/help/idea/tutorials.html)。 -## 下一步 +Just run [Reformat code] (Ctrl+Alt+L) afterwards to format the code. + +For more IntelliJ usages, please check [IntelliJ tutorial](https://www.jetbrains.com/help/idea/tutorials.html)。 + +## Next -* 阅读[代码提交指南](/developers/submit-codes/) +* Read[Howto submit codes](/developers/submit-codes/) diff --git a/_developers/submit-codes.md b/_developers/submit-codes.md index 77b5b9d..ec1a5bd 100644 --- a/_developers/submit-codes.md +++ b/_developers/submit-codes.md @@ -1,55 +1,52 @@ --- -title: "代码提交指南" +title: "Howto Submit Code" lang: en ref: submit-codes permalink: /developers/submit-codes/ -excerpt: "介绍如何向 ServiceComb 项目提交代码" +excerpt: "Howto submit code for SerivceComb" last_modified_at: 2017-09-08T20:26:43-20:46 --- {% include toc %} -## 贡献途径 - ServiceComb正在不断成长中,也希望能找到更多志同道合的同伴一起成长和进步。向ServiceComb 贡献的途径有多种: -* 完善文档。完善网站上的文档或者项目中的介绍文档和API说明文档。其中,网站文档的完善可通过网站最底端的**报告本网页问题**或**在Github上编辑此页**对文档内容进行完善。 -* 实现功能特性需求或修复BUG。项目的功能特性需求或者已发现但未修复的BUG都会在项目中的issue处看到,以[Saga](https://github.com/apache/incubator-servicecomb-saga/issues)项目为例,一般都会带有类似 **enhancement** 或类似 **bug** 的标签来说明这是功能需求还是BUG,读者可以结合自己的兴趣点来选择。此外,您也可以通过日常使用或阅读代码时发现BUG并以Issue的方式进行描述并针对该BUG提交PR,帮助我们进一步改进。同时,也欢迎您提出需求并在实现后提交PR。 +## Contributing + ServiceComb is still growing and we hope that more will join us to share this. There are many ways to contribute: +* Improve documents. Help us improve the documents on this site or the API documentation. For the documents on this site, you can find links **Report a Doc Issue** or **Edit This Page on Github** to start. +* Implement feature request or fix bugs. You can find all the feature request and bug reports on the projects' issues pages. Take [Saga](https://github.com/apache/incubator-servicecomb-saga/issues) as an example, issues will be labeled as **enhancement** or **bug**, you can choose the ones you are interested in. Bug reports and new feature requests are also welcomed. - ![寻觅功能需求示例](/assets/images/find-features-by-example.png){: .align-center} + ![Find Features](/assets/images/find-features-by-example.png){: .align-center} -## 运行测试 - 在您提交代码前,请先按照项目README中说明的自动测试部分对代码的功能性和实现上的正确性进行验证。 +## Run tests + Before submitting code, make sure that you have properly tested the functionality and verified the implementation according to the auto test section in README. -## PR指南 - 在 [Github](https://github.com/search?q=org%3Aapache+servicecomb) 上面可以很方便地提交 [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/),下面将以本网站项目[apache/incubator-servicecomb-website](https://github.com/apache/incubator-servicecomb-website) 为例(如果是其他项目,请替换项目名incubator-servicecomb-website)。 +## How to submit a PR + It's quite convenient to submit a [Pull Request(PR)](https://help.github.com/articles/about-pull-requests/) on [Github](https://github.com/search?q=org%3Aapache+servicecomb). Take the [apache/incubator-servicecomb-website](https://github.com/apache/incubator-servicecomb-website) as an example: -### Fork仓库 +### Fork repository - 进入 apache/incubator-servicecomb-website 的 [github 页面](https://github.com/apache/incubator-servicecomb-website) ,点击右上角按钮 `Fork` 进行 Fork。 + Visit the apache/incubator-servicecomb-website project's [github page](https://github.com/apache/incubator-servicecomb-website), click `Fork` button on the right left cornor. -![体质指数应用运行界面](/assets/images/fork-repo.jpg){: .align-center} +![Fork Repository](/assets/images/fork-repo.jpg){: .align-center} -### 配置git和提交修改 +### Setup local repository -- 将代码克隆到本地: +- Clone the source code to local machine: ```shell git clone https://github.com/<your_github_name>/incubator-servicecomb-website.git ``` - 注意:请将 \<your\_github\_name\> 替换为您的github名字。 + Note: substitute \<your\_github\_name\> with your github username. + After the clone is done, the origin remote will point to the default branch of the cloned repository. - clone完成后,origin会默认指向github上的远程fork地址。 - -- 将 apache/incubator-servicecomb-website 添加为本地仓库的远程分支 upstream: +- Add apache/incubator-servicecomb-website as upstream remote: ```shell cd incubator-servicecomb-website git remote add upstream https://github.com/apache/incubator-servicecomb-website.git ``` - - -- 检查远程仓库设置: +- Check the local repository's remotes ```shell git remote -v @@ -59,65 +56,64 @@ last_modified_at: 2017-09-08T20:26:43-20:46 upstream https://github.com/apache/incubator-servicecomb-website.git (push) ``` - -- 新建分支以便在分支上做修改: +- Create a new branch to start working ```shell git checkout -b <your_branch_name> ``` + + Note: replace \<your\_branch\_name\> with an actual branch name at your choice, like feature-foo/bugfix-bar + Now you can start coding. - - 注意: \<your\_branch\_name\> 为您自定义的分支名字。 - - 创建完成后可进行代码更改。 - -- 提交代码到远程分支: +- Push the changes to a remote repository ```shell git commit -a -m "<you_commit_message>" git push origin <your_branch_name> ``` - 更多 git 使用方法请访问:[git 使用](https://www.atlassian.com/git/tutorials/setting-up-a-repository),这里不赘述。 + For more on git usages, please visit[Git tutorial](https://www.atlassian.com/git/tutorials/setting-up-a-repository). -### 创建PR +### Create PR + Goto your github page, find the apache/incubator-servicecomb-website project, swich to the branch you just pushed, click on `New pull request` and then `Create pull request`, see the image below: - 在浏览器切换到自己的 github 页面,切换分支到提交的分支 \<your\_branch\_name\> ,依次点击 `New pull request` 和 `Create pull request` 按钮进行创建,如下图所示: - -![体质指数应用运行界面](/assets/images/new-pr.jpg){: .align-center} +![New Pull Request](/assets/images/new-pr.jpg){: .align-center} fig-1 New pull request {: .figure-caption} -![体质指数应用运行界面](/assets/images/create-pr.jpg){: .align-center} +![Create Pull Request](/assets/images/create-pr.jpg){: .align-center} fig-2 Create pull request {: .figure-caption} - 至此,您的PR创建完成,更多关于 PR 请阅读 [collaborating-with-issues-and-pull-requests](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/) 。 + Congrautulations, now you have succesfully submitted a PR. For more on PR, please read [collaborating-with-issues-and-pull-requests](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/) 。 + +### Resolve conflicts + When a same piece of file is edited by multiple person simultaneously, conflicts can occur. It can be resolved as follow: -### 冲突解决 - 提交PR时的代码冲突一般是由于多人编辑同一个文件引起的,解决冲突主要通过以下步骤即可: -1. 切换至主分支 +1. Switch to the master branch ```bash git checkout master ``` -2. 同步远端主分支至本地 +2. Pull the upstream's master branch ```bash git pull upstream master ``` -3. 切换回刚才的分支(假设分支名为fix) +3. Switch back to the branch we are working on(e.g. fix) ```bash git checkout fix ``` -4. 进行rebase +4. Rebase the working branch onto the master branch ```bash git rebase -i master ``` - 此时会弹出修改记录的文件,一般直接保存即可。然后会提示哪些文件出现了冲突,此时可打开冲突文件对冲突部分进行修改,将提示的所有冲突文件的冲突都解决后,执行 + A list of commits will be listed on your text editor. Normally we can just save and exit. + Git will now apply the commits one by one onto the master branch until it encounters a conflict. When this happens, the rebase process is paused. We need to resolve the conflicts, then execute ```bash git add . git rebase --continue ``` - 依此往复,直至屏幕出现类似 *rebase successful* 字样即可,此时您可以进行往提交PR的分支进行更新: + Repeat this process until all commits are successfully applied. And finally run ```bash git push -f origin fix ``` + to push the resolved branch to remote origin -- To stop receiving notification emails like this one, please contact ['"commits@servicecomb.apache.org" <commits@servicecomb.apache.org>'].