Skip to content

Commit a1bd424

Browse files
committed
Simplify e2e image override handling
1 parent be082bc commit a1bd424

13 files changed

+66
-155
lines changed

.github/workflows/check-changes-for-docker-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
description: "The github.name of the caller workflow"
1111
type: string
1212
required: true
13-
caller-base-commit:
14-
description: "The explicit base commit sha to diff against or reuse when builds are skipped"
13+
caller-workflow-event-before:
14+
description: "The github.event.before sha of the caller workflow"
1515
type: string
1616
required: true
1717
docker-image:
@@ -71,7 +71,7 @@ jobs:
7171
if: inputs.caller-workflow-event-name == 'push'
7272
shell: bash
7373
env:
74-
BASE_BRANCH_COMMIT: ${{ inputs.caller-base-commit }}
74+
BASE_BRANCH_COMMIT: ${{ inputs.caller-workflow-event-before }}
7575
IMAGE: ghcr.io/zama-ai/${{ inputs.docker-image }}
7676
MAX_COMMIT_COUNT: ${{ inputs.max-commit-count }}
7777
run: |
@@ -99,7 +99,7 @@ jobs:
9999
shell: bash
100100
env:
101101
LATEST_IMAGE_COMMIT: ${{ steps.find-latest-image-commit.outputs.latest-image-commit }}
102-
BASE_BRANCH_COMMIT: ${{ inputs.caller-base-commit }}
102+
BASE_BRANCH_COMMIT: ${{ inputs.caller-workflow-event-before }}
103103
run: |
104104
echo "base-commit=${LATEST_IMAGE_COMMIT:-$BASE_BRANCH_COMMIT}" >> "$GITHUB_OUTPUT"
105105

.github/workflows/coprocessor-docker-build.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ on:
66
- published
77
workflow_call:
88
inputs:
9-
caller-base-commit:
10-
description: "Explicit base commit for change detection when called from another workflow"
11-
type: string
12-
default: ""
13-
required: false
149
is_workflow_call:
1510
description: "Indicates if the workflow is called from another workflow"
1611
type: boolean
@@ -126,7 +121,7 @@ jobs:
126121
pull-requests: 'read' # Required to read pull request information
127122
with:
128123
caller-workflow-event-name: ${{ github.event_name }}
129-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
124+
caller-workflow-event-before: ${{ github.event.before }}
130125
docker-image: fhevm/coprocessor/db-migration
131126
filters: |
132127
db-migration:
@@ -140,7 +135,7 @@ jobs:
140135
permissions: *check_changes_permissions
141136
with:
142137
caller-workflow-event-name: ${{ github.event_name }}
143-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
138+
caller-workflow-event-before: ${{ github.event.before }}
144139
docker-image: fhevm/coprocessor/gw-listener
145140
filters: |
146141
gw-listener:
@@ -155,7 +150,7 @@ jobs:
155150
permissions: *check_changes_permissions
156151
with:
157152
caller-workflow-event-name: ${{ github.event_name }}
158-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
153+
caller-workflow-event-before: ${{ github.event.before }}
159154
docker-image: fhevm/coprocessor/host-listener
160155
filters: |
161156
host-listener:
@@ -172,7 +167,7 @@ jobs:
172167
permissions: *check_changes_permissions
173168
with:
174169
caller-workflow-event-name: ${{ github.event_name }}
175-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
170+
caller-workflow-event-before: ${{ github.event.before }}
176171
docker-image: fhevm/coprocessor/sns-worker
177172
filters: |
178173
sns-worker:
@@ -187,7 +182,7 @@ jobs:
187182
permissions: *check_changes_permissions
188183
with:
189184
caller-workflow-event-name: ${{ github.event_name }}
190-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
185+
caller-workflow-event-before: ${{ github.event.before }}
191186
docker-image: fhevm/coprocessor/tfhe-worker
192187
filters: |
193188
tfhe-worker:
@@ -202,7 +197,7 @@ jobs:
202197
permissions: *check_changes_permissions
203198
with:
204199
caller-workflow-event-name: ${{ github.event_name }}
205-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
200+
caller-workflow-event-before: ${{ github.event.before }}
206201
docker-image: fhevm/coprocessor/tx-sender
207202
filters: |
208203
tx-sender:
@@ -217,7 +212,7 @@ jobs:
217212
permissions: *check_changes_permissions
218213
with:
219214
caller-workflow-event-name: ${{ github.event_name }}
220-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
215+
caller-workflow-event-before: ${{ github.event.before }}
221216
docker-image: fhevm/coprocessor/zkproof-worker
222217
filters: |
223218
zkproof-worker:

