From 2d5c55926168b45a8f05b786e58247882bf6c2c9 Mon Sep 17 00:00:00 2001 From: Yuqi Tang Date: Fri, 29 Aug 2025 11:15:41 -0700 Subject: [PATCH] feat: Move comprehensive coverage check workflow before approved (#9482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add comprehensive coverage check workflow Created a dedicated workflow that runs code coverage before PR approval: 🚀 Coverage Runs Early: - Triggers: Push to branches + PR events (opened, sync, ready_for_review) - Smart filtering: Only runs when backend code changes - Fast feedback: Unit tests only for quick coverage results 📊 Comprehensive Reporting: - CodeCov integration with proper flags and naming - PR comments with coverage status and links - Workflow summary with coverage percentage - Coverage artifacts (XML + HTML) saved for review ⚡ Intelligent Execution: - Path filtering: src/backend/**, pyproject.toml, uv.lock - Branch filtering: main, develop, feature/**, fix/**, hotfix/** - Draft protection: Skips draft PRs - Dynamic naming: Different names for push vs PR contexts 🎯 Benefits: - Developers get immediate coverage feedback on push - Reviewers see coverage context during PR review - Coverage issues caught before approval, not after - Continuous monitoring of coverage trends across branches This replaces the previous "coverage after approval" approach with "coverage before approval" - exactly what was requested! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * Remove all restrictions from coverage workflow - Coverage now runs on ANY push to ANY branch - Coverage runs on ANY PR with ANY changes - No path filtering - runs regardless of what files changed - No branch filtering - runs on all branches - Ensures coverage runs on every PR as requested * move test to be run when we submit pr * Configure CI to run tests before PR approval - Remove 'lgtm' label requirement from CI trigger - Run tests immediately on PR opened/synchronized events - Add ci.yml to path filters to trigger tests when workflow changes - Coverage and tests now run before approval for early feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * add labeled --------- Co-authored-by: Claude --- .github/changes-filter.yaml | 2 ++ .github/workflows/ci.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml index b21ef891e..02a639abd 100644 --- a/.github/changes-filter.yaml +++ b/.github/changes-filter.yaml @@ -7,6 +7,7 @@ python: - "src/backend/base/pyproject.toml" - "src/backend/base/uv.lock" - "**/python_test.yml" + - ".github/workflows/ci.yml" components-changes: - "src/backend/base/langflow/components/**" starter-projects-changes: @@ -17,6 +18,7 @@ frontend: - "src/frontend/**" - "**/typescript_test.yml" - "**/jest_test.yml" + - ".github/workflows/ci.yml" docs: - "docs/**" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60cfa0c46..17b2fc53c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ on: type: string default: "['3.10']" pull_request: - types: [synchronize, labeled] + types: [opened, synchronize, labeled] merge_group: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -120,7 +120,7 @@ jobs: name: Should Run CI runs-on: ubuntu-latest outputs: - should-run-ci: ${{ (contains( github.event.pull_request.labels.*.name, 'lgtm') && github.event.pull_request.draft == false) || (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'merge_group') }} + should-run-ci: ${{ (github.event.pull_request.draft == false) || (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'merge_group') }} should-run-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'fast-track') || github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group' }} steps: # Do anything just to make the job run