Skip to content

Commit 76b0117

Browse files
authored
Merge pull request #265 from XiaoMi/github-master
Gaea 2.4.2 Synchronization
2 parents de11b22 + 9c02296 commit 76b0117

File tree

384 files changed

+39422
-10170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+39422
-10170
lines changed

.github/workflows/auto-comment.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Auto Comment
21+
22+
on:
23+
issues:
24+
types: [opened] # 触发条件:当问题被创建时
25+
pull_request:
26+
types: [opened] # 触发条件:当拉取请求被创建时
27+
28+
permissions:
29+
issues: write # 允许写入问题
30+
pull-requests: write # 允许写入拉取请求
31+
32+
jobs:
33+
comment:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Comment on issue
37+
uses: actions/github-script@v4
38+
with:
39+
script: |
40+
const issueOpened = "Thank you for raising an issue. We will try and get back to you as soon as possible. Please make sure you have given us as much context as possible.";
41+
const pullRequestOpened = "Thank you for raising your pull request. Please make sure you have followed our contributing guidelines. We will review it as soon as possible.";
42+
43+
if (context.payload.action === 'opened') {
44+
const issueComment = context.payload.issue ? issueOpened : pullRequestOpened;
45+
await github.issues.createComment({
46+
...context.repo,
47+
issue_number: context.payload.issue ? context.payload.issue.number : context.payload.pull_request.number,
48+
body: issueComment
49+
});
50+
}

.github/workflows/go.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
code_check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.16'
19+
20+
- name: Run code check
21+
run: |
22+
# 执行所有检查
23+
for check in EOF spelling; do
24+
./hack/verify-$check.sh
25+
done
26+
27+
parser_build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Set up Go
33+
uses: actions/setup-go@v4
34+
with:
35+
go-version: '1.16'
36+
37+
- name: Build parser
38+
run: |
39+
cd parser && make
40+
41+
unit_tests:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v4
48+
with:
49+
go-version: '1.16'
50+
51+
- name: Set timezone
52+
run: |
53+
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
54+
ls -l /etc/localtime
55+
56+
- name: Run unit tests
57+
run: |
58+
make test
59+
echo "sql parser test"
60+
cd parser && make test
61+
62+
build:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v3
66+
67+
- name: Set up Go
68+
uses: actions/setup-go@v4
69+
with:
70+
go-version: '1.16'
71+
72+
- name: Build the project
73+
run: |
74+
make build
75+
76+
e2e_test_mysql5:
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v3
81+
82+
- name: Pull Docker image
83+
run: |
84+
docker pull fieelina/gaea-test-amd64:v2.4 # 确认这个镜像是可用的
85+
86+
- name: Run Mysql5 E2E tests
87+
run: |
88+
docker run --rm \
89+
-v $(pwd):/workspace \
90+
-w /workspace \
91+
fieelina/gaea-test-amd64:v2.4 \
92+
make e2e-test
93+
94+
e2e_test_mysql8:
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- uses: actions/checkout@v3
99+
100+
- name: Pull Docker image
101+
run: |
102+
docker pull fieelina/gaea-test-amd64-mysql8:v2.4 # 确认这个镜像是可用的
103+
104+
- name: Run Mysql8 E2E tests
105+
run: |
106+
docker run --rm \
107+
-v $(pwd):/workspace \
108+
-w /workspace \
109+
fieelina/gaea-test-amd64-mysql8:v2.4 \
110+
make e2e-test-mysql8

.github/workflows/linelint.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Linelint
21+
22+
on:
23+
push:
24+
pull_request:
25+
26+
jobs:
27+
linelint:
28+
runs-on: ubuntu-latest
29+
name: Check if all files end in newline
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v3
34+
35+
- name: Run Linelint
36+
uses: fernandrone/[email protected]

.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ bin
44
logs
55
.coverage.*
66
.vscode
7-
.idea
7+
.idea
8+
tests/e2e/cmd/logs
9+
tests/e2e/cmd/gaea
10+
tests/e2e/cmd/gaea-cc
11+
.DS_Store
12+
.integrate_coverage.func
13+
.integrate_coverage.html
14+
.integrate_coverage.out
15+
.coverage.*

.gitlab/merge_request_templates/mr.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
### What problem does this PR solve?
2+
3+
Issue Number: None
4+
5+
Problem Summary:
6+
7+
### What is changed and how it works?
8+
9+
### Check List
10+
11+
- [ ] Unit test
12+
- [ ] Integration test
13+
- [ ] Manual test (add detailed scripts or steps below)
14+
- [ ] No code
15+
16+
Side effects
17+
18+
- [ ] Breaking backward compatibility
19+
- [ ] Config file changes
20+
21+
Documentation
22+
23+
- [ ] Affects user behaviors
24+
- [ ] Contains syntax changes
25+
- [ ] Contains variable changes
26+
- [ ] Changes MySQL compatibility
27+
28+
### Release note
29+
30+
```release-note
31+
None
32+
```

.linelint.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 'true' will fix files
2+
autofix: false
3+
4+
# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
5+
ignore:
6+
- tests/e2e/shard/case/join/mycat/long/unsupport.sql
7+
- tests/e2e/shard/case/join/mycat/mod/unsupport.sql
8+
- tests/e2e/shard/case/join/mycat/murmur/unsupport.sql
9+
- tests/e2e/shard/case/join/mycat/string/unsupport.sql
10+
rules:
11+
# checks if file ends in a newline character
12+
end-of-file:
13+
# set to true to enable this rule
14+
enable: true
15+
16+
# set to true to disable autofix (if enabled globally)
17+
disable-autofix: false
18+
19+
# if true also checks if file ends in a single newline character
20+
single-new-line: true

0 commit comments

Comments
 (0)