.github/workflows/gateway-contracts-docker-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: gateway-contracts-docker-build
33
on:
44
workflow_call:
55
inputs:
6-
caller-base-commit:
7-
description: "Explicit base commit for change detection when called from another workflow"
8-
type: string
9-
default: ""
10-
required: false
116
is_workflow_call:
127
description: "Indicates if the workflow is called from another workflow"
138
type: boolean
@@ -58,7 +53,7 @@ jobs:
5853
pull-requests: 'read' # Required to read pull request information
5954
with:
6055
caller-workflow-event-name: ${{ github.event_name }}
61-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
56+
caller-workflow-event-before: ${{ github.event.before }}
6257
docker-image: fhevm/gateway-contracts
6358
filters: |
6459
gw-contracts:

.github/workflows/host-contracts-docker-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: host-contracts-docker-build
33
on:
44
workflow_call:
55
inputs:
6-
caller-base-commit:
7-
description: "Explicit base commit for change detection when called from another workflow"
8-
type: string
9-
default: ""
10-
required: false
116
is_workflow_call:
127
description: "Indicates if the workflow is called from another workflow"
138
type: boolean
@@ -58,7 +53,7 @@ jobs:
5853
pull-requests: 'read' # Required to read pull request information
5954
with:
6055
caller-workflow-event-name: ${{ github.event_name }}
61-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
56+
caller-workflow-event-before: ${{ github.event.before }}
6257
docker-image: fhevm/host-contracts
6358
filters: |
6459
host-contracts:

.github/workflows/kms-connector-docker-build.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: kms-connector-docker-build
33
on:
44
workflow_call:
55
inputs:
6-
caller-base-commit:
7-
description: "Explicit base commit for change detection when called from another workflow"
8-
type: string
9-
default: ""
10-
required: false
116
is_workflow_call:
127
description: "Indicates if the workflow is called from another workflow"
138
type: boolean
@@ -96,7 +91,7 @@ jobs:
9691
pull-requests: 'read' # Required to read pull request information
9792
with:
9893
caller-workflow-event-name: ${{ github.event_name }}
99-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
94+
caller-workflow-event-before: ${{ github.event.before }}
10095
docker-image: fhevm/kms-connector/db-migration
10196
filters: |
10297
db-migration:
@@ -110,7 +105,7 @@ jobs:
110105
permissions: *check_changes_permissions
111106
with:
112107
caller-workflow-event-name: ${{ github.event_name }}
113-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
108+
caller-workflow-event-before: ${{ github.event.before }}
114109
docker-image: fhevm/kms-connector/gw-listener
115110
filters: |
116111
gw-listener:
@@ -127,7 +122,7 @@ jobs:
127122
permissions: *check_changes_permissions
128123
with:
129124
caller-workflow-event-name: ${{ github.event_name }}
130-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
125+
caller-workflow-event-before: ${{ github.event.before }}
131126
docker-image: fhevm/kms-connector/kms-worker
132127
filters: |
133128
kms-worker:
@@ -145,7 +140,7 @@ jobs:
145140
permissions: *check_changes_permissions
146141
with:
147142
caller-workflow-event-name: ${{ github.event_name }}
148-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
143+
caller-workflow-event-before: ${{ github.event.before }}
149144
docker-image: fhevm/kms-connector/tx-sender
150145
filters: |
151146
tx-sender:

.github/workflows/relayer-docker-build.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: relayer-docker-build
33
on:
44
workflow_call:
55
inputs:
6-
caller-base-commit:
7-
description: "Explicit base commit for change detection when called from another workflow"
8-
type: string
9-
default: ""
10-
required: false
116
is_workflow_call:
127
description: "Indicates if the workflow is called from another workflow"
138
type: boolean
@@ -76,7 +71,7 @@ jobs:
7671
pull-requests: 'read' # Required to read pull request information
7772
with:
7873
caller-workflow-event-name: ${{ github.event_name }}
79-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
74+
caller-workflow-event-before: ${{ github.event.before }}
8075
docker-image: fhevm/relayer-migrate
8176
filters: |
8277
relayer-migrate:
@@ -91,7 +86,7 @@ jobs:
9186
permissions: *check_changes_permissions
9287
with:
9388
caller-workflow-event-name: ${{ github.event_name }}
94-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
89+
caller-workflow-event-before: ${{ github.event.before }}
9590
docker-image: fhevm/relayer
9691
filters: |
9792
relayer:

