Skip to content

Commit 79a7d15

Browse files
committed
Merge remote-tracking branch 'upstream/main' into rhoai-3.5-ea.2
2 parents de9687c + 428eb3e commit 79a7d15

129 files changed

Lines changed: 829 additions & 468 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
Thank you for suggesting an improvement! Please fill in the details below.
1212
1313
Before opening a new feature request, please check
14-
[existing issues](https://github.com/llm-d-incubation/batch-gateway/issues)
14+
[existing issues](https://github.com/llm-d/llm-d-batch-gateway/issues)
1515
to see if a similar request already exists.
1616
1717
- type: textarea

.github/RELEASE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Images are published to GitHub Container Registry. For this release, use the tag
1414
The Helm chart is published to GitHub Container Registry for each release. Install using the chart semver from `Chart.yaml` (no `v` prefix — for tag `$TAG` such as `v1.0.0`, use `--version 1.0.0`):
1515

1616
```bash
17-
helm install batch-gateway oci://ghcr.io/llm-d-incubation/charts/batch-gateway --version "${TAG#v}"
17+
helm install batch-gateway oci://ghcr.io/llm-d/charts/batch-gateway --version "${TAG#v}"
1818
```
1919

2020
## Upgrade notes

.github/scripts/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# CI Scripts
2+
3+
## PR Title Validation and Label Mapping
4+
5+
### Overview
6+
7+
PR titles are validated and labeled by [`.github/workflows/auto-label-pr.yml`](../workflows/auto-label-pr.yml):
8+
9+
1. **Validate**[`amannn/action-semantic-pull-request`](https://github.com/amannn/action-semantic-pull-request) enforces [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) on the PR title
10+
2. **Label**`detect-pr-label.js` maps the validated `type` to a release-category label
11+
12+
### Allowed PR title types
13+
14+
```
15+
feat enh fix docs deps ci chore refactor test perf style revert build
16+
```
17+
18+
Examples: `feat: add auth`, `fix(api): handle edge case`, `deps(go): bump module`
19+
20+
Breaking changes use `!` before `:`: `feat!: drop old API`, `fix(scope)!: breaking fix`
21+
22+
### Type to label mapping
23+
24+
| Type | Label |
25+
|------|-------|
26+
| any type with `!` (e.g. `feat!:`, `fix!:`) | `breaking-change` |
27+
| `feat` | `feature` |
28+
| `enh` | `enhancement` |
29+
| `fix` | `bug` |
30+
| `docs` | `documentation` |
31+
| `deps` | `dependencies` |
32+
| `ci`, `chore`, `refactor`, `test`, `style`, `perf`, `revert`, `build` | `release-note-none` |
33+
34+
Labels align with categories in [`.github/release.yml`](../release.yml).
35+
36+
### Files
37+
38+
- `detect-pr-label.js` — maps validated type + title to a single category label
39+
- `detect-pr-label.test.js` — unit tests
40+
41+
### Running tests
42+
43+
Requires Node.js 18+:
44+
45+
```bash
46+
node --test detect-pr-label.test.js
47+
```
48+
49+
### Branch protection
50+
51+
After merging to `main`, add the **Auto-label PRs** workflow as a required status check so invalid titles block merge.

.github/scripts/detect-pr-label.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const TYPE_LABELS = {
2+
feat: 'feature',
3+
enh: 'enhancement',
4+
fix: 'bug',
5+
docs: 'documentation',
6+
deps: 'dependencies',
7+
ci: 'release-note-none',
8+
chore: 'release-note-none',
9+
refactor: 'release-note-none',
10+
test: 'release-note-none',
11+
style: 'release-note-none',
12+
perf: 'release-note-none',
13+
revert: 'release-note-none',
14+
build: 'release-note-none',
15+
};
16+
17+
const MANAGED_CATEGORY_LABELS = [
18+
'breaking-change',
19+
'feature',
20+
'enhancement',
21+
'bug',
22+
'documentation',
23+
'dependencies',
24+
'release-note-none',
25+
];
26+
27+
function isBreakingChange(title) {
28+
const lower = title.toLowerCase();
29+
return lower.startsWith('!:') || /^(\w+)(?:\([^)]*\))?!:/.test(lower);
30+
}
31+
32+
function labelFromType(type, title) {
33+
if (isBreakingChange(title)) {
34+
return 'breaking-change';
35+
}
36+
return TYPE_LABELS[type] ?? null;
37+
}
38+
39+
module.exports = { labelFromType, isBreakingChange, MANAGED_CATEGORY_LABELS, TYPE_LABELS };
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const { describe, test } = require('node:test');
2+
const assert = require('node:assert/strict');
3+
const { labelFromType, isBreakingChange } = require('./detect-pr-label.js');
4+
5+
describe('labelFromType', () => {
6+
const testCases = [
7+
['feat', 'feat: add feature', 'feature'],
8+
['enh', 'enh: improve performance', 'enhancement'],
9+
['fix', 'fix: bug', 'bug'],
10+
['docs', 'docs: update', 'documentation'],
11+
['deps', 'deps(go): bump', 'dependencies'],
12+
['ci', 'ci: update workflow', 'release-note-none'],
13+
['chore', 'chore: misc', 'release-note-none'],
14+
['refactor', 'refactor: cleanup', 'release-note-none'],
15+
['test', 'test: add tests', 'release-note-none'],
16+
['style', 'style: format', 'release-note-none'],
17+
['perf', 'perf: optimize', 'release-note-none'],
18+
['revert', 'revert: undo change', 'release-note-none'],
19+
['build', 'build: update makefile', 'release-note-none'],
20+
['feat', 'feat(api): add endpoint', 'feature'],
21+
['fix', 'fix(auth): resolve bug', 'bug'],
22+
['feat', 'feat!: breaking feature', 'breaking-change'],
23+
['fix', 'fix!: breaking fix', 'breaking-change'],
24+
['feat', 'feat(api)!: breaking change', 'breaking-change'],
25+
['feat', '!: breaking change', 'breaking-change'],
26+
['fix', 'fix: handle error when status is !: done', 'bug'],
27+
['unknown', 'unknown: something', null],
28+
];
29+
30+
for (const [type, title, expected] of testCases) {
31+
test(`type=${type} title="${title}" → ${expected}`, () => {
32+
assert.equal(labelFromType(type, title), expected);
33+
});
34+
}
35+
});
36+
37+
describe('isBreakingChange', () => {
38+
test('detects prefix !:', () => {
39+
assert.equal(isBreakingChange('!: breaking'), true);
40+
});
41+
42+
test('detects type!:', () => {
43+
assert.equal(isBreakingChange('feat!: breaking'), true);
44+
});
45+
46+
test('ignores !: in subject', () => {
47+
assert.equal(isBreakingChange('fix: handle error when status is !: done'), false);
48+
});
49+
});
Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,90 @@
1-
name: Add default labels to PRs
1+
name: Auto-label PRs
22

33
on:
44
pull_request_target:
5-
types: [opened]
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
610

711
permissions:
12+
contents: read
813
pull-requests: write
914

1015
jobs:
11-
add-label:
12-
if: github.repository == 'llm-d-incubation/batch-gateway'
16+
title-and-labels:
17+
if: github.repository == 'llm-d/llm-d-batch-gateway' && github.actor != 'dependabot[bot]'
1318
runs-on: ubuntu-latest
1419
steps:
15-
- name: Add default labels
16-
uses: actions/github-script@v9
20+
- name: Validate PR title
21+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
22+
id: pr_title
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
types: |
27+
feat
28+
enh
29+
fix
30+
docs
31+
deps
32+
ci
33+
chore
34+
refactor
35+
test
36+
perf
37+
style
38+
revert
39+
build
40+
41+
- name: Apply PR labels
42+
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
43+
env:
44+
PR_TYPE: ${{ steps.pr_title.outputs.type }}
1745
with:
1846
script: |
19-
await github.rest.issues.addLabels({
47+
const fs = require('fs');
48+
const os = require('os');
49+
const path = require('path');
50+
51+
const { data } = await github.rest.repos.getContent({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
path: '.github/scripts/detect-pr-label.js',
55+
ref: context.payload.pull_request.base.sha,
56+
});
57+
const scriptPath = path.join(os.tmpdir(), 'detect-pr-label.js');
58+
fs.writeFileSync(scriptPath, Buffer.from(data.content, 'base64').toString());
59+
const { labelFromType, MANAGED_CATEGORY_LABELS } = require(scriptPath);
60+
61+
const type = process.env.PR_TYPE;
62+
const title = context.payload.pull_request.title;
63+
const category = labelFromType(type, title);
64+
65+
const { data: issue } = await github.rest.issues.get({
2066
owner: context.repo.owner,
2167
repo: context.repo.repo,
2268
issue_number: context.issue.number,
23-
labels: ['ai-assisted']
2469
});
70+
const currentLabels = issue.labels.map((label) => label.name);
71+
72+
for (const label of MANAGED_CATEGORY_LABELS) {
73+
if (label !== category && currentLabels.includes(label)) {
74+
await github.rest.issues.removeLabel({
75+
owner: context.repo.owner,
76+
repo: context.repo.repo,
77+
issue_number: context.issue.number,
78+
name: label,
79+
});
80+
}
81+
}
82+
83+
if (category && !currentLabels.includes(category)) {
84+
await github.rest.issues.addLabels({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: context.issue.number,
88+
labels: [category],
89+
});
90+
}

.github/workflows/ci-release.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
targets: default
7474
push: true
7575
env:
76-
REGISTRY: ghcr.io/llm-d-incubation
76+
REGISTRY: ghcr.io/llm-d
7777
COMMIT_SHA: ${{ steps.meta.outputs.commit_sha }}
7878
BUILD_DATE: ${{ steps.meta.outputs.build_date }}
7979
VERSION: ${{ steps.meta.outputs.version }}
@@ -82,9 +82,9 @@ jobs:
8282
- name: Output image tags
8383
run: |
8484
echo "Images pushed:"
85-
echo " - ghcr.io/llm-d-incubation/batch-gateway-apiserver:${{ steps.meta.outputs.commit_sha }}"
86-
echo " - ghcr.io/llm-d-incubation/batch-gateway-apiserver:${{ steps.meta.outputs.tag }}"
87-
echo " - ghcr.io/llm-d-incubation/batch-gateway-processor:${{ steps.meta.outputs.commit_sha }}"
88-
echo " - ghcr.io/llm-d-incubation/batch-gateway-processor:${{ steps.meta.outputs.tag }}"
89-
echo " - ghcr.io/llm-d-incubation/batch-gateway-gc:${{ steps.meta.outputs.commit_sha }}"
90-
echo " - ghcr.io/llm-d-incubation/batch-gateway-gc:${{ steps.meta.outputs.tag }}"
85+
echo " - ghcr.io/llm-d/batch-gateway-apiserver:${{ steps.meta.outputs.commit_sha }}"
86+
echo " - ghcr.io/llm-d/batch-gateway-apiserver:${{ steps.meta.outputs.tag }}"
87+
echo " - ghcr.io/llm-d/batch-gateway-processor:${{ steps.meta.outputs.commit_sha }}"
88+
echo " - ghcr.io/llm-d/batch-gateway-processor:${{ steps.meta.outputs.tag }}"
89+
echo " - ghcr.io/llm-d/batch-gateway-gc:${{ steps.meta.outputs.commit_sha }}"
90+
echo " - ghcr.io/llm-d/batch-gateway-gc:${{ steps.meta.outputs.tag }}"

.github/workflows/create-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,6 @@ jobs:
126126
files: release/*
127127
draft: false
128128
make_latest: legacy
129+
prerelease: ${{ contains(github.ref_name, '-') }}
129130
env:
130131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ CMD_GC=./cmd/batch-gc
1919
RELEASE_BINARIES := apiserver:$(CMD_APISERVER) processor:$(CMD_PROCESSOR) gc:$(CMD_GC)
2020
BINARIES_DIR ?= dist/binaries
2121
RELEASE_DIR ?= release
22-
APISERVER_IMAGE_TAG_BASE ?= ghcr.io/llm-d-incubation/$(APISERVER_BINARY)
22+
APISERVER_IMAGE_TAG_BASE ?= ghcr.io/llm-d/$(APISERVER_BINARY)
2323
APISERVER_IMG = $(APISERVER_IMAGE_TAG_BASE):$(IMAGE_TAG)
24-
PROCESSOR_IMAGE_TAG_BASE ?= ghcr.io/llm-d-incubation/$(PROCESSOR_BINARY)
24+
PROCESSOR_IMAGE_TAG_BASE ?= ghcr.io/llm-d/$(PROCESSOR_BINARY)
2525
PROCESSOR_IMG = $(PROCESSOR_IMAGE_TAG_BASE):$(IMAGE_TAG)
26-
GC_IMAGE_TAG_BASE ?= ghcr.io/llm-d-incubation/$(GC_BINARY)
26+
GC_IMAGE_TAG_BASE ?= ghcr.io/llm-d/$(GC_BINARY)
2727
GC_IMG = $(GC_IMAGE_TAG_BASE):$(IMAGE_TAG)
2828
GO=go
2929
GOFLAGS=
@@ -98,7 +98,7 @@ package-release:
9898
cat SHA256SUMS && \
9999
ls -la
100100

101-
## publish-helm-chart: Patch chart for VERSION, package, append chart to SHA256SUMS, push to oci://ghcr.io/llm-d-incubation/charts (requires VERSION, yq, helm; GITHUB_TOKEN, GITHUB_ACTOR for push).
101+
## publish-helm-chart: Patch chart for VERSION, package, append chart to SHA256SUMS, push to oci://ghcr.io/llm-d/charts (requires VERSION, yq, helm; GITHUB_TOKEN, GITHUB_ACTOR for push).
102102
publish-helm-chart:
103103
@if [ -z "$(VERSION)" ]; then \
104104
echo "VERSION is required (e.g. VERSION=v1.0.0 make publish-helm-chart)"; exit 1; \

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Batch Gateway
22

3-
[![Go Report Card](https://goreportcard.com/badge/github.com/llm-d-incubation/batch-gateway)](https://goreportcard.com/report/github.com/llm-d-incubation/batch-gateway)
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/llm-d/llm-d-batch-gateway)](https://goreportcard.com/report/github.com/llm-d/llm-d-batch-gateway)
44
[![Go Version](https://img.shields.io/badge/Go-1.25-blue.svg)](https://golang.org/)
55
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
66
[![Join Slack](https://img.shields.io/badge/Join_Slack-blue?logo=slack)](https://llm-d.slack.com/archives/C0AA8772H7T)
7-
[![apiserver](https://ghcr-badge.egpl.dev/llm-d-incubation/batch-gateway-apiserver/latest_tag?trim=major&label=apiserver)](https://github.com/llm-d-incubation/batch-gateway/pkgs/container/batch-gateway-apiserver)
8-
[![processor](https://ghcr-badge.egpl.dev/llm-d-incubation/batch-gateway-processor/latest_tag?trim=major&label=processor)](https://github.com/llm-d-incubation/batch-gateway/pkgs/container/batch-gateway-processor)
9-
[![gc](https://ghcr-badge.egpl.dev/llm-d-incubation/batch-gateway-gc/latest_tag?trim=major&label=gc)](https://github.com/llm-d-incubation/batch-gateway/pkgs/container/batch-gateway-gc)
7+
[![apiserver](https://ghcr-badge.egpl.dev/llm-d/batch-gateway-apiserver/latest_tag?trim=major&label=apiserver)](https://github.com/llm-d/llm-d-batch-gateway/pkgs/container/batch-gateway-apiserver)
8+
[![processor](https://ghcr-badge.egpl.dev/llm-d/batch-gateway-processor/latest_tag?trim=major&label=processor)](https://github.com/llm-d/llm-d-batch-gateway/pkgs/container/batch-gateway-processor)
9+
[![gc](https://ghcr-badge.egpl.dev/llm-d/batch-gateway-gc/latest_tag?trim=major&label=gc)](https://github.com/llm-d/llm-d-batch-gateway/pkgs/container/batch-gateway-gc)
1010

1111
## Overview
1212

@@ -274,9 +274,9 @@ make image-build-gc
274274

275275
Images are published to:
276276

277-
- `ghcr.io/llm-d-incubation/batch-gateway-apiserver`
278-
- `ghcr.io/llm-d-incubation/batch-gateway-processor`
279-
- `ghcr.io/llm-d-incubation/batch-gateway-gc`
277+
- `ghcr.io/llm-d/batch-gateway-apiserver`
278+
- `ghcr.io/llm-d/batch-gateway-processor`
279+
- `ghcr.io/llm-d/batch-gateway-gc`
280280

281281
## API Usage
282282

0 commit comments

Comments
 (0)