From 6fafd1af57ea806c67b03d1b56161c6ead4693ed Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Fri, 18 Feb 2022 18:53:27 -0400 Subject: [PATCH] refactor(mergify): better test requirements and merge conditions (#3580) * fix(mergify, actions): use better names and require tests * feat(queue): do not update the actual PR, create a draft Do not allow to update/rebase the original pull request to check its mergeability. Create a draft pull request instead. This doesn't add Mergify as a co-author * feat(queue): do not interrupt already running queues Our queues might take more than 5 hours even if the priority is low. Do not allow interrupting the ongoing speculative checks when a pull request with higher priority enters in the queue. * fix(mergify): move 'allow' attributes to queue_rules * fix(mergify): attributes are not conditions --- .github/mergify.yml | 48 +++++++++++++++------ .github/workflows/ci.patch.yml | 10 ++--- .github/workflows/ci.yml | 10 ++--- .github/workflows/coverage.patch.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/test.patch.yml | 63 ++++++++++++++++++++++++++++ 6 files changed, 111 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/test.patch.yml diff --git a/.github/mergify.yml b/.github/mergify.yml index c88d3cb5..c9a991c1 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,30 +1,54 @@ queue_rules: - name: urgent + allow_inplace_checks: False + allow_checks_interruption: False speculative_checks: 2 batch_size: 2 conditions: - - check-success=Test (+stable) on ubuntu-latest - - check-success=Test (+stable) on macOS-latest - - check-success=Test (+stable) on windows-latest - - check-success=Coverage (+nightly) + - check-success=Test all + - check-success=Test with fake activation heights + - check-success=Test full validation sync from cached state + - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest + - check-success=Test stable on ubuntu-latest + - check-success=Test stable on macOS-latest + - check-success=Test stable on windows-latest + - check-success=Coverage nightly + - check-success=Clippy + - check-success=Rustfmt - name: medium + allow_inplace_checks: False + allow_checks_interruption: False speculative_checks: 2 batch_size: 3 conditions: - - check-success=Test (+stable) on ubuntu-latest - - check-success=Test (+stable) on macOS-latest - - check-success=Test (+stable) on windows-latest - - check-success=Coverage (+nightly) + - check-success=Test all + - check-success=Test with fake activation heights + - check-success=Test full validation sync from cached state + - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest + - check-success=Test stable on ubuntu-latest + - check-success=Test stable on macOS-latest + - check-success=Test stable on windows-latest + - check-success=Coverage nightly + - check-success=Clippy + - check-success=Rustfmt - name: low + allow_inplace_checks: False + allow_checks_interruption: False speculative_checks: 2 batch_size: 4 conditions: - - check-success=Test (+stable) on ubuntu-latest - - check-success=Test (+stable) on macOS-latest - - check-success=Test (+stable) on windows-latest - - check-success=Coverage (+nightly) + - check-success=Test all + - check-success=Test with fake activation heights + - check-success=Test full validation sync from cached state + - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest + - check-success=Test stable on ubuntu-latest + - check-success=Test stable on macOS-latest + - check-success=Test stable on windows-latest + - check-success=Coverage nightly + - check-success=Clippy + - check-success=Rustfmt pull_request_rules: - name: move to urgent queue when CI passes with 1 review and not WIP targeting main diff --git a/.github/workflows/ci.patch.yml b/.github/workflows/ci.patch.yml index 031ede2c..6257040e 100644 --- a/.github/workflows/ci.patch.yml +++ b/.github/workflows/ci.patch.yml @@ -13,7 +13,7 @@ on: jobs: test: - name: Test (+${{ matrix.rust }}) on ${{ matrix.os }} + name: Test ${{ matrix.rust }} on ${{ matrix.os }} # The large timeout is to accommodate: # - Windows builds (75 minutes, typically 30-50 minutes) # - parameter downloads (40 minutes, but only when the cache expires) @@ -29,7 +29,7 @@ jobs: - run: 'echo "No build required"' test-fake-activation-heights: - name: Build (+${{ matrix.rust }}) zebra-state with fake activation heights on ubuntu-latest + name: Test ${{ matrix.rust }} zebra-state with fake activation heights on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest strategy: @@ -40,7 +40,7 @@ jobs: - run: 'echo "No build required"' build-chain-no-features: - name: Build (+${{ matrix.rust }}) zebra-chain w/o features on ubuntu-latest + name: Build ${{ matrix.rust }} zebra-chain w/o features on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest strategy: @@ -51,7 +51,7 @@ jobs: - run: 'echo "No build required"' build: - name: Build (+stable) on ubuntu-latest + name: Build stable on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest @@ -59,7 +59,7 @@ jobs: - run: 'echo "No build required"' cargo-deny: - name: Check deny.toml crate dependencies and validate licenses + name: Check deny.toml ${{ matrix.checks }} runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dcbf60c..008603f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ env: jobs: test: - name: Test (+${{ matrix.rust }}) on ${{ matrix.os }} + name: Test ${{ matrix.rust }} on ${{ matrix.os }} # The large timeout is to accommodate: # - Windows builds (75 minutes, typically 30-50 minutes) # - parameter downloads (40 minutes, but only when the cache expires) @@ -117,7 +117,7 @@ jobs: args: --verbose --package zebrad --test acceptance sync_large_checkpoints_ -- --ignored test-fake-activation-heights: - name: Build (+${{ matrix.rust }}) zebra-state with fake activation heights on ubuntu-latest + name: Test ${{ matrix.rust }} zebra-state with fake activation heights on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest strategy: @@ -158,7 +158,7 @@ jobs: args: --verbose --package zebra-state --lib -- with_fake_activation_heights build-chain-no-features: - name: Build (+${{ matrix.rust }}) zebra-chain w/o features on ubuntu-latest + name: Build ${{ matrix.rust }} zebra-chain w/o features on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest strategy: @@ -188,7 +188,7 @@ jobs: run: cargo build --verbose --no-default-features build: - name: Build (+stable) on ubuntu-latest + name: Build stable on ubuntu-latest timeout-minutes: 60 runs-on: ubuntu-latest @@ -224,7 +224,7 @@ jobs: args: --verbose --release cargo-deny: - name: Check deny.toml crate dependencies and validate licenses + name: Check deny.toml ${{ matrix.checks }} runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/coverage.patch.yml b/.github/workflows/coverage.patch.yml index 2896ae3a..567d4cb7 100644 --- a/.github/workflows/coverage.patch.yml +++ b/.github/workflows/coverage.patch.yml @@ -12,7 +12,7 @@ on: jobs: coverage: - name: Coverage (+nightly) + name: Coverage nightly # The large timeout is to accommodate: # - nightly builds (75 minutes, typically 30-50 minutes) # - parameter downloads (40 minutes, but only when the cache expires) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c6a9aa5a..5a3ea846 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -17,7 +17,7 @@ env: jobs: coverage: - name: Coverage (+nightly) + name: Coverage nightly # The large timeout is to accommodate: # - nightly builds (75 minutes, typically 30-50 minutes) # - parameter downloads (40 minutes, but only when the cache expires) diff --git a/.github/workflows/test.patch.yml b/.github/workflows/test.patch.yml new file mode 100644 index 00000000..c1110a67 --- /dev/null +++ b/.github/workflows/test.patch.yml @@ -0,0 +1,63 @@ +name: Test + +on: + pull_request: + branches: + - main + paths-ignore: + - '**/*.rs' + - '**/*.txt' + - '**/Cargo.toml' + - '**/Cargo.lock' + - 'docker/**' + - '.github/workflows/test.yml' + +jobs: + build: + name: Build images + runs-on: ubuntu-latest + steps: + - run: 'echo "No build required"' + + # Run all the zebra tests, including tests that are ignored by default + test-all: + name: Test all + runs-on: ubuntu-latest + needs: build + if: ${{ github.event.inputs.regenerate-disks != 'true' }} + steps: + - run: 'echo "No build required"' + + test-fake-activation-heights: + name: Test with fake activation heights + runs-on: ubuntu-latest + needs: build + if: ${{ github.event.inputs.regenerate-disks != 'true' }} + steps: + - run: 'echo "No build required"' + + # Test that Zebra syncs and checkpoints a few thousand blocks from an empty state + test-empty-sync: + name: Test checkpoint sync from empty state + runs-on: ubuntu-latest + needs: build + if: ${{ github.event.inputs.regenerate-disks != 'true' }} + steps: + - run: 'echo "No build required"' + + regenerate-stateful-disks: + name: Regenerate stateful disks + runs-on: ubuntu-latest + needs: build + outputs: + disk_short_sha: ${{ steps.disk-short-sha.outputs.disk_short_sha }} + steps: + - run: 'echo "No build required"' + + # Test that Zebra syncs and fully validates a few thousand blocks from a cached post-checkpoint state + test-stateful-sync: + name: Test full validation sync from cached state + runs-on: ubuntu-latest + needs: [ build, regenerate-stateful-disks] + steps: + - run: 'echo "No build required"' \ No newline at end of file