.github/workflows/test-suite-docker-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: test-suite-docker-build
33
on:
44
workflow_call:
55
inputs:
6-
caller-base-commit:
7-
description: "Explicit base commit for change detection when called from another workflow"
8-
type: string
9-
default: ""
10-
required: false
116
is_workflow_call:
127
description: "Indicates if the workflow is called from another workflow"
138
type: boolean
@@ -58,7 +53,7 @@ jobs:
5853
pull-requests: 'read' # Required to read pull request information
5954
with:
6055
caller-workflow-event-name: ${{ github.event_name }}
61-
caller-base-commit: ${{ inputs.caller-base-commit || github.event.before }}
56+
caller-workflow-event-before: ${{ github.event.before }}
6257
docker-image: fhevm/test-suite/e2e
6358
filters: |
6459
e2e-docker:

.github/workflows/test-suite-e2e-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ jobs:
140140
RELAYER_VERSION: ${{ inputs.relayer-version }}
141141
CORE_VERSION: ${{ inputs.kms-core-version }}
142142
SCENARIO: ${{ inputs.scenario || 'two-of-two' }}
143-
FHEVM_TRUST_REPO_VERSION_OVERRIDES: ${{ inputs.orchestrated && '1' || '' }}
144143
runs-on: large_ubuntu_32
145144
steps:
146145
- name: Checkout code

.github/workflows/test-suite-orchestrate-e2e-tests.yml

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,31 @@ jobs:
3232
GHCR_READ_TOKEN: ${{ secrets.GHCR_READ_TOKEN }}
3333
CGR_USERNAME: ${{ secrets.CGR_USERNAME }}
3434
CGR_PASSWORD: ${{ secrets.CGR_PASSWORD }}
35-
with:
36-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
3735
gateway-contracts-docker-build:
3836
if: *build-trigger-condition
3937
uses: ./.github/workflows/gateway-contracts-docker-build.yml
4038
permissions: *docker_permissions
4139
secrets: *docker_secrets
42-
with:
43-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
4440
host-contracts-docker-build:
4541
if: *build-trigger-condition
4642
uses: ./.github/workflows/host-contracts-docker-build.yml
4743
permissions: *docker_permissions
4844
secrets: *docker_secrets
49-
with:
50-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
5145
kms-connector-docker-build:
5246
if: *build-trigger-condition
5347
uses: ./.github/workflows/kms-connector-docker-build.yml
5448
permissions: *docker_permissions
5549
secrets: *docker_secrets
56-
with:
57-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
5850
relayer-docker-build:
5951
if: *build-trigger-condition
6052
uses: ./.github/workflows/relayer-docker-build.yml
6153
permissions: *docker_permissions
6254
secrets: *docker_secrets
63-
with:
64-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
6555
test-suite-docker-build:
6656
if: *build-trigger-condition
6757
uses: ./.github/workflows/test-suite-docker-build.yml
6858
permissions: *docker_permissions
6959
secrets: *docker_secrets
70-
with:
71-
caller-base-commit: ${{ github.event.pull_request.base.sha }}
7260

