Skip to content

Commit 534a94a

Browse files
authored
Merge branch 'main' into pmm-7-enable-tests
2 parents 13bed14 + 4d0ad7e commit 534a94a

File tree

488 files changed

+24703
-6433
lines changed

Some content is hidden

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

488 files changed

+24703
-6433
lines changed

.devcontainer/setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def setup():
8989
# Having fsync off in dev environment is fine.
9090
"sed -i -e \"s/#fsync = on/fsync = off/\" /srv/postgres14/postgresql.conf",
9191
"echo 'host all all 0.0.0.0/0 trust' >> /srv/postgres14/pg_hba.conf",
92-
"supervisorctl restart postgresql",
92+
# "supervisorctl restart postgresql",
9393
])
9494

9595

@@ -99,8 +99,7 @@ def main():
9999
make_init()
100100

101101
# do basic setup
102-
# TODO: fix the setup and revert
103-
# setup()
102+
setup()
104103

105104

106105
MARKER = "/tmp/devcontainer-setup-done"

.github/CODEOWNERS

-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
* @percona/pmm-review-be
22
/agent/agents/postgres/ @JiriCtvrtka @percona/pmm-review-be
3-
/agent/runner/ @artemgavrilov @percona/pmm-review-be
43
/api/ @BupycHuk @percona/pmm-review-be
54
/managed/services/checks/ @idoqo @percona/pmm-review-be
6-
/managed/services/dbaas @gen1us2k @recharte @percona/pmm-review-be
7-
/managed/services/management/dbaas @gen1us2k @recharte @percona/pmm-review-be
85
/update/ @BupycHuk @talhabinrizwan @percona/pmm-review-be
96
**/go.mod @percona/pmm-review-dependency @percona/pmm-review-be
107
**/Dockerfile @percona/pmm-review-dependency @percona/pmm-review-be
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Admin and maintenance task
3+
about: Template for admin and maintenance task
4+
title: "[Maintenance]"
5+
labels: maintenance
6+
assignees: ''
7+
8+
---
9+
10+
* What should be done:
11+
12+
13+
14+
* Benefit:
15+
16+
17+
18+
* Suggested implementation:
19+
20+
21+
22+
* Details:

.github/ISSUE_TEMPLATE/bug.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: File a bug report
33
labels: ["bug", "triage"]
44
assignees:
55
- BupycHuk
6-
- artemgavrilov
76
body:
87
- type: markdown
98
attributes:

.github/ISSUE_TEMPLATE/feature.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: Suggest an idea for this project
33
labels: ["feature", "triage"]
44
assignees:
55
- BupycHuk
6-
- artemgavrilov
76
body:
87
- type: markdown
98
attributes:

.github/workflows/admin.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
uses: actions/checkout@v4
3535

3636
- name: Set up Go release
37-
uses: actions/setup-go@v4
37+
uses: actions/setup-go@v5
3838
with:
3939
go-version-file: ${{ github.workspace }}/go.mod
4040
cache: false
4141

4242
- name: Enable Go build cache
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ~/.cache/go-build
4646
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
@@ -49,7 +49,7 @@ jobs:
4949
${{ runner.os }}-go-build-
5050
5151
- name: Enable Go modules cache
52-
uses: actions/cache@v3
52+
uses: actions/cache@v4
5353
with:
5454
path: ~/go/pkg/mod
5555
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
@@ -98,13 +98,13 @@ jobs:
9898
uses: actions/checkout@v4
9999

100100
- name: Set up Go release
101-
uses: actions/setup-go@v4
101+
uses: actions/setup-go@v5
102102
with:
103103
go-version-file: ${{ github.workspace }}/go.mod
104104
cache: false
105105

106106
- name: Enable Go build cache
107-
uses: actions/cache@v3
107+
uses: actions/cache@v4
108108
with:
109109
path: ~/.cache/go-build
110110
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
@@ -113,7 +113,7 @@ jobs:
113113
${{ runner.os }}-go-build-
114114
115115
- name: Enable Go modules cache
116-
uses: actions/cache@v3
116+
uses: actions/cache@v4
117117
with:
118118
path: ~/go/pkg/mod
119119
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
@@ -153,7 +153,7 @@ jobs:
153153

154154
- name: Attach the report on failure
155155
if: failure()
156-
uses: actions/upload-artifact@v3
156+
uses: actions/upload-artifact@v4
157157
with:
158158
name: "report-${{ matrix.go-version }}-${{ matrix.test-type }}"
159159
path: ${{ github.workspace }}/cli-tests/playwright-report/

.github/workflows/agent.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ jobs:
6666
uses: actions/checkout@v4
6767

6868
- name: Set up Go release
69-
uses: actions/setup-go@v4
69+
uses: actions/setup-go@v5
7070
with:
7171
go-version-file: ${{ github.workspace }}/go.mod
7272
cache: false
7373

