Skip to content

feat(ci): add required gate jobs and merge queue support - #14298

Merged
ChiragAgg5k merged 1 commit into
mainfrom
ci/gate-merge-queue
Oct 9, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
ci/gate-merge-queue

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Problems this fixes

  1. PRs with failing CI can be merged. No checks are required on main, so a red PR can be merged with one click.
  2. Two PRs that each pass can still break main once both are merged. Each PR is tested against the main it started from, not the main it lands on.

What this PR does

  • Adds two summary checks, CI and Console. Each passes when every job in its workflow passed or was skipped, and fails if any job failed or was cancelled. GitHub can require these, whereas it can't usefully require today's jobs: their names change with the test matrix, and skipped jobs would block console-only PRs forever.
  • Lets CI run in GitHub's merge queue. The queue tests each PR on top of the latest main before merging it.

The tests that run don't change, and nothing changes for anyone until the settings below are turned on.

After merging (needs a repo admin)

  1. Require the CI and Console checks on main. This fixes problem 1.
  2. Turn on the merge queue for main, with "merge commit" as the method. This fixes problem 2.

Next

A follow-up PR will have the merge queue run the full database test matrix (MariaDB, MongoDB and shared mode), so changes that break only those can't land.

Related: #14299

main has no required checks, and the matrix-named jobs can't be required
because path-skipped jobs never report. One gate per workflow (CI, Console)
needs every job, passes skips and fails on failures or cancellations, so it
is the only check a ruleset has to require. It runs under always() so a
cancelled run fails closed instead of reporting a skipped, passing check.

Both workflows now also run on merge_group, with change detection, the
changed-package diff and the database-version check diffing against the
queue's base commit. What runs per change is unchanged.
@luxor-code-review

luxor-code-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review complete. 🟠 1 high

📍 Findings outside the diff (1) — 🟠 1 high — defects on lines GitHub can't attach comments to

🟠 High — Console E2E silently skipped on merge-queue runs · console.yml:106–110 · unchanged line

// .github/workflows/console.yml
106	    if: >-
107	      needs.changes.outputs.console == 'true'
108	      && github.event_name == 'pull_request'
109	      && github.event.pull_request.head.repo.full_name == github.repository
110	    runs-on: gcrunner=${{ github.run_id }}-console-e2e-session/runner=small

The PR adds merge_group to the Console workflow triggers and a required gate job, but the session job still requires github.event_name == 'pull_request' (console.yml:108), so it is skipped on merge-queue runs. e2e is gated on needs.session.result != 'skipped' (console.yml:131) and is therefore skipped too, while gate treats skipped jobs as passing. Every merge-queue run — the final required check before merge — reports green with zero console E2E coverage, and the merge-queue head (a new merge commit against current main) is never E2E-tested at all.


The change teaches the CI and Console GitHub Actions workflows to run on merge_group events and introduces a required gate job that aggregates the other jobs' results, failing only on failure or cancelled. .github/scripts/changes.sh gains a merge-queue branch that computes the diff range against the merge queue's base_sha via MERGE_BASE, with a pull_request fallback path.

Files Change
.github/scripts/changes.sh Detects merge-queue runs and sets the diff base from the merge_group event's base_sha, falling back to the PR base logic otherwise.
.github/workflows/ci.yml Adds merge_group to triggers and a required CI gate job that requires all downstream jobs to pass.
.github/workflows/console.yml Adds merge_group to triggers and a required Console gate job, but the session job it depends on still runs only on pull_request events.

One high-severity issue: on merge-queue runs the Console E2E suite is silently skipped while the new gate reports success.

Reviewed commit: 25626a5

@ghost

ghost commented Oct 9, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No actionable defects were found in the merge-queue handling or gate jobs.

Adds merge-queue triggers to the CI and Console workflows and compares changed files, packages, and database versions against the merge-group base and head. Adds always-running CI and Console gate jobs that aggregate job results while allowing skipped jobs to pass; the reporting-only benchmark is excluded from the CI gate.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
.github/scripts/changes.sh Uses the merge-group base SHA when calculating changed areas.
.github/workflows/ci.yml Adds merge-queue handling and an aggregate CI gate.
.github/workflows/console.yml Adds the merge-queue trigger and an aggregate Console gate.

Reviewed 25626a5 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

32 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (17)
  • php.appwrite.permissive-write-permission (8)
  • php.appwrite.secret-compare-timing (5)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → ci/gate-merge-queue (after).

Metric Before After Change
🚀 Requests/sec 211.73 213.77 ⚪ +1%
⏱️ Latency P50 80.59 ms 81.53 ms ⚪ +1.2%
⏱️ Latency P95 192.87 ms 188.08 ms ⚪ -2.5%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 81.53 188.08 13,452 213.77 -4.79
Account 159.2 280.98 708 11.78 -15.22
TablesDB 78.29 142.18 7,316 118.24 -10.16
Storage 76.5 164.97 3,540 59.24 -8.08
Functions 117.93 223.18 1,888 32.27 +12.32

Top API waits (after)

API request Max wait (ms)
account.name.update 536.37
functions.variables.update 384.83
account.prefs.update 381.47
functions.create 318.77
tablesdb.rows.create 316.44

@ChiragAgg5k
ChiragAgg5k merged commit 4ff11ef into main Oct 9, 2026
216 of 218 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the ci/gate-merge-queue branch October 9, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant