Skip to content

chore(python): update python-sdk seed (#14452) #2675

chore(python): update python-sdk seed (#14452)

chore(python): update python-sdk seed (#14452) #2675

name: Test Remote vs Local Generation Parity
on:
# Runs on every commit to main
push:
branches:
- main
# Runs when triggered manually (supports testing from any branch)
workflow_dispatch:
inputs:
branch:
description: "Branch to test (defaults to the branch the workflow is dispatched from)"
required: false
type: string
# Runs when a generator is published successfully
workflow_run:
workflows:
- "Publish TypeScript SDK Generator"
- "Publish Go SDK Generator"
- "Publish Java SDK Generator"
- "Publish Python SDK Generator"
types:
- completed
branches:
- main
# Let the current run finish, but cancel any queued (pending) runs in favor of the newest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
DO_NOT_TRACK: "1"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
TURBO_REMOTE_CACHE_TIMEOUT: 10
TURBO_NO_UPDATE_NOTIFIER: "1"
TURBO_DAEMON: "false"
jobs:
# Determine which generator to test based on the triggering workflow
determine-generator:
runs-on: ubuntu-latest
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
outputs:
generators: ${{ steps.set-generators.outputs.generators }}
steps:
- name: Set generators to test
id: set-generators
run: |
if [ "${{ github.event_name }}" = "workflow_run" ]; then
# Map workflow name to generator
case "${{ github.event.workflow_run.name }}" in
"Publish TypeScript SDK Generator")
echo 'generators=["ts-sdk"]' >> $GITHUB_OUTPUT
;;
"Publish Go SDK Generator")
echo 'generators=["go-sdk"]' >> $GITHUB_OUTPUT
;;
"Publish Java SDK Generator")
echo 'generators=["java-sdk"]' >> $GITHUB_OUTPUT
;;
"Publish Python SDK Generator")
echo 'generators=["python-sdk"]' >> $GITHUB_OUTPUT
;;
*)
echo "Unknown workflow: ${{ github.event.workflow_run.name }}"
exit 1
;;
esac
else
# For push and workflow_dispatch, test all generators
echo 'generators=["ts-sdk", "java-sdk", "go-sdk", "python-sdk"]' >> $GITHUB_OUTPUT
fi
compile-and-build:
needs: determine-generator
runs-on: Seed
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.ref }}
- name: Install
uses: ./.github/actions/install
- name: Compile
run: pnpm compile
- name: Build Fern CLI
run: pnpm fern:build
- name: Build Seed CLI
run: pnpm seed:build
- name: Upload Seed CLI
uses: actions/upload-artifact@v6
with:
name: seed-cli
path: packages/seed/dist/
retention-days: 1
- name: Upload Fern CLI
uses: actions/upload-artifact@v6
with:
name: fern-cli
path: packages/cli/cli/dist/prod/
retention-days: 1
test-remote-local-parity:
needs: [determine-generator, compile-and-build]
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
# Run one generator at a time to prevent branch name collisions on the remote
# (Fiddle) target repo. Fiddle uses minute-level timestamps for branch names
# (e.g. fern-bot/2026-02-17T16-39Z) without a generator-specific prefix, so
# concurrent jobs can overwrite each other's branches and produce false parity
# failures. This can be removed once Fiddle includes the generator name in its
# branch naming (matching the local generation fix in PR #12331).
max-parallel: 1
matrix:
generator: ${{ fromJson(needs.determine-generator.outputs.generators) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.ref }}
- name: Install
uses: ./.github/actions/install
- name: Download Seed CLI
uses: actions/download-artifact@v7
with:
name: seed-cli
path: packages/seed/dist/
- name: Download Fern CLI
uses: actions/download-artifact@v7
with:
name: fern-cli
path: packages/cli/cli/dist/prod/
- name: Restore artifact permissions
run: chmod +x packages/cli/cli/dist/prod/cli.cjs packages/seed/dist/cli.cjs
- name: Run Seed Test Remote-Local (${{ matrix.generator }})
uses: nick-fields/retry@v4
with:
timeout_minutes: 30
max_attempts: 5
retry_wait_seconds: 120
command: pnpm seed test-remote-local --generator ${{ matrix.generator }} --output-mode github
env:
FERN_TOKEN: ${{ secrets.FERN_FERN_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TEST_REMOTE_LOCAL_GITHUB_TOKEN }}