7474
- name: Enable Go build cache
75-
uses: actions/cache@v3
75+
uses: actions/cache@v4
7676
with:
7777
path: ~/.cache/go-build
7878
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
@@ -81,7 +81,7 @@ jobs:
8181
${{ runner.os }}-go-build-
8282
8383
- name: Enable Go modules cache
84-
uses: actions/cache@v3
84+
uses: actions/cache@v4
8585
with:
8686
path: ~/go/pkg/mod
8787
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}

.github/workflows/api-tests.yml

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: 'API'
2+
3+
on:
4+
# NOTE: no action on `push` and `pull_request` since the API tests need to be run
5+
# against a container that has the latest changes from your code. Therefore, the
6+
# PMM_SERVER_IMAGE should either be the one from your feature build or the local
7+
# devcontainer. One more scenario is when we want to run the API tests on dev-latest
8+
# to see if the tests are in a good shape.
9+
# That said, this workflow is mostly a convenience if you prefer Github to Jenkins.
10+
# https://github.com/Percona-Lab/jenkins-pipelines/blob/master/pmm/pmm2-api-tests.groovy
11+
12+
workflow_dispatch:
13+
inputs:
14+
MYSQL_IMAGE:
15+
description: "MYSQL image version"
16+
default: "percona:5.7"
17+
required: true
18+
type: string
19+
POSTGRESQL_IMAGE:
20+
description: "POSTGRESQL image version"
21+
default: "postgres:12"
22+
required: true
23+
type: string
24+
MONGODB_IMAGE:
25+
description: "MONGODB image version"
26+
default: "percona/percona-server-mongodb:4.4"
27+
required: true
28+
type: string
29+
PMM_SERVER_IMAGE:
30+
description: "PMM Server image version"
31+
default: "perconalab/pmm-server:dev-latest"
32+
required: true
33+
type: string
34+
35+
workflow_call:
36+
inputs:
37+
BRANCH:
38+
description: "The branch to source API tests from"
39+
default: "main"
40+
required: true
41+
type: string
42+
MYSQL_IMAGE:
43+
description: "MYSQL image version"
44+
default: "percona:5.7"
45+
required: true
46+
type: string
47+
POSTGRESQL_IMAGE:
48+
description: "POSTGRESQL image version"
49+
default: "postgres:12"
50+
required: true
51+
type: string
52+
MONGODB_IMAGE:
53+
description: "MONGODB image version"
54+
default: "percona/percona-server-mongodb:4.4"
55+
required: true
56+
type: string
57+
PMM_SERVER_IMAGE:
58+
description: "PMM Server image version"
59+
default: "perconalab/pmm-server:dev-latest"
60+
required: true
61+
type: string
62+
63+
jobs:
64+
test:
65+
name: Tests
66+
runs-on: ubuntu-22.04
67+
env:
68+
PMM_URL: http://admin:admin@127.0.0.1
69+
BRANCH: ${{ github.event.inputs.BRANCH || 'main' }}
70+
MYSQL_IMAGE: ${{ github.event.inputs.MYSQL_IMAGE || 'percona:5.7' }}
71+
POSTGRESQL_IMAGE: ${{ github.event.inputs.POSTGRESQL_IMAGE || 'postgres:12' }}
72+
MONGODB_IMAGE: ${{ github.event.inputs.MONGODB_IMAGE || 'percona/percona-server-mongodb:4.4' }}
73+
PMM_SERVER_IMAGE: ${{ github.event.inputs.PMM_SERVER_IMAGE || 'perconalab/pmm-server:dev-latest' }}
74+
75+
steps:
76+
- name: Check out code
77+
uses: actions/checkout@v4
78+
with:
79+
ref: ${{ env.BRANCH }}
80+
81+
- name: Login to docker.io registry
82+
uses: docker/login-action@v3
83+
with:
84+
registry: docker.io
85+
username: ${{ secrets.DOCKERHUB_USERNAME }}
86+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
87+
88+
- name: Run PMM Server
89+
run: |
90+
cat <<-EOF > compose.pmm-server-test.yml
91+
services:
92+
pmm-server:
93+
image: ${{ env.PMM_SERVER_IMAGE }}
94+
container_name: pmm-agent_pmm-server
95+
environment:
96+
- PMM_DEBUG=1
97+
- PERCONA_TEST_CHECKS_INTERVAL=10s
98+
- PERCONA_TEST_PLATFORM_ADDRESS=https://check-dev.percona.com
99+
- PERCONA_TEST_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
100+
ports:
101+
- 80:80
102+
- 443:443
103+
volumes:
104+
- ./managed/testdata/checks:/srv/checks
105+
EOF
106+
107+
# Run it and wait until it's healthy
108+
docker compose -f compose.pmm-server-test.yml up -d --wait --wait-timeout=100
109+
110+
- name: Build the test image
111+
shell: bash
112+
run: |
113+
docker build -t percona/pmm-api-tests .
114+
115+
- name: Run DB containers
116+
shell: bash
117+
run: |
118+
pushd api-tests
119+
docker compose up test_db # no daemon mode
120+
# TODO: review the provisions below (copied from the Jenkins pipeline)
121+
# MYSQL_IMAGE=${{env.MYSQL_IMAGE}} docker compose up -d mysql
122+
# MONGO_IMAGE=${{env.MONGODB_IMAGE}} docker compose up -d mongo
123+
# POSTGRES_IMAGE=${{env.POSTGRESQL_IMAGE}} docker compose up -d postgres
124+
# docker compose up -d sysbench
125+
popd
126+
127+
- name: Check connectivity to PMM Server
128+
shell: bash
129+
run: curl -f ${{env.PMM_URL}}/ping
130+
131+
- name: Run API tests
132+
shell: bash
133+
run: |
134+
docker run -e PMM_SERVER_URL=${{env.PMM_URL}} \
135+
-e PMM_RUN_UPDATE_TEST=0 \
136+
-e PMM_RUN_STT_TESTS=0 \
137+
--name pmm-api-tests \
138+
--network host \
139+
percona/pmm-api-tests
140+
141+
- name: Get PMM logs
142+
if: ${{ failure() }}
143+
run: curl --insecure ${{env.PMM_URL}}/logs.zip --output ${{ github.workspace }}/logs.zip || true
144+
145+
- name: Upload the logs on failure
146+
if: ${{ failure() }}
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: "logs.zip"
150+
path: ${{ github.workspace }}/logs.zip
151+
152+
- name: Run debug commands on failure
153+
if: ${{ failure() }}
154+
run: |
155+
echo "----- ENVIRONMENT VARIABLES -----"
156+
env | sort

