Skip to content

Commit 651aa70

Browse files
authored
Merge branch 'main' into customer-mysql-cdc-keepalive
2 parents c3fcdc8 + 1263aa8 commit 651aa70

34 files changed

Lines changed: 696 additions & 294 deletions

.github/actions/genprotos/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
77
- name: check cache
88
id: cache
9-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
9+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
1010
with:
1111
path: |
1212
./flow/generated

.github/workflows/auto-retry-flaky-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Detect flaky test failures
2929
id: detect
30-
uses: anthropics/claude-code-action@6cad158a175744eb2e76f7f5fd108ec63145598c # main
30+
uses: anthropics/claude-code-action@ff49ec5fd6668a7e8f5bd680d618d2c0dbe7e00e # main
3131
with:
3232
allowed_bots: 'renovate'
3333
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Run Claude Code Review
3030
id: claude-review
31-
uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1
31+
uses: anthropics/claude-code-action@b47fd721da662d48c5680e154ad16a73ed74d2e0 # v1
3232
with:
3333
allowed_bots: 'renovate'
3434
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Run Claude Code
3434
id: claude
35-
uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1
35+
uses: anthropics/claude-code-action@b47fd721da662d48c5680e154ad16a73ed74d2e0 # v1
3636
with:
3737
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3838

.github/workflows/flow.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
--health-timeout 5s
5555
--health-retries 5
5656
redpanda:
57-
image: redpandadata/redpanda@sha256:65a7a93449f113a2941e0e8a9cd7eb1ed3ba153547b6b2b47f11796e9f754345
57+
image: redpandadata/redpanda@sha256:519c125d22c14b01562a428addcecea327f20eceee923805aff29fff53391cf8
5858
ports:
5959
- 9092:9092
6060
- 9644:9644
@@ -86,7 +86,7 @@ jobs:
8686
- 49002:49002
8787
- 49003:49003
8888
openssh:
89-
image: linuxserver/openssh-server:latest@sha256:57c13941ef385d735cca18ee969eeba18e42ab95480c97af2182505aacdfe307
89+
image: linuxserver/openssh-server:latest@sha256:969edac1221e0f211d86dc5a94ee9337340c9c585527f73e5fabf2dae7bb8de3
9090
ports:
9191
- 2222:2222
9292
env:
@@ -148,7 +148,7 @@ jobs:
148148
json: ${{ secrets.EH_CREDS }}
149149

150150
- name: Configure AWS credentials
151-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6
151+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6
152152
id: setup-aws
153153
with:
154154
audience: sts.amazonaws.com
@@ -202,7 +202,7 @@ jobs:
202202
roles: ["readAnyDatabase", "clusterMonitor"]
203203
})'
204204
205-
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
205+
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
206206
id: cache-minio
207207
with:
208208
path: ./minio
@@ -213,7 +213,7 @@ jobs:
213213
run: |
214214
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio && chmod +x minio
215215
216-
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
216+
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
217217
id: cache-minio-client
218218
with:
219219
path: ./mc
@@ -268,7 +268,7 @@ jobs:
268268
echo "ch_version=$(curl -s https://api.github.com/repos/ClickHouse/ClickHouse/releases/latest | jq -r .tag_name)" >> $GITHUB_OUTPUT
269269
fi
270270
271-
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
271+
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
272272
id: cache-clickhouse
273273
with:
274274
path: ./clickhouse
@@ -533,7 +533,7 @@ jobs:
533533

534534
- name: Upload peer-flow logs and test results
535535
if: always()
536-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
536+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
537537
with:
538538
name: peer-flow-logs-pg${{ matrix.db-version.pg }}-my${{ matrix.db-version.mysql }}-mo${{ matrix.db-version.mongo }}
539539
path: logs/

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
pull-requests: write
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7
18+
- uses: release-drafter/release-drafter@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7

.tiltignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# When launching tests via VS Code, it builds binaries with this prefix in the test folder
2+
**/__debug_bin*

Tiltfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ docker_build('flow-api', '.',
66
dockerfile='stacks/flow.Dockerfile',
77
target='flow-api',
88
only=['flow/', 'stacks/flow.Dockerfile'],
9-
build_args={'PEERDB_VERSION_SHA_SHORT': os.getenv('PEERDB_VERSION_SHA_SHORT', '')},
9+
build_args={'PEERDB_VERSION_SHA_SHORT': os.getenv('PEERDB_VERSION_SHA_SHORT', 'unknown')},
1010
)
1111

1212
docker_build('flow-worker', '.',
@@ -149,6 +149,11 @@ dc_resource('dozzle', labels=['Monitoring'], links=[
149149
link('http://localhost:8118', 'Dozzle Container Monitor'),
150150
])
151151

152+
# Test services: Services supporting test execution that are not data stores, like proxies, mock servers, etc.
153+
154+
dc_resource('toxiproxy', labels=['TestInfra'], auto_init=False)
155+
dc_resource('openssh', labels=['TestInfra'], auto_init=False)
156+
152157
# Cleanup
153158

154159
load('ext://uibutton', 'cmd_button', 'location')
@@ -178,6 +183,8 @@ def e2e_test(name, test_run, extra_deps=[], vars_overrides={}):
178183
resource_deps=['flow-api', 'flow-worker', 'catalog', 'provision-clickhouse'] + extra_deps,
179184
)
180185

