Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/backend-hermetic-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ jobs:
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
# Resolve the PR base live against the checkout (matching
# detect-changes) rather than the event-payload base.sha, which can be
# stale for a queued run (FC-stale-event-payload-diff-base, #10785).
PR_BASE_REF: origin/${{ github.base_ref }}
MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }}
run: |
case "$EVENT_NAME" in
pull_request) base_sha="$PR_BASE_SHA" ;;
pull_request) base_sha="$PR_BASE_REF" ;;
merge_group) base_sha="$MERGE_GROUP_BASE_SHA" ;;
workflow_dispatch)
echo "applies=true" >> "$GITHUB_OUTPUT"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/backend-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ jobs:
working-directory: backend
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
../scripts/changed-files "${{ github.event.pull_request.base.sha }}"...HEAD > /tmp/backend-changed-files.txt
# Resolve the base live against the checkout (matching detect-changes)
# rather than the event-payload base.sha, which can be stale for a
# queued run (FC-stale-event-payload-diff-base, #10785).
../scripts/changed-files "origin/${{ github.base_ref }}"...HEAD > /tmp/backend-changed-files.txt
bash scripts/run-unit-ci.sh --changed-files /tmp/backend-changed-files.txt
else
bash scripts/run-unit-ci.sh --all
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/desktop-swift-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ jobs:
id: changed
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
DIFF_BASE="${{ github.event.pull_request.base.sha }}"
# Resolve the base live against the checkout (matching detect-changes)
# rather than the event-payload base.sha, which can be stale for a
# queued run (FC-stale-event-payload-diff-base, #10785).
DIFF_BASE="origin/${{ github.base_ref }}"
else
DIFF_BASE="${{ github.event.before }}"
fi
Expand Down
6 changes: 5 additions & 1 deletion backend/tests/unit/test_listen_pusher_stack_ci_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ def test_backend_hermetic_gate_is_always_reported_and_fails_closed() -> None:

assert ' scope:\n' in workflow
scope = workflow.split(' scope:\n', 1)[1].split('\n hermetic-e2e:\n', 1)[0]
assert 'github.event.pull_request.base.sha' in scope
# The PR base is resolved live against the checkout (origin/<base-ref>) rather
# than the event-payload base.sha, which can be stale for a queued run
# (FC-stale-event-payload-diff-base, #10785).
assert 'github.event.pull_request.base.sha' not in scope
assert 'PR_BASE_REF: origin/${{ github.base_ref }}' in scope
assert 'github.event.merge_group.base_sha' in scope
assert 'git diff --name-only "$base_sha"...HEAD' in scope
assert "^(backend/|package\\.json$|package-lock\\.json$|\\.github/workflows/backend-hermetic-e2e\\.yml$)" in scope
Expand Down
Loading