Skip to content

Commit b24850b

Browse files
authored
Merge pull request #9710 from neondatabase/rc/2024-11-11
Storage & Compute release 2024-11-11
2 parents 8e4161e + 04f91ee commit b24850b

File tree

144 files changed

+5349
-2617
lines changed

Some content is hidden

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

144 files changed

+5349
-2617
lines changed

Diff for: .github/actions/set-docker-config-dir/action.yml

-36
This file was deleted.

Diff for: .github/workflows/_check-codestyle-python.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check Codestyle Python
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-tools-image:
7+
description: 'build-tools image'
8+
required: true
9+
type: string
10+
11+
defaults:
12+
run:
13+
shell: bash -euxo pipefail {0}
14+
15+
jobs:
16+
check-codestyle-python:
17+
runs-on: [ self-hosted, small ]
18+
container:
19+
image: ${{ inputs.build-tools-image }}
20+
credentials:
21+
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
23+
options: --init
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pypoetry/virtualenvs
31+
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
32+
33+
- run: ./scripts/pysync
34+
35+
- run: poetry run ruff check .
36+
- run: poetry run ruff format --check .
37+
- run: poetry run mypy .

Diff for: .github/workflows/build-build-tools-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
6565
- uses: actions/checkout@v4
6666

67-
- uses: ./.github/actions/set-docker-config-dir
67+
- uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
6868
- uses: docker/setup-buildx-action@v3
6969
with:
7070
cache-binary: false

Diff for: .github/workflows/build_and_test.yml

+9-33
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,10 @@ jobs:
9090

9191
check-codestyle-python:
9292
needs: [ check-permissions, build-build-tools-image ]
93-
runs-on: [ self-hosted, small ]
94-
container:
95-
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
96-
credentials:
97-
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
98-
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
99-
options: --init
100-
101-
steps:
102-
- name: Checkout
103-
uses: actions/checkout@v4
104-
105-
- name: Cache poetry deps
106-
uses: actions/cache@v4
107-
with:
108-
path: ~/.cache/pypoetry/virtualenvs
109-
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
110-
111-
- name: Install Python deps
112-
run: ./scripts/pysync
113-
114-
- name: Run `ruff check` to ensure code format
115-
run: poetry run ruff check .
116-
117-
- name: Run `ruff format` to ensure code format
118-
run: poetry run ruff format --check .
119-
120-
- name: Run mypy to check types
121-
run: poetry run mypy .
93+
uses: ./.github/workflows/_check-codestyle-python.yml
94+
with:
95+
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
96+
secrets: inherit
12297

12398
check-codestyle-jsonnet:
12499
needs: [ check-permissions, build-build-tools-image ]
@@ -141,6 +116,7 @@ jobs:
141116
# Check that the vendor/postgres-* submodules point to the
142117
# corresponding REL_*_STABLE_neon branches.
143118
check-submodules:
119+
needs: [ check-permissions ]
144120
runs-on: ubuntu-22.04
145121
steps:
146122
- name: Checkout
@@ -552,7 +528,7 @@ jobs:
552528
with:
553529
submodules: true
554530

555-
- uses: ./.github/actions/set-docker-config-dir
531+
- uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
556532
- uses: docker/setup-buildx-action@v3
557533
with:
558534
cache-binary: false
@@ -643,7 +619,7 @@ jobs:
643619
with:
644620
submodules: true
645621

646-
- uses: ./.github/actions/set-docker-config-dir
622+
- uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
647623
- uses: docker/setup-buildx-action@v3
648624
with:
649625
cache-binary: false
@@ -824,7 +800,7 @@ jobs:
824800
curl -fL https://github.com/neondatabase/autoscaling/releases/download/$VM_BUILDER_VERSION/vm-builder -o vm-builder
825801
chmod +x vm-builder
826802
827-
- uses: ./.github/actions/set-docker-config-dir
803+
- uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
828804
- uses: docker/login-action@v3
829805
with:
830806
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
@@ -860,7 +836,7 @@ jobs:
860836
steps:
861837
- uses: actions/checkout@v4
862838

