From 5b418d3f2638ad62c2e3d5bdeb0bac781059260e Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Sat, 20 Sep 2025 22:33:08 -0400 Subject: [PATCH] feat(infra): add PR labeler configurations and workflows (#33031) --- .github/labeler.yml | 80 ++++++++++++++++++++++++++ .github/pr-title-labeler.yml | 27 +++++++++ .github/workflows/check_diffs.yml | 1 + .github/workflows/labeler.yml | 22 +++++++ .github/workflows/pr_lint.yml | 4 +- .github/workflows/pr_title_labeler.yml | 21 +++++++ 6 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 .github/labeler.yml create mode 100644 .github/pr-title-labeler.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/pr_title_labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..7ffab69b364 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,80 @@ +# GitHub PR Labeler Configuration for LangChain +# Automatically applies labels based on changed files and branch patterns + +# Core packages +core: + - changed-files: + - any-glob-to-any-file: + - "libs/core/**/*" + +langchain: + - changed-files: + - any-glob-to-any-file: + - "libs/langchain/**/*" + - "libs/langchain_v1/**/*" + +v1: + - changed-files: + - any-glob-to-any-file: + - "libs/langchain_v1/**/*" + +cli: + - changed-files: + - any-glob-to-any-file: + - "libs/cli/**/*" + +standard-tests: + - changed-files: + - any-glob-to-any-file: + - "libs/standard-tests/**/*" + +# Partner integrations +integration: + - changed-files: + - any-glob-to-any-file: + - "libs/partners/**/*" + +# Infrastructure and DevOps +infra: + - changed-files: + - any-glob-to-any-file: + - ".github/**/*" + - "Makefile" + - ".pre-commit-config.yaml" + - "scripts/**/*" + - "docker/**/*" + - "Dockerfile*" + +github_actions: + - changed-files: + - any-glob-to-any-file: + - ".github/workflows/**/*" + - ".github/actions/**/*" + +dependencies: + - changed-files: + - any-glob-to-any-file: + - "**/pyproject.toml" + - "uv.lock" + - "**/requirements*.txt" + - "**/poetry.lock" + +# Documentation +documentation: + - changed-files: + - any-glob-to-any-file: + - "docs/**/*" + - "**/*.md" + - "**/*.rst" + - "**/README*" + +# Security related changes +security: + - changed-files: + - any-glob-to-any-file: + - "**/*security*" + - "**/*auth*" + - "**/*credential*" + - "**/*secret*" + - "**/*token*" + - ".github/workflows/security*" diff --git a/.github/pr-title-labeler.yml b/.github/pr-title-labeler.yml new file mode 100644 index 00000000000..1d0c71de5f9 --- /dev/null +++ b/.github/pr-title-labeler.yml @@ -0,0 +1,27 @@ +# PR Title Labeler Configuration +# Labels PRs based on conventional commit patterns in titles +# Format: type(scope): description or type!: description (breaking) + +add-missing-labels: true +include-commits: false +include-title: true +label-for-breaking-changes: breaking + +label-mapping: + # Features and enhancements + feature: ["feat"] + + # Bug fixes + fix: ["fix"] + + # Documentation + documentation: ["docs"] + + # Infrastructure and tooling + infra: ["chore", "ci", "build", "infra"] + + # Integration partners - detected by scope + integration: ["anthropic", "chroma", "deepseek", "exa", "fireworks", "groq", "huggingface", "mistralai", "nomic", "ollama", "openai", "perplexity", "prompty", "qdrant", "xai"] + + # Releases + release: ["release"] diff --git a/.github/workflows/check_diffs.yml b/.github/workflows/check_diffs.yml index ccf70e7e867..37eabe5583d 100644 --- a/.github/workflows/check_diffs.yml +++ b/.github/workflows/check_diffs.yml @@ -111,6 +111,7 @@ jobs: # Verify integration tests compile without actually running them (faster feedback) compile-integration-tests: + name: 'Compile Integration Tests' needs: [ build ] if: ${{ needs.build.outputs.compile-integration-tests != '[]' }} strategy: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000000..acb85c01dad --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,22 @@ +name: "🏷️ Pull Request Labeler" + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +jobs: + labeler: + name: 'label' + permissions: + contents: read + pull-requests: write + issues: write + runs-on: ubuntu-latest + + steps: + - name: Label Pull Request + uses: actions/labeler@v6 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + sync-labels: true diff --git a/.github/workflows/pr_lint.yml b/.github/workflows/pr_lint.yml index f154f10fae2..1adca680420 100644 --- a/.github/workflows/pr_lint.yml +++ b/.github/workflows/pr_lint.yml @@ -26,7 +26,7 @@ # • release — prepare a new release # # Allowed Scopes (optional): -# core, cli, langchain, langchain_v1, langchain_legacy, standard-tests, +# core, cli, langchain, langchain_v1, langchain_legacy, standard-tests, # text-splitters, docs, anthropic, chroma, deepseek, exa, fireworks, groq, # huggingface, mistralai, nomic, ollama, openai, perplexity, prompty, qdrant, # xai, infra @@ -59,7 +59,7 @@ on: jobs: # Validates that PR title follows Conventional Commits specification lint-pr-title: - name: 'Validate PR Title Format' + name: 'validate format' runs-on: ubuntu-latest steps: - name: '✅ Validate Conventional Commits Format' diff --git a/.github/workflows/pr_title_labeler.yml b/.github/workflows/pr_title_labeler.yml new file mode 100644 index 00000000000..d5aa8e6c7b9 --- /dev/null +++ b/.github/workflows/pr_title_labeler.yml @@ -0,0 +1,21 @@ +name: "🏷️ PR Title Labeler" + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + pr-title-labeler: + name: 'label' + permissions: + contents: read + pull-requests: write + issues: write + runs-on: ubuntu-latest + + steps: + - name: Label PR based on title + uses: grafana/pr-labeler-action@v0.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/pr-title-labeler.yml