.github/workflows/clean.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
# to avoid error due to `go version` accepting -v flag with an argument since 1.15
3838
GOFLAGS: ""
39-
uses: actions/setup-go@v4
39+
uses: actions/setup-go@v5
4040
with:
4141
go-version: ${{ matrix.go.version }}
4242

@@ -57,14 +57,14 @@ jobs:
5757
lfs: true
5858

5959
- name: Enable Go modules cache
60-
uses: actions/cache@v3
60+
uses: actions/cache@v4
6161
with:
6262
path: ~/go/pkg/mod
6363
key: ${{ matrix.os }}-go-${{ matrix.go.version }}-modules-${{ hashFiles('**/go.sum') }}
6464
restore-keys: |
6565
${{ matrix.os }}-go-${{ matrix.go.version }}-modules-
6666
- name: Enable Go build cache
67-
uses: actions/cache@v3
67+
uses: actions/cache@v4
6868
with:
6969
path: ~/.cache/go-build
7070
key: ${{ matrix.os }}-go-${{ matrix.go.version }}-build-${{ github.ref }}-${{ hashFiles('**') }}

.github/workflows/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
run: gh pr merge --auto --squash "$PR_URL"
2222
env:
2323
PR_URL: ${{github.event.pull_request.html_url}}
24-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
uses: actions/checkout@v4
2323

2424
- name: Set up Go release
25-
uses: actions/setup-go@v4
25+
uses: actions/setup-go@v5
2626
with:
2727
go-version-file: ${{ github.workspace }}/go.mod
2828
cache: false
2929

3030
- name: Enable Go build cache
31-
uses: actions/cache@v3
31+
uses: actions/cache@v4
3232
with:
3333
path: ~/.cache/go-build
3434
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
@@ -37,7 +37,7 @@ jobs:
3737
${{ runner.os }}-go-build-
3838
3939
- name: Enable Go modules cache
40-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4141
with:
4242
path: ~/go/pkg/mod
4343
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
@@ -89,7 +89,7 @@ jobs:
8989
fail_on_error: true
9090
cache: false
9191
golangci_lint_flags: "-c=.golangci.yml"
92-
golangci_lint_version: v1.51.2 # Version should match specified in Makefile
92+
golangci_lint_version: v1.55.2 # Version should match specified in Makefile
9393

9494
- name: Run go-consistent
9595
env:

.github/workflows/managed.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Enable Go build cache
4242
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ~/.cache/go-build
4646
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
@@ -50,7 +50,7 @@ jobs:
5050
5151
- name: Enable Go modules cache
5252
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
53-
uses: actions/cache@v3
53+
uses: actions/cache@v4
5454
with:
5555
path: ~/go/pkg/mod
5656
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}

0 commit comments

Comments
 (0)