GitHub Raw JSON API

comet-ml / opik

21,339 Python

Debug, evaluate, and monitor your LLM applications, RAG systems, and agentic workflows with comprehensive tracing, automated evaluations, and production-ready dashboards.

opik Specification

Located in .github/workflows/sdks_generate_openapi_spec_and_fern_code.yml on branch HEAD

Unknown YAML 3.4 KB
Raw YAML Specification
name: SDKs Generate OpenAPI spec and Fern code

on:
  schedule:
    - cron: '0 0 * * 1-5' # Runs at midnight UTC, Monday to Friday
  workflow_dispatch: # Allows manual trigger

concurrency:
  group: fern-auto-update
  cancel-in-progress: true

jobs:
  update-open-api-spec-and-fern-code:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    timeout-minutes: 15

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v7
        with:
          persist-credentials: false

      - name: Set up JDK
        uses: actions/setup-java@v5
        with:
          java-version: '25'
          distribution: 'corretto'
          cache: maven

      - name: Install Fern
        run: npm install -g [email protected]

      - name: Set up Python
        uses: actions/setup-python@v7
        with:
          python-version: '3.11'

      - name: Set up uv
        uses: astral-sh/[email protected]

      - name: Install Opik Optimizer SDK (for Fern docs)
        run: |
          uv pip install --system -e sdks/opik_optimizer

      - name: Set branch name
        run: |
          echo "BRANCH_NAME=github-actions/NA-automatically-update-openapi-spec-and-fern-code" >> "$GITHUB_ENV"

      - name: Run Generate OpenAPI spec and Fern code
        env:
          FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
        run: |
          set -e
          cd apps/opik-backend
          mvn clean
          cd -
          ./scripts/generate_openapi.sh

      - name: Generate Opik Optimizer Fern docs
        run: |
          python sdks/opik_optimizer/scripts/generate_fern_docs.py --write

      - name: Check for changes
        id: check_changes
        run: |
          if git diff --quiet; then
            echo "has_changes=false" >> "$GITHUB_OUTPUT"
          else
            echo "has_changes=true" >> "$GITHUB_OUTPUT"
          fi

      - name: Commit files
        if: steps.check_changes.outputs.has_changes == 'true'
        env:
          ACTOR: ${{ github.actor }}
        run: |
          set -ex
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Actions (${ACTOR})"
          git add sdks/python/src/opik/rest_api/
          git add sdks/typescript/src/opik/rest_api/
          git add sdks/code_generation/fern/openapi/openapi.yaml
          git add apps/opik-documentation/documentation/fern/openapi/opik.yaml
          git add apps/opik-documentation/documentation/fern/docs/agent_optimization/opik_optimizer/reference.mdx
          git commit -m "[NA] [SDK] [DOCS] Update automatically OpenAPI spec and Fern code"

      - name: Create Pull Request
        if: steps.check_changes.outputs.has_changes == 'true'
        uses: peter-evans/create-pull-request@v8
        with:
          token: ${{ secrets.COMET_ACTION_CREATE_PR }}
          branch: ${{ env.BRANCH_NAME }}
          title: "[NA] [SDK] [DOCS] Update automatically OpenAPI spec and Fern code"
          body: |
            ## Details
            Automated daily update of OpenAPI spec and Fern code after running `./scripts/generate_openapi.sh` and `./sdks/opik_optimizer/scripts/generate_fern_docs.py`.

            ## Change checklist
            - [ ] User facing changes
            - [X] Documentation updated

            ## Issues
            N/A

            ## Testing
            - Passed CI

            ## Documentation
            - https://buildwithfern.com/learn/cli-api-reference/cli-reference/commands#fern-generate
          base: main