Skip to content

[AISAGE-503] feat(gateway): enqueue finalized usage in background shadow mode #11954

[AISAGE-503] feat(gateway): enqueue finalized usage in background shadow mode

[AISAGE-503] feat(gateway): enqueue finalized usage in background shadow mode #11954

Workflow file for this run

name: kilo-app CI
# The mobile suite jobs are required checks on main, so this workflow runs on
# every PR and every main push (no path filters) and the `mobile-changes` job
# gates the suite work. An unrelated PR or push still reports the suite checks
# as skipped (a skipped job satisfies a required check) instead of leaving them
# "Expected". The release workflow re-runs the suite through `workflow_call`.
on:
push:
branches: [main]
pull_request:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Always runs: the required suite checks must report on every PR and every
# main push. The detection step diffs against the PR's base sha or, on a main
# push, `github.event.before`; when neither is available (workflow_dispatch
# release), the suite runs (a release must validate).
mobile-changes:
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 5
outputs:
mobile: ${{ steps.detect.outputs.mobile }}
steps:
# Full history so the change-detection step can diff against the PR's
# base sha or the pushed commit's parent.
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
- name: Install root dependencies
run: pnpm --filter kilocode-monorepo install --frozen-lockfile --ignore-scripts
# The stacked-CI admission wiring must be checked on every PR, before the
# suite is gated.
- name: Check stacked CI admission
run: node --test scripts/stacked-ci.test.mjs
# The suite jobs always report (required checks); only the suite's own
# paths justify the heavy work. The patterns are pinned by
# scripts/stacked-ci.test.mjs.
- name: Detect mobile-relevant changes
id: detect
run: |
set -euo pipefail
# On a PR, diff against the base sha; on a main push (or a
# workflow_call riding a push event), diff against
# `github.event.before`. If neither object is available, run the
# suite rather than skip it: a false "no changes" would break the
# required checks' promise, while a redundant run is harmless.
base="${{ github.event.pull_request.base.sha }}"
if ! git rev-parse --verify "${base}^{commit}" > /dev/null 2>&1; then
base="${{ github.event.before }}"
fi
if ! git rev-parse --verify "${base}^{commit}" > /dev/null 2>&1; then
echo "mobile=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "$base" HEAD \
| grep -Eq '^apps/mobile/|^packages/trpc/|^apps/web/src/routers/|^packages/web-shared/src/routers/|^packages/app-shared/|^packages/kilo-chat/|^packages/kilo-chat-hooks/|^packages/event-service/|^packages/notifications/|^packages/cloud-agent-sdk/|^pnpm-lock\.yaml$|^\.github/workflows/kilo-app-ci\.yml$|^\.github/workflows/ci\.yml$|^scripts/stacked-ci\.test\.mjs$'; then
echo "mobile=true" >> "$GITHUB_OUTPUT"
else
echo "mobile=false" >> "$GITHUB_OUTPUT"
fi
typecheck:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build trpc types
run: pnpm --filter @kilocode/trpc run build
- name: Typecheck
run: pnpm --filter kilo-app run typecheck
# The release preflight is the only other job that evaluates app.config.ts,
# and it runs nightly. Read the config here so a broken import fails the PR.
- name: Read Expo config
run: pnpm --filter kilo-app exec expo config --type public > /dev/null
lint:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build trpc types
run: pnpm --filter @kilocode/trpc run build
- name: Lint
run: pnpm --filter kilo-app run lint
i18n-leftover:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build trpc types
run: pnpm --filter @kilocode/trpc run build
- name: Check i18n catalogs and leftover copy
run: pnpm --filter kilo-app run check:i18n
- name: Check for silently-dropped NativeWind classes
run: pnpm --filter kilo-app run check:classes
format-check:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Format check
run: |
pnpm --filter kilo-app run format:check || {
echo "::error::oxfmt formatting check failed. Run 'cd apps/mobile && pnpm format' locally and commit the changes."
exit 1
}
check-unused:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check unused exports
run: pnpm --filter kilo-app run check:unused
test:
needs: mobile-changes
if: needs.mobile-changes.outputs.mobile == 'true'
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build trpc types
run: pnpm --filter @kilocode/trpc run build
- name: Test
run: pnpm --filter kilo-app run test