Skip to content

Commit 74df803

Browse files
authored
Merge branch 'develop' into cg/spanfirst-send-http-client
2 parents 488f4de + fae6a7d commit 74df803

50 files changed

Lines changed: 2268 additions & 365 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/write-tests/SKILL.md

Lines changed: 407 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Nx Affected List'
2+
description: 'Outputs a space-separated list of Nx projects affected by changes between base and head commits.'
3+
4+
inputs:
5+
base:
6+
description: 'Base commit SHA'
7+
required: false
8+
head:
9+
description: 'Head commit SHA'
10+
required: false
11+
12+
outputs:
13+
affected:
14+
description: 'Space-separated list of affected project names'
15+
value: ${{ steps.affected.outputs.affected }}
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Get affected Nx projects
21+
id: affected
22+
shell: bash
23+
env:
24+
INPUT_BASE: ${{ inputs.base }}
25+
INPUT_HEAD: ${{ inputs.head }}
26+
run: |
27+
set -euo pipefail
28+
extra_args=()
29+
if [ -n "${INPUT_BASE:-}" ]; then extra_args+=(--base="$INPUT_BASE"); fi
30+
if [ -n "${INPUT_HEAD:-}" ]; then extra_args+=(--head="$INPUT_HEAD"); fi
31+
32+
# Fail the step on nx/git errors so empty output cannot skip integration jobs silently.
33+
AFFECTED=$(./node_modules/.bin/nx show projects --affected "${extra_args[@]}" | tr '\n' ' ' | xargs)
34+
echo "affected=$AFFECTED" >> "$GITHUB_OUTPUT"
35+
36+
if [ -n "$AFFECTED" ]; then
37+
echo "Affected projects: $AFFECTED"
38+
else
39+
echo "No affected projects found"
40+
fi

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
id: install_dependencies
101101

102102
- name: Check for Affected Nx Projects
103-
uses: dkhunt27/action-nx-affected-list@v6.1
103+
uses: ./.github/actions/nx-affected-list
104104
id: checkForAffected
105105
if: github.event_name == 'pull_request'
106106
with:
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: 'Auto-bump size-limit thresholds'
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * 5' # Friday 09:00 UTC
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write
12+
13+
env:
14+
CACHED_DEPENDENCY_PATHS: |
15+
${{ github.workspace }}/node_modules
16+
${{ github.workspace }}/packages/*/node_modules
17+
${{ github.workspace }}/dev-packages/*/node_modules
18+
~/.cache/mongodb-binaries/
19+
20+
concurrency:
21+
group: bump-size-limits
22+
cancel-in-progress: false
23+
24+
jobs:
25+
bump:
26+
name: Bump size-limit thresholds
27+
runs-on: ubuntu-24.04
28+
timeout-minutes: 25
29+
steps:
30+
- name: Generate GitHub App token
31+
id: app-token
32+
uses: actions/create-github-app-token@v2
33+
with:
34+
app-id: ${{ vars.GITFLOW_APP_ID }}
35+
private-key: ${{ secrets.GITFLOW_APP_PRIVATE_KEY }}
36+
37+
- name: Checkout develop
38+
uses: actions/checkout@v6
39+
with:
40+
ref: develop
41+
token: ${{ steps.app-token.outputs.token }}
42+
43+
- name: Set up Node
44+
uses: actions/setup-node@v6
45+
with:
46+
node-version-file: 'package.json'
47+
48+
- name: Install dependencies
49+
uses: ./.github/actions/install-dependencies
50+
51+
- name: Build packages
52+
run: yarn build
53+
54+
- name: Run bumper
55+
# Capture stdout AND exit code without failing the step on exit-2 (no-op).
56+
# The script writes .size-limit.js in place; create-pull-request handles
57+
# commit/branch/PR — if there's no diff, it skips opening a PR.
58+
run: |
59+
set +e
60+
node scripts/bump-size-limits.mjs > /tmp/bump-summary.md
61+
code=$?
62+
set -e
63+
if [ "$code" -ne 0 ] && [ "$code" -ne 2 ]; then
64+
echo "::error::bump script failed with exit code $code"
65+
cat /tmp/bump-summary.md || true
66+
exit "$code"
67+
fi
68+
cat /tmp/bump-summary.md
69+
70+
- name: Create or update PR
71+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
72+
with:
73+
token: ${{ steps.app-token.outputs.token }}
74+
commit-message: 'chore(size-limit): auto-bump weekly drift'
75+
title: 'chore(size-limit): weekly auto-bump'
76+
body-path: /tmp/bump-summary.md
77+
branch: bot/bump-size-limits
78+
base: develop
79+
labels: 'Dev: CI'
80+
add-paths: '.size-limit.js'
81+
delete-branch: true
82+
83+
- name: Open or comment on failure issue
84+
if: failure()
85+
env:
86+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
87+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
88+
run: |
89+
title='Weekly size-limit auto-bump failure'
90+
existing=$(gh issue list --search "in:title \"$title\"" --state open --json number,title --jq ".[] | select(.title == \"$title\") | .number" | head -n1)
91+
if [ -n "$existing" ]; then
92+
gh issue comment "$existing" --body "Auto-bump workflow failed again: $RUN_URL"
93+
else
94+
body=$(cat <<EOF
95+
The weekly size-limit auto-bump workflow failed.
96+
97+
Run: $RUN_URL
98+
99+
This issue will be commented on for repeat failures.
100+
EOF
101+
)
102+
gh issue create \
103+
--title "$title" \
104+
--body "$body" \
105+
--label "Dev: CI"
106+
fi

0 commit comments

Comments
 (0)