186+
# Generic e2e tests
187+
181188
# Postgres to ClickHouse generic tests
182189
e2e_test('postgres', 'TestGenericCH_PG', ['provision-postgres'])
183190

@@ -191,4 +198,8 @@ e2e_test('mysql-pos', 'TestGenericCH_MySQL', ['provision-mysql-pos'], vars_overr
191198
e2e_test('mariadb', 'TestGenericCH_MySQL', ['provision-mariadb'], vars_overrides={'CI_MYSQL_PORT': '$CI_MARIADB_PORT'})
192199

193200
# MongoDB to ClickHouse test suite
194-
e2e_test('mongodb', 'TestMongoClickhouseSuite', ['provision-mongodb'])
201+
e2e_test('mongodb', 'TestMongoClickhouseSuite', ['provision-mongodb'])
202+
203+
# API e2e tests
204+
205+
e2e_test('api-postgres', 'TestApiPg', ['provision-postgres'])

ancillary-docker-compose.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,53 @@ services:
129129
volumes:
130130
- /var/run/docker.sock:/var/run/docker.sock
131131

132+
toxiproxy:
133+
container_name: peerdb-test-toxiproxy
134+
# Same image as CI flow
135+
image: ghcr.io/shopify/toxiproxy:2.12.0@sha256:9378ed52a28bc50edc1350f936f518f31fa95f0d15917d6eb40b8e376d1a214e
136+
restart: unless-stopped
137+
ports:
138+
- 18474:8474
139+
- 9902:9902
140+
- 9904:9904
141+
- 9903:9903
142+
- 42001:42001
143+
- 42002:42002
144+
- 42003:42003
145+
- 49001:49001
146+
- 49002:49002
147+
- 49003:49003
148+
extra_hosts:
149+
- "host.docker.internal:host-gateway"
150+
healthcheck:
151+
test: ["CMD", "/toxiproxy-cli", "list"]
152+
interval: 2s
153+
timeout: 10s
154+
retries: 5
155+
156+
openssh:
157+
container_name: peerdb-test-ssh
158+
# Same image as CI flow
159+
image: linuxserver/openssh-server:latest@sha256:57c13941ef385d735cca18ee969eeba18e42ab95480c97af2182505aacdfe307
160+
restart: unless-stopped
161+
ports:
162+
- "2222:2222"
163+
environment:
164+
- PUID=1000
165+
- PGID=1000
166+
- TZ=Etc/UTC
167+
- USER_NAME=testuser
168+
- USER_PASSWORD=testpass
169+
- PASSWORD_ACCESS=true
170+
- DOCKER_MODS=linuxserver/mods:openssh-server-ssh-tunnel
171+
extra_hosts:
172+
- "host.docker.internal:host-gateway"
173+
healthcheck:
174+
test: ["CMD", "nc", "-z", "localhost", "2222"]
175+
interval: 2s
176+
timeout: 10s
177+
retries: 5
178+
132179
volumes:
133180
postgres_data:
134181
clickhouse_data:
@@ -140,3 +187,4 @@ volumes:
140187
networks:
141188
default:
142189
name: peerdb_network
190+
external: true

flow/activities/flowable.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,21 +827,24 @@ func (a *FlowableActivity) DropFlowSource(ctx context.Context, req *protos.DropF
827827
ctx = context.WithValue(ctx, shared.FlowNameKey, req.FlowJobName)
828828
srcConn, srcClose, err := connectors.GetByNameAs[connectors.CDCPullConnectorCore](ctx, nil, a.CatalogPool, req.PeerName)
829829
if err != nil {
830-
var notFound *exceptions.NotFoundError
831-
if errors.As(err, &notFound) {
830+
if _, ok := errors.AsType[*exceptions.NotFoundError](err); ok {
832831
logger := internal.LoggerFromCtx(ctx)
833832
logger.Warn("peer missing, skipping", slog.String("peer", req.PeerName))
834833
return nil
835834
}
835+
if _, ok := errors.AsType[*exceptions.AuthError](err); ok {
836+
logger := internal.LoggerFromCtx(ctx)
837+
logger.Warn("auth error, skipping to avoid triggering security tools", slog.String("peer", req.PeerName))
838+
return nil
839+
}
836840
return a.Alerter.LogFlowError(ctx, req.FlowJobName,
837841
exceptions.NewDropFlowError(fmt.Errorf("[DropFlowSource] failed to get source connector: %w", err)),
838842
)
839843
}
840844
defer srcClose(ctx)
841845

842846
if err := srcConn.PullFlowCleanup(ctx, req.FlowJobName); err != nil {
843-
var dnsErr *net.DNSError
844-
if errors.As(err, &dnsErr) && dnsErr.IsNotFound {
847+
if dnsErr, ok := errors.AsType[*net.DNSError](err); ok && dnsErr.IsNotFound {
845848
a.Alerter.LogFlowWarning(ctx, req.FlowJobName, fmt.Errorf("[DropFlowSource] hostname not found, skipping: %w", err))
846849
return nil
847850
} else {

0 commit comments

Comments
 (0)