Skip to content

feat(ci): run only the e2e lanes a change can affect - #14301

Merged
ChiragAgg5k merged 4 commits into
mainfrom
ci/affected-lanes
Oct 9, 2026
Merged

ChiragAgg5k merged 4 commits into
mainfrom
ci/affected-lanes

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Problem

Every PR that touches server code runs all 31 e2e service lanes and the 5 grouped lanes (Abuse, Screenshots, Antivirus, S3, Queue Retry). That includes a fix inside one module, a change to the e2e tests of one service, or a unit-test-only PR.

What this PR does

CI now picks the lanes to run from the files a PR changes:

  • A module, controller, worker or package with known coverage runs the lanes that test it, plus the lanes that test it indirectly. For example, a change to the Teams module runs Teams, Organization, GraphQL, Realtime and Webhooks.
  • A change to tests/e2e/Services/<Name>/ runs that lane.
  • Docs, unit tests and CI files that aren't part of the pipeline run lint, static analysis and unit tests, but no e2e.
  • Any other file (composer files, compose files, app/init, shared libraries) still runs every lane. A gap in the map costs time, not coverage.

Release branches, which the nightly builds from, and manual runs still run everything. Every push to main runs every server lane, so PRs that each ran only some lanes are tested together after merge.

The map lives in .github/ci/e2e.json. It also replaces the service list that used to be inline in ci.yml. AGENTS.md now says to add new suites and paths there.

Effect

Replayed against the last 150 merged PRs:

PRs
Every lane, as today 86
Fewer lanes (1–16) 52
Lint and unit tests only 6
No server CI 6

That's 36% fewer e2e service lanes overall. The PRs that still run every lane touch shared code.

This PR touches the CI pipeline itself, so its own run uses every lane.

Related: #14299

Every server change ran all 31 service lanes and 5 grouped lanes, even
a fix confined to one module or a unit-test-only change. A declared map in
.github/ci/e2e.json now lists each lane with the module, controller,
worker and package paths it covers. changes.mjs selects the lanes whose
paths a PR touches and runs every lane for any file the map does not
claim. Docs, unit tests and CI files outside the pipeline itself run only
the checks.

Pushes, release branches and manual runs still test everything, since
the nightly ships the newest green commit on main. Replayed against the
last 150 merged PRs, the map cuts e2e service lanes by 36%.

The script replaces changes.sh and the Tests / Matrix job, and reads the
database version from composer.lock with git instead of the contents API.
@luxor-code-review

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

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)

  • 🟡 Database-version check now compares merge-base, not base tip — changes.mjs:113
🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Update stale changes.sh reference in apps/README.md (README.md) — This PR deletes .github/scripts/changes.sh, but apps/README.md:21 still links to it and describes it as the script deciding which suites a run needs.

The change moves CI lane selection from changes.sh into changes.mjs, which detects changed paths via git and emits JSON outputs (server, services, groups, checks, e2e, migrate) consumed by matrix/if conditions in ci.yml and console.yml. It also extends the lane-selection map in .github/ci/e2e.json and updates AGENTS.md to document the new detection behavior.

Files Change
.github/scripts/changes.sh / .github/scripts/changes.mjs Deletes the shell script and replaces it with a Node implementation that computes base-commit diffs, database-version changes, and per-lane outputs.
.github/workflows/ci.yml / .github/workflows/console.yml Rewires job conditions and matrix generation to consume the new JSON outputs from the changes step.
.github/ci/e2e.json Updates the e2e lane map (service paths, groups, ignore list) used for lane selection.
AGENTS.md Documents the new CI change-detection behavior and lane mapping.

One residual documentation reference to the deleted changes.sh was found in apps/README.md; see the findings. Risk is low overall: the change is confined to CI plumbing, though a regression here would silently skip or over-run e2e lanes, so the medium-severity base-commit comparison issue deserves a look.

Reviewed commit: bd94926

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 9, 2026
@ghost

ghost commented Oct 9, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The reviewed incremental change implements the stated push-coverage policy without introducing a correctness issue.

Adds a shared JSON coverage map and change selector to choose server, Console, and e2e checks from changed paths, while keeping full coverage for shared or unmapped changes and designated full-run events. CI workflows and contributor guidance now use the map, replacing the former shell selector. The latest update makes every push run all server lanes so main does not skip them.

Latest changes: The latest commit sets the server checks output for every push, which—alongside the existing push-wide lane selection—runs all server lanes on each push.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 6
File Change
.github/ci/e2e.json Defines path ownership for server e2e suites and grouped lanes.
.github/scripts/changes.mjs Maps changed paths and event types to CI outputs; the latest change enables all server lanes on every push.
.github/scripts/changes.sh Removes the former shell-based change selector.
.github/workflows/ci.yml Uses selector outputs to gate server checks and create e2e matrices.
.github/workflows/console.yml Uses the shared selector to gate Console checks and e2e.
AGENTS.md Documents how to maintain the e2e coverage map as suites and paths are added.

Reviewed the commits since 7935538 · 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 A · See the inline comments. Summary

Comment thread .github/scripts/changes.mjs Resolved
@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.

@luxor-code-review luxor-code-review Bot 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.

This PR replaces the shell-based CI change-detection script (changes.sh) with a Node script (changes.mjs) that computes which e2e lanes, console checks, and database-migration jobs a run needs, wiring the outputs into ci.yml and console.yml and updating the lane map in ci/e2e.json.

Key findings

  • 🟡 Database-version check now compares merge-base, not base tip — changes.mjs:113

Comment thread .github/scripts/changes.mjs Resolved
The merge-base diff counted commits that landed on the base branch after
the PR forked, which widened lane selection and could flag a database
version bump the PR did not make. The checkout's merge commit has the base
tip as its first parent, so diff against that.
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → ci/affected-lanes (after).

Metric Before After Change
🚀 Requests/sec 207.94 209.14 ⚪ +0.6%
⏱️ Latency P50 81.43 ms 83.82 ms ⚪ +2.9%
⏱️ Latency P95 196.78 ms 187.09 ms ⚪ -4.9%
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 83.82 187.09 13,053 209.14 -9.69
Account 157.91 280.64 687 11.37 -9.66
TablesDB 80.7 142.67 7,099 116.08 -7.3
Storage 78.94 170.09 3,435 58.19 +10.61
Functions 117.2 214.19 1,832 31.82 -14.09

Top API waits (after)

API request Max wait (ms)
functions.create 478.99
account.name.update 393.63
account.prefs.update 344.28
storage.files.delete 325.88
functions.variables.update 320.37

The nightly builds from release branches, which always test everything, so
main pushes run every lane to check merged PRs together, not for the nightly.

@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

A docs-only or console-only push after a failed server push reported a green
tip on main while skipping e2e. Push runs are post-merge, so nobody waits on
them, and such pushes are rare.
@ChiragAgg5k
ChiragAgg5k merged commit af13246 into main Oct 9, 2026
121 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the ci/affected-lanes branch October 9, 2026 13:19
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