Skip to content

Agents Manager: Handle expired conversations gracefully #211187

Agents Manager: Handle expired conversations gracefully

Agents Manager: Handle expired conversations gracefully #211187

Workflow file for this run

name: Calculate ICFY stats
on: [push]
jobs:
build:
name: Build ICFY stats
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Fetch trunk history
env:
FETCH_DEPTH_STEP: 1000
FETCH_DEPTH_MAX_ATTEMPTS: 100
run: |
if git rev-parse --is-shallow-repository | grep -q true; then
attempt=0
until git merge-base HEAD origin/trunk >/dev/null 2>&1; do
attempt=$(( attempt + 1 ))
if [ "$attempt" -gt "$FETCH_DEPTH_MAX_ATTEMPTS" ]; then
echo "Unable to find a merge base with origin/trunk after deepening history $(( FETCH_DEPTH_STEP * FETCH_DEPTH_MAX_ATTEMPTS )) commits." >&2
exit 1
fi
echo "Deepening origin/trunk history by $FETCH_DEPTH_STEP commits (attempt $attempt/$FETCH_DEPTH_MAX_ATTEMPTS)"
git fetch --no-tags --deepen="$FETCH_DEPTH_STEP" origin +refs/heads/trunk:refs/remotes/origin/trunk
done
else
git fetch --no-tags origin +refs/heads/trunk:refs/remotes/origin/trunk
fi
- name: Install dependencies
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 SKIP_TSC=true SKIP_CALYPSO_POSTINSTALL=true yarn install --inline-builds
- name: Prepare web workspace packages
run: yarn run build-packages:web
- name: Build ICFY stats
env:
NODE_ENV: production
BROWSERSLIST_ENV: defaults
WORKERS: 2
run: yarn run analyze-icfy
- run: mkdir icfy-stats && mv client/{chart,stats}.json icfy-stats
- uses: actions/upload-artifact@v4
with:
name: icfy
path: icfy-stats
retention-days: 7
- name: Upload build artifact
env:
ICFY_SECRET: ${{ secrets.ICFY_SECRET }}
run: |
ANCESTOR_SHA1=$(git merge-base HEAD origin/trunk)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
curl -X POST --globoff \
"http://iscalypsofastyet.com/submit-stats?from=github&secret=$ICFY_SECRET" \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"payload": {
"branch": "'"$CURRENT_BRANCH"'",
"build_num": '"$GITHUB_RUN_ID"',
"sha": "'"$GITHUB_SHA"'",
"ancestor": "'"$ANCESTOR_SHA1"'"
}
}'