Skip to content
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

docs: update contribution guide with new Golang version and coverage requirements #581

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ This guide will help you get started with Karpor development.

### Prerequisites

* Golang version 1.19+
* Golang version 1.22+

<details>
<summary>Installing Golang</summary>

1. Install go1.19+ from the [official website](https://go.dev/dl/). Extract the binary files and place them at a location, assuming it is located under the home directory `~/go/`, here is an example command, you should choose the correct binary file for your system.
1. Install go1.22+ from the [official website](https://go.dev/dl/). Extract the binary files and place them at a location, assuming it is located under the home directory `~/go/`, here is an example command, you should choose the correct binary file for your system.

```
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
tar xzf go1.20.2.linux-amd64.tar.gz
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz
tar xzf go1.22.5.linux-amd64.tar.gz
```

If you would like to maintain multiple versions of golang in your local development environment, you can download the package and extract it to a location, like `~/go/go1.19.1`, and then alter the path in the command below accordingly.
If you would like to maintain multiple versions of golang in your local development environment, you can download the package and extract it to a location, like `~/go/go1.22.1`, and then alter the path in the command below accordingly.

1. Set environment variables for Golang

Expand Down Expand Up @@ -160,7 +160,7 @@ Make sure your pull request title uses the same format as the commit message sub

Before merging, all testing CIs should pass:

- Coverage should not drop. Currently, the pull request coverage should be at least 70%.
- Coverage should not drop. Currently, the pull request coverage should be at least 60%.
- Karpor uses a **CLA** for the contributor agreement. It requires you to sign for every commit before merging the pull request.

## Updating Documentation and Website
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ title: 代码贡献指南

### 前提条件

* Golang 版本 1.19+
* Golang 版本 1.22+

<details>
<summary>安装 Golang</summary>

1. 从 [官方网站](https://go.dev/dl/) 安装 golang 1.19+。解压二进制文件并放置到某个位置,假设该位置是 home 目录下的 `~/go/`,下面是一个示例命令,你应当选择适合你系统的正确二进制文件。
1. 从 [官方网站](https://go.dev/dl/) 安装 golang 1.22+。解压二进制文件并放置到某个位置,假设该位置是 home 目录下的 `~/go/`,下面是一个示例命令,你应当选择适合你系统的正确二进制文件。

```
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
tar xzf go1.20.2.linux-amd64.tar.gz
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz
tar xzf go1.22.5.linux-amd64.tar.gz
```

如果你想在本地开发环境维护多个 golang 版本,你可以下载包并解压到某个位置,比如 `~/go/go1.19.1`,然后根据下面的命令相应地改变路径。
如果你想在本地开发环境维护多个 golang 版本,你可以下载包并解压到某个位置,比如 `~/go/go1.22.1`,然后根据下面的命令相应地改变路径。

1. 为 Golang 设置环境变量

Expand Down Expand Up @@ -160,7 +160,7 @@ Pull request 的标题将会成为合并后的 commit 信息的描述。

在合并之前,所有的测试 CI 都应该通过:

- 覆盖率不应该下降。当前,pull request 的覆盖率应当至少为 70%。
- 覆盖率不应该下降。当前,pull request 的覆盖率应当至少为 60%。
- Karpor 使用 **CLA** 作为贡献者协议。它要求你在第一次合并 pull request 之前签署。

## 更新文档和网站
Expand Down
Loading