Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .github/workflows/closura-arc-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
# A founder's edit reruns the full job. An edit by anyone else (for example
# CodeRabbit rewriting the description) starts a run whose job is skipped;
# the concurrency group below keeps it from cancelling the real run.
types: [opened, synchronize, reopened, edited]
# Draft pull requests skip the three ARC workers, so parked drafts use no
# ARC time. `ready_for_review` starts the full run when a draft is marked ready.
types: [opened, synchronize, reopened, edited, ready_for_review]
branches: [feat/assemblyai-current, release/native-0.1.10]
workflow_dispatch:

Expand Down Expand Up @@ -43,6 +45,7 @@ jobs:
github.repository == 'nullStack65/t3code' &&
(
(github.event_name == 'pull_request' &&
!github.event.pull_request.draft &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login) &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) &&
Expand Down Expand Up @@ -196,6 +199,7 @@ jobs:
github.repository == 'nullStack65/t3code' &&
(
(github.event_name == 'pull_request' &&
!github.event.pull_request.draft &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login) &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) &&
Expand Down Expand Up @@ -273,6 +277,7 @@ jobs:
github.repository == 'nullStack65/t3code' &&
(
(github.event_name == 'pull_request' &&
!github.event.pull_request.draft &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login) &&
contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) &&
Expand Down Expand Up @@ -453,13 +458,25 @@ jobs:
# the previous in-progress run on every new push, so that would mark the
# required check green for a run whose tests never ran. `!cancelled()` still
# runs when a worker failed or was skipped.
#
# On a draft pull request the workers are skipped and this job fails at its
# first step, so the required check stays red until the full run passes. It
# reads only the event payload there, so it uses a free hosted runner (this
# repository is public) and never wakes an ARC runner for a parked draft.
voice-and-inbox:
name: Voice + founder inbox (Linux ARC)
needs: [voice-and-inbox-core, voice-and-inbox-web, voice-and-inbox-mobile]
if: ${{ !cancelled() }}
runs-on: t3code-ci-arc
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft && 'ubuntu-latest' || 't3code-ci-arc' }}
timeout-minutes: 5
steps:
- name: Hold drafts until ready for review
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft }}
shell: bash
run: |
echo "::error::Draft pull request: the ARC workers run when it is marked ready for review."
exit 1

- name: Checkout trusted source (no persistent credentials)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
55 changes: 55 additions & 0 deletions .vite-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Runs CI's fast checks (`vp run check:changed`) on what this push changes, so a
# format, lint, knip, typecheck or nearby-test failure stops here instead of
# costing an ARC run. `pnpm install` wires this hook through `vp config`.
#
# Skip once: `git push --no-verify` (or VP_GIT_HOOKS=0 git push).
# Choose the comparison base: T3_PRE_PUSH_BASE=<ref> git push.
#
# The Vite+ dispatcher runs this file with `sh -e`, so keep it POSIX sh.

zero=0000000000000000000000000000000000000000
remote="${1:-origin}"
head_sha=$(git rev-parse HEAD)
check=""
# Only branch updates are checked; tags and deletions are not.
while read -r _local_ref local_sha remote_ref _remote_sha; do
case "$remote_ref" in refs/heads/*) ;; *) continue ;; esac
[ "$local_sha" = "$zero" ] && continue
if [ "$local_sha" = "$head_sha" ]; then
check=1
else
echo "pre-push: $remote_ref is not being pushed from the checked-out commit; not checked locally (CI still runs)."
fi
done
[ -n "$check" ] || exit 0

# check:changed needs the Node version in package.json `engines` (it runs .ts
# directly). An older Node is a setup gap, not a code failure: say so and let
# CI do the checking rather than blocking every push from that machine.
want=$(sed -n 's/^ *"node": *"\([0-9]*\)\..*/\1/p' package.json | head -n 1)
have=$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)
if [ -n "$want" ] && [ "$have" -lt "$want" ]; then
echo "pre-push: WARNING skipped checks: Node $have is older than engines Node $want. Run \`vp env use\` or install Node $want."
exit 0
fi

# Compare against the release or main line of the push remote that this branch
# is closest to (fewest commits ahead), the same base its pull request will use.
base="${T3_PRE_PUSH_BASE:-}"
if [ -z "$base" ]; then
best=""
for ref in $(git for-each-ref --format='%(refname)' \
"refs/remotes/$remote/release/" "refs/remotes/$remote/main"); do
ahead=$(git rev-list --count "$ref..HEAD" 2>/dev/null) || continue
if [ -z "$best" ] || [ "$ahead" -lt "$best" ]; then
best=$ahead
base=$ref
fi
done
fi
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
echo "pre-push: note: uncommitted changes are included in the check."
fi
# With no base found, check:changed falls back to the nearest remote main.
echo "pre-push: vp run check:changed ${base:-<nearest remote main>}"
vp run check:changed ${base:+"$base"}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real

## Verifying

- Before you push, run `vp run check:changed`. It runs CI's fast checks for changed files: format, lint, knip, typecheck of affected packages and dependents, tests beside changes, and the cross-file checks those miss. CI still runs the full test suites.
- Before you push, run `vp run check:changed`. It runs CI's fast checks for changed files: format, lint, knip, typecheck of affected packages and dependents, tests beside changes, and the cross-file checks those miss. CI still runs the full test suites. The pre-push hook runs it on `git push`.
- While you iterate, run `vp test run <files>`. For big files, add `-t "<name>"`.
- Use `vp run typecheck`; it caches per package. Each package runs `effect-tsgo tsrs --noEmit`, the Rust TypeScript 7 checker with Effect's diagnostics built in. There is no `typescript` package to run.
- Run `node -e` snippets from `apps/server` or the owning package. `effect` does not resolve from the repo root.
Expand Down
Loading