7361
create-e2e-tests-input:
7462
name: create-e2e-tests-input
@@ -117,6 +105,7 @@ jobs:
117105
run: |
118106
set -euo pipefail
119107
short_tag="$(git rev-parse --short=7 "$NEW_COMMIT_HASH")"
108+
base_short_tag="$(git rev-parse --short=7 "$BASE_COMMIT_HASH")"
120109
needs_file="$RUNNER_TEMP/docker-build-results.json"
121110
printf '%s' "$DOCKER_BUILD_RESULTS" > "$needs_file"
122111
@@ -159,41 +148,36 @@ jobs:
159148
fi
160149
161150
failures=()
162-
while IFS='|' read -r job result_key base_commit_key output_key; do
151+
while IFS='|' read -r job result_key output_key; do
163152
result="$(jq -r --arg job "$job" --arg key "$result_key" '.[$job].outputs[$key] // "missing"' "$needs_file")"
164153
case "$result" in
165154
success)
166155
echo "$output_key=$short_tag" >> "$GITHUB_OUTPUT"
167156
;;
168157
skipped)
169-
base_commit="$(jq -r --arg job "$job" --arg key "$base_commit_key" '.[$job].outputs[$key] // empty' "$needs_file")"
170-
if [ -z "$base_commit" ]; then
171-
failures+=("$job.$base_commit_key=missing")
172-
else
173-
echo "$output_key=$(git rev-parse --short=7 "$base_commit")" >> "$GITHUB_OUTPUT"
174-
fi
158+
echo "$output_key=$base_short_tag" >> "$GITHUB_OUTPUT"
175159
;;
176160
*)
177161
failures+=("$job.$result_key=$result")
178162
;;
179163
esac
180164
done <<'EOF'
181-
coprocessor-docker-build|db_migration_build_result|db_migration_base_commit|coprocessor-db-migration-version
182-
coprocessor-docker-build|gw_listener_build_result|gw_listener_base_commit|coprocessor-gw-listener-version
183-
coprocessor-docker-build|host_listener_build_result|host_listener_base_commit|coprocessor-host-listener-version
184-
coprocessor-docker-build|sns_worker_build_result|sns_worker_base_commit|coprocessor-sns-worker-version
185-
coprocessor-docker-build|tfhe_worker_build_result|tfhe_worker_base_commit|coprocessor-tfhe-worker-version
186-
coprocessor-docker-build|tx_sender_build_result|tx_sender_base_commit|coprocessor-tx-sender-version
187-
coprocessor-docker-build|zkproof_worker_build_result|zkproof_worker_base_commit|coprocessor-zkproof-worker-version
188-
kms-connector-docker-build|db_migration_build_result|db_migration_base_commit|connector-db-migration-version
189-
kms-connector-docker-build|gw_listener_build_result|gw_listener_base_commit|connector-gw-listener-version
190-
kms-connector-docker-build|kms_worker_build_result|kms_worker_base_commit|connector-kms-worker-version
191-
kms-connector-docker-build|tx_sender_build_result|tx_sender_base_commit|connector-tx-sender-version
192-
gateway-contracts-docker-build|build_result|base_commit|gateway-version
193-
host-contracts-docker-build|build_result|base_commit|host-version
194-
relayer-docker-build|relayer_migrate_build_result|relayer_migrate_base_commit|relayer-migrate-version
195-
relayer-docker-build|relayer_build_result|relayer_base_commit|relayer-version
196-
test-suite-docker-build|build_result|base_commit|test-suite-version
165+
coprocessor-docker-build|db_migration_build_result|coprocessor-db-migration-version
166+
coprocessor-docker-build|gw_listener_build_result|coprocessor-gw-listener-version
167+
coprocessor-docker-build|host_listener_build_result|coprocessor-host-listener-version
168+
coprocessor-docker-build|sns_worker_build_result|coprocessor-sns-worker-version
169+
coprocessor-docker-build|tfhe_worker_build_result|coprocessor-tfhe-worker-version
170+
coprocessor-docker-build|tx_sender_build_result|coprocessor-tx-sender-version
171+
coprocessor-docker-build|zkproof_worker_build_result|coprocessor-zkproof-worker-version
172+
kms-connector-docker-build|db_migration_build_result|connector-db-migration-version
173+
kms-connector-docker-build|gw_listener_build_result|connector-gw-listener-version
174+
kms-connector-docker-build|kms_worker_build_result|connector-kms-worker-version
175+
kms-connector-docker-build|tx_sender_build_result|connector-tx-sender-version
176+
gateway-contracts-docker-build|build_result|gateway-version
177+
host-contracts-docker-build|build_result|host-version
178+
relayer-docker-build|relayer_migrate_build_result|relayer-migrate-version
179+
relayer-docker-build|relayer_build_result|relayer-version
180+
test-suite-docker-build|build_result|test-suite-version
197181
EOF
198182
199183
if [ "${#failures[@]}" -gt 0 ]; then

test-suite/fhevm/src/cli.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,20 @@ describe("cli", () => {
282282
});
283283
});
284284

285-
test("operators profile accepts targeted grep narrowing", () => {
285+
test("grep-backed named profiles accept targeted grep narrowing", () => {
286286
expect(() => validateNamedProfileGrep("operators", "manual")).not.toThrow();
287-
expect(() => validateNamedProfileGrep("erc20", "manual")).toThrow(
288-
"`fhevm-cli test erc20` does not accept `--grep`; use either a named profile or a custom grep",
287+
expect(() => validateNamedProfileGrep("erc20", "manual")).not.toThrow();
288+
expect(() => validateNamedProfileGrep("ciphertext-drift", "manual")).toThrow(
289+
"`fhevm-cli test ciphertext-drift` does not accept `--grep`; use either a named profile or a custom grep",
289290
);
290291
});
291292

293+
test("named profile grep narrowing preserves both the profile and custom filters", async () => {
294+
const { narrowedProfileGrep } = await import("./commands/test");
295+
expect(narrowedProfileGrep("erc20", "manual")).toBe("(?=.*(?:erc20))(?=.*(?:manual))");
296+
expect(narrowedProfileGrep("erc20")).toBe("erc20");
297+
});
298+
292299
test("rejects unknown flags on destructive commands", async () => {
293300
const result = await execCli(["clean", "--keep-imagse"]);
294301
expect(result.code).toBe(1);

0 commit comments

Comments
 (0)