Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🚦 ci: Throttle Codegraph E2E Votes to One Run per Window (#17380)

Danny Avila38c96a5e3a53
diff --git a/.github/scripts/vote-gate.mjs b/.github/scripts/vote-gate.mjs
new file mode 100644
index 0000000000..674312aadc
--- /dev/null
+++ b/.github/scripts/vote-gate.mjs
@@ -0,0 +1,228 @@
+#!/usr/bin/env node
+/**
+ * Codegraph E2E vote gate: whether a merge to dev, or the hourly catch-up, starts a vote run.
+ *
+ * A vote (codegraph-e2e-votes.yml) runs the whole mock suite on ten runners, about 154
+ * job-minutes, and its shards queue for the same runners as PR CI. With repo variable
+ * CODEGRAPH_E2E_VOTE_MIN_HOURS set to N > 0, the votes workflow hands its push runs to this gate
+ * (codegraph-e2e-vote-gate.yml), which starts the votes workflow on dev at most once per N hours:
+ *
+ * - Nothing starts while a vote already covers the newest merge: a run created after that merge
+ * was pushed, or on its commit, that is queued, running or finished with shards that could
+ * report (success or failure). A vote checks out dev's head when it is created, so it holds
+ * every merge before it. A cancelled run is no trial (the codegraph shadow records none), so
+ * it covers nothing. Neither is a push run that has not finished: while throttled it is the
+ * merge's own handoff, created beside this gate's run, whose vote job will be skipped.
+ * - Otherwise a vote starts once the newest started vote is N hours old. A merge inside the
+ * window waits, and the hourly catch-up starts the vote for the newest merge once the window
+ * opens, so the last merge of a burst is voted within about N + 1 hours even when nothing
+ * merges after it. Every started run holds the window, cancelled ones too, so a vote that
+ * keeps failing to finish is retried at most once per N hours. A handoff still in flight
+ * started no vote, so it holds nothing. (A push run that was already voting when the
+ * variable was set is read as a handoff too; the vote the gate starts then waits behind it.)
+ * - While the catch-up has not run for CATCHUP_LIVE_HOURS (its workflow is not on the default
+ * branch yet, or GitHub stopped scheduling it), a merge starts a vote as before: the gate never
+ * holds back a merge it cannot come back for. A push whose history cannot be read fails open
+ * the same way.
+ *
+ * "The newest merge" is the gate's newest push run: the gate shares the votes workflow's path
+ * filter, so a docs-only merge is never voted on its own. Unset, empty or 0 is today's behavior:
+ * the votes workflow votes every merge itself and the gate job is skipped. A value that is not a
+ * number of hours makes every merge vote through the gate, with a warning.
+ */
+import { appendFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+
+const HOUR = 3_600_000;
+/** The catch-up runs hourly; three hours without one tolerates two runs GitHub delays or drops. */
+export const CATCHUP_LIVE_HOURS = 3;
+export const VOTES_FILE = 'codegraph-e2e-votes.yml';
+export const GATE_FILE = 'codegraph-e2e-vote-gate.yml';
+const BRANCH = 'dev';
+
+/** Hours from the variable: 0 when unset or empty, null when it is not a non-negative number. */
+export function parseMinHours(raw) {
+ const text = String(raw ?? '').trim();
+ if (text === '') {
+ return 0;
+ }
+ return /^\d+(\.\d+)?$/.test(text) ? Number(text) : null;
+}
+
+/** Every run started a vote except one whose vote job was skipped (a handed-off push, the kill switch). */
+export const startedVote = (run) => !(run.status === 'completed' && run.conclusion === 'skipped');
+
+/** A run that is or will be a trial: queued or running, or finished with shards that could report. */
+export const isTrial = (run) =>
+ run.status !== 'completed' || run.conclusion === 'success' || run.conclusion === 'failure';
+
+/** While throttled, an unfinished push run is a handoff: its vote job will be skipped. */
+export const handoffInFlight = (run) => run.event === 'push' && run.status !== 'completed';
+
+const ms = (iso) => Date.parse(iso);
+const stamp = (t) => new Date(t).toISOString().replace(/\.\d{3}Z$/, 'Z');
+const hours = (t) => Math.round((t / HOUR) * 10) / 10;
+const state = (run) => (run.status === 'completed' ? run.conclusion : run.status);
+
+/**
+ * The decision, pure.
+ * event 'push' (a merge) or anything else (the catch-up)
+ * minHours N; 0 means no throttle
+ * now epoch milliseconds
+ * runs the votes workflow's runs on dev, any event and status
+ * merge the newest push to dev that the votes path filter matches, { sha, at }, or null
+ * catchupAt when the catch-up last ran (ISO), or null
+ */
+export function decide({ event, minHours, now, runs, merge, catchupAt }) {
+ if (!(minHours > 0)) {
+ return event === 'push'
+ ? { dispatch: true, reason: 'no throttle: every merge votes' }
+ : { dispatch: false, reason: 'no throttle: merges vote themselves' };
+ }
+ if (!merge) {
+ return { dispatch: false, reason: 'no merge on record' };
+ }
+ const votes = runs.filter((run) => !handoffInFlight(run));
+ const covering = votes.find(
+ (run) => isTrial(run) && (run.head_sha === merge.sha || ms(run.created_at) > ms(merge.at)),
+ );
+ if (covering) {
+ return {
+ dispatch: false,
+ reason: `run ${covering.id} (${state(covering)}) already covers ${merge.sha.slice(0, 10)}`,
+ };
+ }
+ const last = votes
+ .filter(startedVote)
+ .reduce(
+ (newest, run) => (!newest || ms(run.created_at) > ms(newest.created_at) ? run : newest),
+ null,
+ );
+ const opens = last ? ms(last.created_at) + minHours * HOUR : -Infinity;
+ if (now >= opens) {
+ return {
+ dispatch: true,
+ reason: last
+ ? `the newest vote, run ${last.id}, started ${hours(now - ms(last.created_at))} h ago (window ${minHours} h)`
+ : 'no vote on record',
+ };
+ }
+ const live = catchupAt != null && now - ms(catchupAt) <= CATCHUP_LIVE_HOURS * HOUR;
+ if (event === 'push' && !live) {
+ return {
+ dispatch: true,
+ reason: `the hourly catch-up has not run in ${CATCHUP_LIVE_HOURS} h, so the throttle holds nothing back`,
+ };
+ }
+ return {
+ dispatch: false,
+ reason: `throttled: run ${last.id} started at ${last.created_at}; the next vote may start at ${stamp(opens)}`,
+ };
+}
+
+function client({ GITHUB_API_URL = 'https://api.github.com', GITHUB_REPOSITORY, GH_TOKEN }) {
+ const request = async (method, path, body) => {
+ const res = await fetch(`${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/${path}`, {
+ method,
+ headers: {
+ accept: 'application/vnd.github+json',
+ authorization: `Bearer ${GH_TOKEN}`,
+ 'x-github-api-version': '2022-11-28',
+ ...(body ? { 'content-type': 'application/json' } : {}),
+ },
+ body: body ? JSON.stringify(body) : undefined,
+ signal: AbortSignal.timeout(30_000),
+ });
+ if (!res.ok) {
+ throw new Error(`${method} ${path.split('?')[0]}: HTTP ${res.status}`);
+ }
+ return res.status === 204 ? null : res.json();
+ };
+ const runs = async (file, query) => {
+ const page = await request(
+ 'GET',
+ `actions/workflows/${file}/runs?${query}&exclude_pull_requests=true`,
+ );
+ return (page?.workflow_runs ?? []).map(
+ ({ id, event, status, conclusion, created_at, head_sha }) => ({
+ id,
+ event,
+ status,
+ conclusion,
+ created_at,
+ head_sha,
+ }),
+ );
+ };
+ const dispatch = () =>
+ request('POST', `actions/workflows/${VOTES_FILE}/dispatches`, { ref: BRANCH });
+ return { runs, dispatch };
+}
+
+const sleep = (t) => new Promise((done) => setTimeout(done, t));
+
+async function main(env = process.env) {
+ const event = env.GITHUB_EVENT_NAME;
+ const parsed = parseMinHours(env.MIN_HOURS);
+ if (parsed === null) {
+ console.log(
+ `::warning::CODEGRAPH_E2E_VOTE_MIN_HOURS=${JSON.stringify(env.MIN_HOURS)} is not a number of hours; every merge votes`,
+ );
+ }
+ const gh = client(env);
+ let runs = null;
+ let decision;
+ try {
+ const [voteRuns, pushes, schedules] = await Promise.all([
+ gh.runs(VOTES_FILE, `branch=${BRANCH}&per_page=100`),
+ gh.runs(GATE_FILE, `branch=${BRANCH}&event=push&per_page=1`),
+ gh.runs(GATE_FILE, 'event=schedule&per_page=1'),
+ ]);
+ runs = voteRuns;
+ const merge = pushes[0] ? { sha: pushes[0].head_sha, at: pushes[0].created_at } : null;
+ const catchupAt = schedules[0]?.created_at ?? null;
+ decision = decide({ event, minHours: parsed ?? 0, now: Date.now(), runs, merge, catchupAt });
+ } catch (error) {
+ if (event !== 'push') {
+ throw error;
+ }
+ decision = {
+ dispatch: true,
+ reason: `the vote history could not be read (${error.message}); failing open`,
+ };
+ }
+ const line = `codegraph-vote-gate: ${decision.dispatch ? 'vote' : 'no vote'} (${event}): ${decision.reason}`;
+ console.log(line);
+ if (env.GITHUB_STEP_SUMMARY) {
+ appendFileSync(env.GITHUB_STEP_SUMMARY, `${line}\n`);
+ }
+ if (!decision.dispatch) {
+ return;
+ }
+ await gh.dispatch();
+ if (!runs) {
+ return;
+ }
+ /* The next gate decides from the run list, so wait until the new run is in it. */
+ const known = new Set(runs.map((run) => run.id));
+ for (let i = 0; i < 12; i++) {
+ await sleep(5_000);
+ const fresh = await gh.runs(VOTES_FILE, `branch=${BRANCH}&event=workflow_dispatch&per_page=5`);
+ const run = fresh.find((candidate) => !known.has(candidate.id));
+ if (run) {
+ console.log(`codegraph-vote-gate: started run ${run.id} on ${run.head_sha.slice(0, 10)}`);
+ return;
+ }
+ }
+ console.log(
+ '::warning::the vote run did not appear within 60 s; a gate that decides before it does may start another',
+ );
+}
+
+if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
+ main().catch((error) => {
+ console.error(`codegraph-vote-gate: ${error.message}`);
+ process.exit(1);
+ });
+}
diff --git a/.github/scripts/vote-gate.test.mjs b/.github/scripts/vote-gate.test.mjs
new file mode 100644
index 0000000000..92c9f4e940
--- /dev/null
+++ b/.github/scripts/vote-gate.test.mjs
@@ -0,0 +1,196 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { CATCHUP_LIVE_HOURS, decide, parseMinHours } from './vote-gate.mjs';
+
+const HOUR = 3_600_000;
+const NOW = Date.parse('2026-10-23T12:00:00Z');
+const ago = (h) => new Date(NOW - h * HOUR).toISOString();
+
+let nextId = 1;
+/** A votes-workflow run created `h` hours before NOW. */
+function run(
+ h,
+ {
+ status = 'completed',
+ conclusion = 'success',
+ sha = `sha-${h}`,
+ event = 'workflow_dispatch',
+ } = {},
+) {
+ return { id: nextId++, event, status, conclusion, created_at: ago(h), head_sha: sha };
+}
+
+/** The newest merge, pushed `h` hours before NOW. */
+const merge = (h, sha = 'merge-sha') => ({ sha, at: ago(h) });
+
+const base = { minHours: 2, now: NOW, catchupAt: ago(0.5) };
+
+test('parseMinHours: unset, empty and 0 mean no throttle; anything but hours is invalid', () => {
+ assert.equal(parseMinHours(undefined), 0);
+ assert.equal(parseMinHours(''), 0);
+ assert.equal(parseMinHours(' 0 '), 0);
+ assert.equal(parseMinHours('2'), 2);
+ assert.equal(parseMinHours('2.5'), 2.5);
+ assert.equal(parseMinHours('2h'), null);
+ assert.equal(parseMinHours('-1'), null);
+ assert.equal(parseMinHours('off'), null);
+});
+
+test('no throttle: a merge votes and the catch-up starts nothing', () => {
+ const runs = [run(0.1, { sha: 'merge-sha' })];
+ assert.equal(
+ decide({ ...base, minHours: 0, event: 'push', runs, merge: merge(0) }).dispatch,
+ true,
+ );
+ assert.equal(
+ decide({ ...base, minHours: 0, event: 'schedule', runs: [], merge: merge(5) }).dispatch,
+ false,
+ );
+});
+
+test('a merge inside the window waits while the catch-up is live', () => {
+ const decision = decide({ ...base, event: 'push', runs: [run(1)], merge: merge(0) });
+ assert.equal(decision.dispatch, false);
+ assert.match(decision.reason, /next vote may start at 2026-10-23T13:00:00Z/);
+});
+
+test('a merge votes once the newest started vote is N hours old', () => {
+ assert.equal(decide({ ...base, event: 'push', runs: [run(2)], merge: merge(0) }).dispatch, true);
+ assert.equal(decide({ ...base, event: 'push', runs: [], merge: merge(0) }).dispatch, true);
+});
+
+test('a merge votes as before while the catch-up is not running', () => {
+ const runs = [run(1)];
+ const never = decide({ ...base, event: 'push', runs, merge: merge(0), catchupAt: null });
+ assert.equal(never.dispatch, true);
+ const stale = decide({
+ ...base,
+ event: 'push',
+ runs,
+ merge: merge(0),
+ catchupAt: ago(CATCHUP_LIVE_HOURS + 0.1),
+ });
+ assert.equal(stale.dispatch, true);
+});
+
+test('the catch-up votes the last merge of a burst once the window opens, and not before', () => {
+ const runs = [run(2.2), run(3)];
+ assert.equal(decide({ ...base, event: 'schedule', runs, merge: merge(1) }).dispatch, true);
+ assert.equal(
+ decide({ ...base, event: 'schedule', runs: [run(1.5)], merge: merge(1) }).dispatch,
+ false,
+ );
+});
+
+test('a vote created after the newest merge, or on its commit, covers it', () => {
+ for (const covering of [
+ run(0.5),
+ run(0.5, { status: 'queued', conclusion: null }),
+ run(0.5, { status: 'in_progress', conclusion: null }),
+ run(0.5, { conclusion: 'failure' }),
+ run(0.5, { event: 'push' }),
+ run(3, { sha: 'merge-sha' }),
+ ]) {
+ const decision = decide({ ...base, event: 'schedule', runs: [covering], merge: merge(1) });
+ assert.equal(
+ decision.dispatch,
+ false,
+ `${covering.status}/${covering.conclusion} at ${covering.created_at}`,
+ );
+ assert.match(decision.reason, /already covers/);
+ }
+});
+
+test('a handed-off push run neither holds the window nor covers the merge', () => {
+ const handoff = run(0.2, { conclusion: 'skipped', sha: 'merge-sha', event: 'push' });
+ const decision = decide({ ...base, event: 'push', runs: [handoff, run(3)], merge: merge(0.2) });
+ assert.equal(decision.dispatch, true);
+});
+
+test('a handoff still in flight neither covers its merge nor holds the window', () => {
+ for (const status of ['queued', 'in_progress']) {
+ const handoff = run(0, { status, conclusion: null, sha: 'merge-sha', event: 'push' });
+ const decision = decide({ ...base, event: 'push', runs: [handoff, run(3)], merge: merge(0) });
+ assert.equal(decision.dispatch, true, `${status}: ${decision.reason}`);
+ }
+ const earlier = run(0.2, { status: 'in_progress', conclusion: null, sha: 'prev', event: 'push' });
+ const decision = decide({
+ ...base,
+ event: 'schedule',
+ runs: [earlier, run(3)],
+ merge: merge(0.1),
+ });
+ assert.equal(decision.dispatch, true, decision.reason);
+});
+
+test('a cancelled vote covers nothing but holds the window, so it is retried once per window', () => {
+ const cancelled = run(1, { conclusion: 'cancelled' });
+ const inside = decide({ ...base, event: 'schedule', runs: [cancelled], merge: merge(1.5) });
+ assert.equal(inside.dispatch, false);
+ assert.match(inside.reason, /throttled/);
+ const after = decide({
+ ...base,
+ event: 'schedule',
+ runs: [run(2.5, { conclusion: 'cancelled' })],
+ merge: merge(3),
+ });
+ assert.equal(after.dispatch, true);
+});
+
+test('the catch-up starts nothing before any merge is on record', () => {
+ assert.equal(decide({ ...base, event: 'schedule', runs: [], merge: null }).dispatch, false);
+});
+
+/**
+ * A day of merges every 20 minutes from 08:00 to 20:00 UTC, then quiet: every vote is at least N
+ * hours after the one before, and the last merge is voted by the catch-up within N + 1 hours.
+ */
+test('a burst: votes keep the window, and the catch-up votes its tail', () => {
+ const N = 2;
+ const day = Date.parse('2026-10-23T00:00:00Z');
+ const pushes = Array.from({ length: 37 }, (_, i) => ({
+ t: day + 8 * HOUR + i * 20 * 60_000,
+ sha: `m${i}`,
+ }));
+ const ticks = Array.from({ length: 24 }, (_, h) => ({
+ t: day + h * HOUR + 17 * 60_000,
+ schedule: true,
+ }));
+ const events = [...pushes, ...ticks].sort((a, b) => a.t - b.t);
+ const runs = [];
+ let newest = null;
+ for (const e of events) {
+ if (!e.schedule) {
+ newest = { sha: e.sha, at: new Date(e.t).toISOString() };
+ }
+ const event = e.schedule ? 'schedule' : 'push';
+ const decision = decide({
+ event,
+ minHours: N,
+ now: e.t,
+ runs,
+ merge: newest,
+ catchupAt: new Date(e.t - HOUR).toISOString(),
+ });
+ if (decision.dispatch) {
+ runs.unshift({
+ id: runs.length + 1,
+ status: 'completed',
+ conclusion: 'success',
+ created_at: new Date(e.t + 1_000).toISOString(),
+ head_sha: newest.sha,
+ });
+ }
+ }
+ const starts = runs.map((r) => Date.parse(r.created_at)).reverse();
+ for (let i = 1; i < starts.length; i++) {
+ assert.ok(
+ starts[i] - starts[i - 1] >= N * HOUR,
+ `vote ${i} started ${(starts[i] - starts[i - 1]) / HOUR} h after the one before`,
+ );
+ }
+ const lastMerge = pushes[pushes.length - 1];
+ assert.equal(runs[0].head_sha, lastMerge.sha);
+ assert.ok(starts[starts.length - 1] - lastMerge.t <= (N + 1) * HOUR);
+ assert.equal(starts.length, 7);
+});
diff --git a/.github/workflows/codegraph-e2e-vote-gate.yml b/.github/workflows/codegraph-e2e-vote-gate.yml
new file mode 100644
index 0000000000..c9383702a7
--- /dev/null
+++ b/.github/workflows/codegraph-e2e-vote-gate.yml
@@ -0,0 +1,64 @@
+# Codegraph E2E vote gate — starts codegraph-e2e-votes.yml at most once per N hours.
+#
+# A vote runs the whole mock suite on ten runners (about 154 job-minutes) and queues beside PR CI
+# for the same runners. Run on every merge, the votes cost 2,227 job-minutes on 2026-10-22. With
+# repo variable CODEGRAPH_E2E_VOTE_MIN_HOURS set to N > 0, the votes workflow skips its push runs
+# and this gate decides instead, from the votes workflow's run list:
+#
+# push a merge starts a vote when the newest started vote is at least N hours old;
+# schedule hourly, the catch-up starts one for the newest merge no vote covers yet once the
+# window opens, so the last merge of a burst is voted within about N + 1 hours.
+#
+# While the catch-up has not run for three hours (this file is not on the default branch yet, where
+# GitHub reads schedules, or GitHub stopped scheduling it), every merge votes as before. The rules
+# and their reasons are in .github/scripts/vote-gate.mjs. The gate shares the votes workflow's path
+# filter, so the merges it sees are the ones that used to start a vote.
+#
+# Unset, empty or 0 is today's behavior: every merge votes through the votes workflow's own push
+# trigger and the job below is skipped. CODEGRAPH_E2E_VOTES=off still stops everything.
+name: Codegraph E2E Vote Gate
+
+on:
+ push:
+ branches:
+ - dev
+ paths:
+ - '**'
+ - '!**.md'
+ - '!.github/workflows/**'
+ - '.github/workflows/codegraph-e2e-votes.yml'
+ - '.github/workflows/codegraph-e2e-vote-gate.yml'
+ schedule:
+ - cron: '17 * * * *'
+
+permissions: {}
+
+# One decision at a time, so a merge and the catch-up never both start a vote for the same window.
+concurrency:
+ group: codegraph-e2e-vote-gate
+ cancel-in-progress: false
+
+jobs:
+ gate:
+ name: Gate
+ if: >-
+ vars.CODEGRAPH_E2E_VOTES != 'off' &&
+ vars.CODEGRAPH_E2E_VOTE_MIN_HOURS != '' &&
+ vars.CODEGRAPH_E2E_VOTE_MIN_HOURS != '0'
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ permissions:
+ actions: write # list both workflows' runs; start the votes workflow on dev
+ contents: read # check out the gate script
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ persist-credentials: false
+ sparse-checkout: .github/scripts/vote-gate.mjs
+ sparse-checkout-cone-mode: false
+
+ - name: Decide, and start a vote when one is owed
+ env:
+ GH_TOKEN: ${{ github.token }}
+ MIN_HOURS: ${{ vars.CODEGRAPH_E2E_VOTE_MIN_HOURS }}
+ run: node .github/scripts/vote-gate.mjs
diff --git a/.github/workflows/codegraph-e2e-votes.yml b/.github/workflows/codegraph-e2e-votes.yml
index e46b18f372..68b2771c1f 100644
--- a/.github/workflows/codegraph-e2e-votes.yml
+++ b/.github/workflows/codegraph-e2e-votes.yml
@@ -1,9 +1,17 @@
# Codegraph e2e VOTES — observe-only, post-merge, time-boxed.
#
# Playwright never runs on pushes to dev, so evidence for the e2e skip election would
-# otherwise wait on rare organic PR spec failures. This workflow runs the FULL mock suite on
-# every merge: each run is one graduation trial for every spec it executes, and doubles as
-# the post-merge safety net the jest workflows already have via their dev-push triggers.
+# otherwise wait on rare organic PR spec failures. This workflow runs the FULL mock suite after
+# merges: each run is one graduation trial for every spec it executes, and doubles as the
+# post-merge safety net the jest workflows already have via their dev-push triggers.
+#
+# By default every merge votes (the push trigger). Each run costs about 154 job-minutes on ten
+# runners, so with repo variable CODEGRAPH_E2E_VOTE_MIN_HOURS set to N > 0 a push run votes
+# nothing: its job is skipped and codegraph-e2e-vote-gate.yml starts this workflow on dev
+# (workflow_dispatch) at most once per N hours, catching up hourly on the newest merge once the
+# window opens (rules in .github/scripts/vote-gate.mjs). A handed-off push run takes a
+# concurrency group of its own, so it neither waits behind a vote nor replaces the pending one.
+# Leave run-name unset: the codegraph shadow matches vote runs by this workflow's name.
#
# It previously ran only the merged PR's skippable tier, passing the tier as CLI path
# filters. playwright.config.mock.ts scopes discovery to testDir specs/mock/, so tier
@@ -48,12 +56,14 @@ on:
- '!**.md'
- '!.github/workflows/**'
- '.github/workflows/codegraph-e2e-votes.yml'
+ - '.github/workflows/codegraph-e2e-vote-gate.yml'
+ workflow_dispatch:
permissions:
contents: read
concurrency:
- group: codegraph-e2e-votes
+ group: ${{ github.event_name == 'push' && vars.CODEGRAPH_E2E_VOTE_MIN_HOURS != '' && vars.CODEGRAPH_E2E_VOTE_MIN_HOURS != '0' && format('codegraph-e2e-votes-handoff-{0}', github.run_id) || 'codegraph-e2e-votes' }}
cancel-in-progress: false
env:
@@ -63,7 +73,11 @@ env:
jobs:
vote:
name: vote (shard ${{ matrix.shard }}/10)
- if: vars.CODEGRAPH_E2E_VOTES != 'off'
+ # A push run votes only while the throttle is off; with it on, the gate starts the votes.
+ if: >-
+ vars.CODEGRAPH_E2E_VOTES != 'off' &&
+ github.ref == 'refs/heads/dev' &&
+ (github.event_name != 'push' || vars.CODEGRAPH_E2E_VOTE_MIN_HOURS == '' || vars.CODEGRAPH_E2E_VOTE_MIN_HOURS == '0')
runs-on: ubuntu-latest
# Sized from e2e/timings.mock.json: 6,151 recorded seconds over 10 shards plans ~10.3 min
# of tests per shard. PR CI's memory shards (same plan, same workers: 1) ran their test
diff --git a/.github/workflows/playwright-mock.yml b/.github/workflows/playwright-mock.yml
index 59aef8185a..02b2313210 100644
--- a/.github/workflows/playwright-mock.yml
+++ b/.github/workflows/playwright-mock.yml
@@ -222,8 +222,8 @@ jobs:
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- - name: Test Playwright matrix selection
- run: node --test .github/scripts/playwright-matrix.test.mjs .github/scripts/playwright-shards.test.mjs
+ - name: Test Playwright matrix selection and the vote gate
+ run: node --test .github/scripts/playwright-matrix.test.mjs .github/scripts/playwright-shards.test.mjs .github/scripts/vote-gate.test.mjs
- name: Restore data-provider build cache
id: cache-data-provider