feat(infra): add PR labeler configurations and workflows (#33031)

This commit is contained in:
Mason Daugherty
2025-09-20 22:33:08 -04:00
committed by GitHub
parent 6b4054c795
commit 5b418d3f26
6 changed files with 153 additions and 2 deletions

80
.github/labeler.yml vendored Normal file
View File

@@ -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*"

27
.github/pr-title-labeler.yml vendored Normal file
View File

@@ -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"]

View File

@@ -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:

22
.github/workflows/labeler.yml vendored Normal file
View File

@@ -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

View File

@@ -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'

21
.github/workflows/pr_title_labeler.yml vendored Normal file
View File

@@ -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