863-
- uses: ./.github/actions/set-docker-config-dir
839+
- uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
864840
- uses: docker/login-action@v3
865841
with:
866842
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}

Diff for: .github/workflows/pre-merge-checks.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Pre-merge checks
2+
3+
on:
4+
merge_group:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
shell: bash -euxo pipefail {0}
11+
12+
# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
13+
permissions: {}
14+
15+
jobs:
16+
get-changed-files:
17+
runs-on: ubuntu-22.04
18+
outputs:
19+
python-changed: ${{ steps.python-src.outputs.any_changed }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
23+
id: python-src
24+
with:
25+
files: |
26+
.github/workflows/pre-merge-checks.yml
27+
**/**.py
28+
poetry.lock
29+
pyproject.toml
30+
31+
- name: PRINT ALL CHANGED FILES FOR DEBUG PURPOSES
32+
env:
33+
PYTHON_CHANGED_FILES: ${{ steps.python-src.outputs.all_changed_files }}
34+
run: |
35+
echo "${PYTHON_CHANGED_FILES}"
36+
37+
check-build-tools-image:
38+
if: needs.get-changed-files.outputs.python-changed == 'true'
39+
needs: [ get-changed-files ]
40+
uses: ./.github/workflows/check-build-tools-image.yml
41+
42+
build-build-tools-image:
43+
needs: [ check-build-tools-image ]
44+
uses: ./.github/workflows/build-build-tools-image.yml
45+
with:
46+
image-tag: ${{ needs.check-build-tools-image.outputs.image-tag }}
47+
secrets: inherit
48+
49+
check-codestyle-python:
50+
if: needs.get-changed-files.outputs.python-changed == 'true'
51+
needs: [ get-changed-files, build-build-tools-image ]
52+
uses: ./.github/workflows/_check-codestyle-python.yml
53+
with:
54+
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
55+
secrets: inherit
56+
57+
# To get items from the merge queue merged into main we need to satisfy "Status checks that are required".
58+
# Currently we require 2 jobs (checks with exact name):
59+
# - conclusion
60+
# - neon-cloud-e2e
61+
conclusion:
62+
if: always()
63+
permissions:
64+
statuses: write # for `github.repos.createCommitStatus(...)`
65+
needs:
66+
- get-changed-files
67+
- check-codestyle-python
68+
runs-on: ubuntu-22.04
69+
steps:
70+
- name: Create fake `neon-cloud-e2e` check
71+
uses: actions/github-script@v7
72+
with:
73+
# Retry script for 5XX server errors: https://github.com/actions/github-script#retries
74+
retries: 5
75+
script: |
76+
const { repo, owner } = context.repo;
77+
const targetUrl = `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`;
78+
79+
await github.rest.repos.createCommitStatus({
80+
owner: owner,
81+
repo: repo,
82+
sha: context.sha,
83+
context: `neon-cloud-e2e`,
84+
state: `success`,
85+
target_url: targetUrl,
86+
description: `fake check for merge queue`,
87+
});
88+
89+
- name: Fail the job if any of the dependencies do not succeed or skipped
90+
run: exit 1
91+
if: |
92+
(contains(needs.check-codestyle-python.result, 'skipped') && needs.get-changed-files.outputs.python-changed == 'true')
93+
|| contains(needs.*.result, 'failure')
94+
|| contains(needs.*.result, 'cancelled')

Diff for: .github/workflows/report-workflow-stats.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- Test Postgres client libraries
2424
- Trigger E2E Tests
2525
- cleanup caches by a branch
26+
- Pre-merge checks
2627
types: [completed]
2728

2829
jobs:

Diff for: Cargo.lock

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ walkdir = "2.3.2"
196196
rustls-native-certs = "0.8"
197197
x509-parser = "0.16"
198198
whoami = "1.5.1"
199+
zerocopy = { version = "0.7", features = ["derive"] }
199200

200201
## TODO replace this with tracing
201202
env_logger = "0.10"

0 commit comments

Comments
 (0)