Skip to content
Closed
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: ci

on: [pull_request]
on:
pull_request: {}
merge_group: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull-request.number || github.ref }}
Expand Down Expand Up @@ -174,3 +176,5 @@ jobs:
e2e-tests:
needs: [build]
uses: ./.github/workflows/e2e-matrix.yml
with:
minimal: ${{ github.event_name == 'merge_group' }}
4 changes: 3 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]
on:
pull_request:
merge_group:

permissions:
contents: read
Expand Down
72 changes: 40 additions & 32 deletions .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,59 @@
name: Tekton Integration
# Adapted from https://github.com/mattmoor/mink/blob/master/.github/workflows/minkind.yaml

on: [workflow_call]
on:
workflow_call:
inputs:
minimal:
description: 'Run minimal matrix (aka only one job)'
required: false
type: boolean
default: false

defaults:
run:
shell: bash

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
if [[ "${{ inputs.minimal }}" == "true" ]]; then
# Minimal set: only one job
matrix='{"include":[{"os":"ubuntu-latest","k8s-name":"k8s-latest","k8s-version":"v1.34.x","feature-flags":"stable"}]}'
else
# Full matrix:
# - amd64: all combinations (2 k8s versions x 3 feature flags = 6 jobs)
# - arm64: only k8s-latest with stable (1 job)
# Total: 7 jobs
matrix='{
"include": [
{"os": "ubuntu-latest", "k8s-name": "k8s-oldest", "k8s-version": "v1.28.x", "feature-flags": "stable"},
{"os": "ubuntu-latest", "k8s-name": "k8s-oldest", "k8s-version": "v1.28.x", "feature-flags": "beta"},
{"os": "ubuntu-latest", "k8s-name": "k8s-oldest", "k8s-version": "v1.28.x", "feature-flags": "alpha"},
{"os": "ubuntu-latest", "k8s-name": "k8s-latest", "k8s-version": "v1.34.x", "feature-flags": "stable"},
{"os": "ubuntu-latest", "k8s-name": "k8s-latest", "k8s-version": "v1.34.x", "feature-flags": "beta"},
{"os": "ubuntu-latest", "k8s-name": "k8s-latest", "k8s-version": "v1.34.x", "feature-flags": "alpha"},
{"os": "ubuntu-24.04-arm", "k8s-name": "k8s-latest", "k8s-version": "v1.34.x", "feature-flags": "stable"}
]
}'
fi
echo "matrix=$(echo $matrix | jq -c .)" >> $GITHUB_OUTPUT

e2e-tests:
needs: generate-matrix
concurrency:
group: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.k8s-name }}-${{ matrix.feature-flags }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
name: e2e tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
os:
- ubuntu-latest # amd64
- ubuntu-24.04-arm # arm64

k8s-name:
- k8s-oldest # 1.28
- k8s-latest # 1.34

feature-flags:
- stable
- beta
- alpha

include:
- k8s-name: k8s-oldest
k8s-version: v1.28.x
- k8s-name: k8s-latest
k8s-version: v1.34.x

# Limit arm64: only run k8s-latest on arm64 (alpha and beta), skip oldest on arm64
exclude:
- k8s-name: k8s-oldest
os: ubuntu-24.04-arm
- k8s-name: k8s-latest
os: ubuntu-24.04-arm
feature-flags: beta
- k8s-name: k8s-latest
os: ubuntu-24.04-arm
feature-flags: alpha
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
env:
KO_DOCKER_REPO: registry.local:5000/tekton
CLUSTER_DOMAIN: c${{ github.run_id }}.local
Expand All @@ -54,7 +62,7 @@ jobs:

steps:
- name: Free disk space
if: ${{ matrix.os != 'ubuntu-24.04-arm' }}
if: matrix.os != 'ubuntu-24.04-arm'
run: |
echo "--- Disk space before cleanup ---"
df -h
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ permissions:
on:
pull_request:
branches: ["main"]
merge_group:
push:
branches: ["main"]
# run at least once every 2 months to prevent the coverage artifact from expiring
Expand Down
54 changes: 54 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,60 @@ as follows.

---

## Pull Request Merge Queue

This repository uses GitHub's merge queue to ensure the `main` branch remains stable and free from integration conflicts. The merge queue automatically validates that approved pull requests can be merged cleanly with the latest version of `main` before allowing them to land.

### How It Works

When your pull request is approved and all required checks pass:

1. **Add to Queue**: An approver adds your PR to the merge queue (either manually or automatically based on labels/approvals)
2. **Temporary Merge**: GitHub creates a temporary branch (`gh-readonly-queue/main/pr-{number}-{sha}`) that merges your PR with the latest `main`
3. **Validation**: Required CI checks run on this merged state to verify compatibility
4. **Automatic Merge**: If all checks pass, your PR is automatically merged to `main`
5. **Failure Handling**: If checks fail on the merged state, your PR is removed from the queue and you'll need to rebase/fix conflicts

### CI Behavior in Merge Queue

To keep the merge queue fast and efficient, the CI matrix is optimized differently for merge queue builds versus regular PR builds:

**Regular Pull Request Builds:**
- Full e2e test matrix: 18 configurations
- 2 architectures (amd64, arm64)
- 2 Kubernetes versions (1.28, 1.34)
- 3 feature flag sets (stable, beta, alpha)
- Comprehensive validation before approval

**Merge Queue Builds:**
- Minimal e2e test matrix: 1 configuration
- Single architecture: ubuntu-latest (amd64)
- Latest Kubernetes: 1.34
- Stable feature flags only
- Faster validation focused on integration conflicts
- Full matrix already validated during PR review

This optimization significantly reduces merge queue time while maintaining safety, since your PR has already passed the full 18-configuration test matrix during review.

### What You Need to Know

- **PR reviews unchanged**: Continue developing and testing PRs as usual - all checks must pass before your PR can enter the queue
- **Automatic process**: Once approved, the merge queue handles merging automatically
- **Stay up-to-date**: Keep your PR rebased on `main` to minimize queue failures
- **Queue failures**: If your PR fails in the queue, check for:
- Merge conflicts with recent changes to `main`
- Integration issues with other recently merged PRs
- Flaky tests (less common with minimal matrix)

### Benefits

- **Never break main**: Changes are only merged if they work with the latest code
- **No merge conflicts**: Incompatible changes are detected before landing
- **Reduced CI load**: Optimized test matrix for queue builds saves resources
- **Higher velocity**: Automated merging eliminates manual merge bottlenecks

---

## Building and deploying

### Setup a Kubernetes cluster
Expand Down
Loading