mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 09:49:32 +08:00
Three failures consistently flip community/fork PRs red even when every substantive check passes (observed on PR #9941): - Update Component Index: actions/checkout was given only the head ref, defaulting the repository to the upstream where the fork branch does not exist. Pass head.repo.full_name + head.ref so the head can be checked out from the fork. Continue using the pull_request trigger so fork code never runs in a privileged context. - Merge Frontend Jest + Playwright Coverage Reports: codecov-action ran with fail_ci_if_error: true and an empty token (forks can't read repo secrets), turning a reporting step into a hard merge blocker. Skip the upload when CODECOV_TOKEN is unavailable and match the python coverage job's fail_ci_if_error: false. - CI Success: roll-up gate cascading from the two above; clears automatically once they pass.
106 lines
3.4 KiB
YAML
106 lines
3.4 KiB
YAML
name: autofix.ci
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "**/*.py"
|
|
- "src/lfx/src/lfx/components/**"
|
|
- "scripts/build_component_index.py"
|
|
types: [opened, synchronize, reopened, labeled]
|
|
env:
|
|
PYTHON_VERSION: "3.13"
|
|
|
|
|
|
jobs:
|
|
lint:
|
|
name: Run Ruff Check and Format
|
|
if: github.event.action != 'labeled' && github.actor != 'github-actions[bot]'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: "Setup Environment"
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
prune-cache: false
|
|
- run: uv run ruff check --fix-only .
|
|
- run: uv run ruff format . --config pyproject.toml
|
|
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
|
|
|
|
|
|
update-starter-projects:
|
|
name: Update Starter Projects
|
|
if: github.event.action != 'labeled' && github.actor != 'github-actions[bot]'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: "Setup Environment"
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
prune-cache: false
|
|
|
|
- name: "Install dependencies"
|
|
run: |
|
|
uv sync
|
|
uv pip install -e .
|
|
|
|
- name: Run starter projects update
|
|
run: uv run python scripts/ci/update_starter_projects.py
|
|
|
|
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
|
|
|
|
|
|
update-component-index:
|
|
name: Update Component Index
|
|
if: >-
|
|
github.actor != 'github-actions[bot]'
|
|
&& (github.event.action != 'labeled' || github.event.label.name == 'fix-index')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
fetch-depth: 0
|
|
- name: Merge base branch
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git merge origin/${{ github.base_ref }} --no-edit || {
|
|
# Check which files have conflicts
|
|
CONFLICTED=$(git diff --name-only --diff-filter=U)
|
|
|
|
# If any non-generated files conflict, bail out — needs manual resolution
|
|
if echo "$CONFLICTED" | grep -v component_index.json | grep -q .; then
|
|
echo "::error::Merge conflicts in non-generated files require manual resolution"
|
|
git merge --abort
|
|
exit 1
|
|
fi
|
|
|
|
# Only component_index.json conflicts — resolve and finish merge
|
|
git checkout --theirs src/lfx/src/lfx/_assets/component_index.json
|
|
git add src/lfx/src/lfx/_assets/component_index.json
|
|
GIT_EDITOR=true git merge --continue
|
|
}
|
|
- name: "Setup Environment"
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
prune-cache: false
|
|
|
|
- name: "Install dependencies"
|
|
run: uv sync --dev --project .
|
|
|
|
- name: Build component index
|
|
env:
|
|
LFX_DEV: "1"
|
|
run: make build_component_index
|
|
|
|
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
|