ci: fix silently-broken issue labeling and add PR labeling (#6470)
This commit is contained in:
@@ -9,9 +9,9 @@ body:
|
|||||||
label: Component
|
label: Component
|
||||||
description: Which part of mem0 is affected?
|
description: Which part of mem0 is affected?
|
||||||
options:
|
options:
|
||||||
- Core / Python SDK
|
- Python SDK
|
||||||
- TypeScript SDK
|
- TypeScript SDK
|
||||||
- Vector Store (Qdrant, PGVector, Redis, Chroma, etc.)
|
- Vector Store
|
||||||
- OpenClaw
|
- OpenClaw
|
||||||
- REST API
|
- REST API
|
||||||
- Other
|
- Other
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ body:
|
|||||||
label: Component
|
label: Component
|
||||||
description: Which part of mem0 does this relate to?
|
description: Which part of mem0 does this relate to?
|
||||||
options:
|
options:
|
||||||
- Core / Python SDK
|
- Python SDK
|
||||||
- TypeScript SDK
|
- TypeScript SDK
|
||||||
- Vector Store (Qdrant, PGVector, Redis, Chroma, etc.)
|
- Vector Store
|
||||||
- OpenClaw
|
- OpenClaw
|
||||||
- REST API
|
- REST API
|
||||||
- Other
|
- Other
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
# Maps dropdown selections to GitHub labels
|
policy:
|
||||||
# Used by the advanced-issue-labeler GitHub Action
|
- section:
|
||||||
|
- id: ['component']
|
||||||
component:
|
block-list: ['Other']
|
||||||
- label: "sdk-python"
|
label:
|
||||||
matcher: "Core / Python SDK"
|
- name: 'sdk-python'
|
||||||
- label: "sdk-typescript"
|
keys: ['Python SDK']
|
||||||
matcher: "TypeScript SDK"
|
- name: 'sdk-typescript'
|
||||||
- label: "vector-store"
|
keys: ['TypeScript SDK']
|
||||||
matcher: "Vector Store"
|
- name: 'vector-store'
|
||||||
- label: "openclaw"
|
keys: ['Vector Store']
|
||||||
matcher: "OpenClaw"
|
- name: 'openclaw'
|
||||||
- label: "rest-api"
|
keys: ['OpenClaw']
|
||||||
matcher: "REST API"
|
- name: 'rest-api'
|
||||||
|
keys: ['REST API']
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
vector-store:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'mem0/vector_stores/**'
|
||||||
|
|
||||||
|
sdk-python:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: ['mem0/**', 'tests/**']
|
||||||
|
|
||||||
|
sdk-typescript:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'mem0-ts/**'
|
||||||
|
|
||||||
|
rest-api:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'server/**'
|
||||||
|
|
||||||
|
openmemory:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'openmemory/**'
|
||||||
|
|
||||||
|
openclaw:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'integrations/openclaw/**'
|
||||||
|
|
||||||
|
integrations:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'integrations/**'
|
||||||
|
|
||||||
|
cli:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'cli/**'
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'docs/**'
|
||||||
|
|
||||||
|
ci:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: '.github/**'
|
||||||
@@ -12,6 +12,8 @@ jobs:
|
|||||||
label:
|
label:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: stefanbuck/github-issue-parser@v3
|
- uses: stefanbuck/github-issue-parser@v3
|
||||||
id: issue-parser
|
id: issue-parser
|
||||||
with:
|
with:
|
||||||
@@ -20,20 +22,5 @@ jobs:
|
|||||||
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
|
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
|
||||||
with:
|
with:
|
||||||
issue-form: ${{ steps.issue-parser.outputs.jsonString }}
|
issue-form: ${{ steps.issue-parser.outputs.jsonString }}
|
||||||
section: component
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
config-path: .github/advanced-issue-labeler.yml
|
|
||||||
|
|
||||||
- uses: stefanbuck/github-issue-parser@v3
|
|
||||||
id: feature-parser
|
|
||||||
if: contains(github.event.issue.labels.*.name, 'enhancement')
|
|
||||||
with:
|
|
||||||
template-path: .github/ISSUE_TEMPLATE/feature_request.yml
|
|
||||||
|
|
||||||
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
|
|
||||||
if: contains(github.event.issue.labels.*.name, 'enhancement')
|
|
||||||
with:
|
|
||||||
issue-form: ${{ steps.feature-parser.outputs.jsonString }}
|
|
||||||
section: component
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
config-path: .github/advanced-issue-labeler.yml
|
config-path: .github/advanced-issue-labeler.yml
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
name: PR Labeler
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize, reopened, edited]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
issues: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/labeler@v5
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Propagate labels from linked issues
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const allowed = new Set([
|
||||||
|
'sdk-python', 'sdk-typescript', 'vector-store', 'openclaw',
|
||||||
|
'rest-api', 'openmemory', 'documentation', 'ci', 'cli', 'integrations',
|
||||||
|
]);
|
||||||
|
const body = context.payload.pull_request.body || '';
|
||||||
|
const matches = [...body.matchAll(/\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?\s*(?:#|https:\/\/github\.com\/mem0ai\/mem0\/issues\/)(\d+)/gi)];
|
||||||
|
const numbers = [...new Set(matches.map((m) => Number(m[1])))];
|
||||||
|
|
||||||
|
const labels = new Set();
|
||||||
|
for (const issue_number of numbers) {
|
||||||
|
let issue;
|
||||||
|
try {
|
||||||
|
({ data: issue } = await github.rest.issues.get({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number,
|
||||||
|
}));
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (issue.pull_request) continue;
|
||||||
|
for (const label of issue.labels) {
|
||||||
|
if (allowed.has(label.name)) labels.add(label.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labels.size > 0) {
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
labels: [...labels],
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -462,6 +462,7 @@ Publishing is routed through a single entry point: **`release.yml` (Release Rout
|
|||||||
| Workflow | File | Purpose |
|
| Workflow | File | Purpose |
|
||||||
|----------|------|---------|
|
|----------|------|---------|
|
||||||
| Issue Labeler | `issue-labeler.yml` | Automatic issue labeling |
|
| Issue Labeler | `issue-labeler.yml` | Automatic issue labeling |
|
||||||
|
| PR Labeler | `pr-labeler.yml` | Path-based PR labeling plus propagating labels from linked issues |
|
||||||
| Stale Bot | `stale.yml` | Marks stale issues and PRs |
|
| Stale Bot | `stale.yml` | Marks stale issues and PRs |
|
||||||
| llms.txt Check | `docs-llms-txt-check.yml` | Blocks PRs touching `docs/**/*.mdx` when `docs/llms.txt` is out of sync. Fix locally with `python scripts/check-llms-txt-coverage.py --write`. |
|
| llms.txt Check | `docs-llms-txt-check.yml` | Blocks PRs touching `docs/**/*.mdx` when `docs/llms.txt` is out of sync. Fix locally with `python scripts/check-llms-txt-coverage.py --write`. |
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user