Skip to content

Commit 1ca4a9f

Browse files
committed
Merge remote-tracking branch 'origin/main' into issue5826/empty-openai-apikey-guard
2 parents 058bedb + d38959e commit 1ca4a9f

146 files changed

Lines changed: 50490 additions & 19200 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/.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"python-sdk": "1.0.0",
66
"mcp-server": "1.0.0",
77
"langevals": "2.2.0",
8-
".": "3.5.0",
8+
".": "3.6.0",
99
"skills": "1.0.0"
1010
}

.github/actions/detect-changes/action.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# base using dorny/paths-filter. On every other event (push, schedule,
55
# workflow_dispatch, merge_group) we force every declared filter to
66
# `true` so the real jobs always run — required aggregator checks need
7-
# a concrete result.
7+
# a concrete result. Exception: with `push-strategy: diff` a push is
8+
# diffed against its before-commit instead of force-run, for workflows
9+
# whose real jobs spend money on live LLM calls.
810
#
911
# The caller MUST check out the repo first so this composite action is
1012
# accessible — dorny/paths-filter then reads the diff against the PR
@@ -41,29 +43,44 @@ inputs:
4143
filters:
4244
description: YAML filter block for dorny/paths-filter (must define `relevant` + `feature-parity` filters).
4345
required: true
46+
push-strategy:
47+
description: >-
48+
How push events are treated. 'force' (default) marks every filter
49+
true so the real jobs always run post-merge. 'diff' diffs the push
50+
against its before-commit with dorny/paths-filter instead, so
51+
workflows whose real jobs spend money (live LLM calls) only run
52+
them when the push actually touched relevant paths.
53+
required: false
54+
default: force
4455
outputs:
4556
relevant:
46-
description: "'true' if relevant paths changed, or if event is not a PR."
57+
description: "'true' if relevant paths changed, or if the event is neither a PR nor a diff-mode push."
4758
value: ${{ steps.filter.outputs.relevant || steps.force.outputs.relevant }}
4859
feature-parity:
49-
description: "'true' if feature-parity-relevant paths changed, or if event is not a PR."
60+
description: "'true' if feature-parity-relevant paths changed, or if the event is neither a PR nor a diff-mode push."
5061
value: ${{ steps.filter.outputs.feature-parity || steps.force.outputs.feature-parity }}
5162
lambda-image:
52-
description: "'true' if Lambda-image-relevant paths changed, or if event is not a PR. Used by langwatch-nlp-ci's LWA-readiness job — covers Go-binary source + Dockerfile + entrypoint, which aren't matched by the Python-only `relevant` filter."
63+
description: "'true' if Lambda-image-relevant paths changed, or if the event is neither a PR nor a diff-mode push. Used by langwatch-nlp-ci's LWA-readiness job — covers Go-binary source + Dockerfile + entrypoint, which aren't matched by the Python-only `relevant` filter."
5364
value: ${{ steps.filter.outputs.lambda-image || steps.force.outputs.lambda-image }}
5465

5566
runs:
5667
using: composite
5768
steps:
5869
- name: Detect relevant changes
59-
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
70+
if: >-
71+
github.event_name == 'pull_request'
72+
|| github.event_name == 'pull_request_target'
73+
|| (github.event_name == 'push' && inputs.push-strategy == 'diff')
6074
id: filter
6175
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
6276
with:
6377
filters: ${{ inputs.filters }}
6478

6579
- name: Force every filter true on non-PR events
66-
if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target'
80+
if: >-
81+
github.event_name != 'pull_request'
82+
&& github.event_name != 'pull_request_target'
83+
&& (github.event_name != 'push' || inputs.push-strategy != 'diff')
6784
id: force
6885
shell: bash
6986
run: |

.github/release-please-config.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@
295295
}
296296
],
297297
"extra-files": [
298-
{
299-
"type": "toml",
300-
"path": "pyproject.toml",
301-
"jsonpath": "$.project.version"
302-
},
303298
{
304299
"type": "yaml",
305300
"path": "charts/langwatch/Chart.yaml",

.github/workflows/deployment-impact-check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ permissions:
2525

2626
jobs:
2727
check:
28+
# Release PRs are exempt. release-please writes their description itself
29+
# from the changelog, so there is no author to fill the section in, and the
30+
# operator impact of everything the release carries was already stated on
31+
# the PRs that composed it.
32+
#
33+
# Same-repo only: a fork can name its branch anything, and the branch name
34+
# alone would let it opt out of the gate. release-please only ever opens
35+
# PRs from inside the upstream repo, matching the guard in
36+
# release-please-chart-lock-sync.yml.
37+
if: |
38+
!(github.event.pull_request.head.repo.full_name == github.repository &&
39+
startsWith(github.head_ref, 'release-please--'))
2840
runs-on: ubuntu-latest
2941
steps:
3042
- name: Verify deployment-impact section in PR description

.github/workflows/go-services.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ jobs:
195195
196196
- name: Assert gateway subchart renders under the umbrella
197197
run: |
198-
if ! grep -q "app.kubernetes.io/name: gateway" /tmp/umbrella.yaml; then
198+
# Assert on the Source marker helm stamps on every rendered file, not on
199+
# the gateway's pod label: sibling charts legitimately SELECT that label
200+
# (langyagent's NetworkPolicy has an egress rule to the gateway), so a
201+
# label grep answers "does anything mention the gateway", not "did the
202+
# subchart render".
203+
if ! grep -q "^# Source: langwatch/charts/gateway/" /tmp/umbrella.yaml; then
199204
echo "umbrella chart did NOT include the gateway subchart — dependency broken?"
200205
exit 1
201206
fi
@@ -204,14 +209,50 @@ jobs:
204209
exit 1
205210
fi
206211
212+
- name: Assert the gateway follows the release name to the control plane
213+
working-directory: charts/langwatch
214+
run: |
215+
# A fixed control-plane address resolves only on an install named the
216+
# same as ours, and the failure is silent: every pod healthy, then
217+
# every virtual-key request refused. Render under a release name that
218+
# is deliberately NOT "langwatch" so a hardcoded default cannot pass.
219+
helm template lw . --set autogen.enabled=true --dry-run > /tmp/umbrella-lw.yaml
220+
if ! grep -q 'LW_GATEWAY_BASE_URL: "http://lw-app:5560"' /tmp/umbrella-lw.yaml; then
221+
echo "gateway control-plane URL does not follow the release name:"
222+
grep "LW_GATEWAY_BASE_URL" /tmp/umbrella-lw.yaml || echo " (not rendered at all)"
223+
exit 1
224+
fi
225+
226+
# An address the operator set is theirs, not a starting point.
227+
helm template lw . --set autogen.enabled=true \
228+
--set gateway.controlPlane.baseUrl=http://elsewhere.internal:9000 --dry-run \
229+
> /tmp/umbrella-cp-override.yaml
230+
if ! grep -q 'LW_GATEWAY_BASE_URL: "http://elsewhere.internal:9000"' /tmp/umbrella-cp-override.yaml; then
231+
echo "an explicit gateway.controlPlane.baseUrl was overridden by the derived one"
232+
exit 1
233+
fi
234+
235+
# The derivation can only assume the default app port, so an app moved
236+
# off it has to be refused rather than silently dialled.
237+
if helm template lw . --set autogen.enabled=true --set app.service.port=8080 --dry-run \
238+
> /tmp/umbrella-cp-port.yaml 2>&1; then
239+
echo "a non-default app.service.port with no gateway.controlPlane.baseUrl should fail to render"
240+
exit 1
241+
fi
242+
if ! grep -q "gateway.controlPlane.baseUrl" /tmp/umbrella-cp-port.yaml; then
243+
echo "the refusal does not name the value that fixes it:"
244+
cat /tmp/umbrella-cp-port.yaml
245+
exit 1
246+
fi
247+
207248
- name: helm template (umbrella gateway disabled)
208249
working-directory: charts/langwatch
209250
run: |
210251
helm template langwatch . --set autogen.enabled=true --set gateway.chartManaged=false --dry-run > /tmp/umbrella-no-gw.yaml
211252
212253
- name: Assert opt-out drops the gateway
213254
run: |
214-
if grep -q "app.kubernetes.io/name: gateway" /tmp/umbrella-no-gw.yaml; then
255+
if grep -q "^# Source: langwatch/charts/gateway/" /tmp/umbrella-no-gw.yaml; then
215256
echo "gateway.chartManaged=false should suppress the subchart"
216257
exit 1
217258
fi

.github/workflows/langevals-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- uses: ./.github/actions/detect-changes
2929
id: detect
3030
with:
31+
# push-strategy diff: the test job spends real LLM money, so it
32+
# must not run on pushes that touched nothing under langevals/.
33+
push-strategy: diff
3134
filters: |
3235
relevant:
3336
- 'langevals/**'

.github/workflows/langwatch-chart.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
flags: "--set autogen.enabled=true -f examples/overlays/size-prod.yaml -f examples/overlays/access-ingress.yaml"
4242
- name: ha+ingress+replicated
4343
flags: "--set autogen.enabled=true -f examples/overlays/size-ha.yaml -f examples/overlays/access-ingress.yaml -f examples/overlays/clickhouse-replicated.yaml"
44-
- name: langy
45-
flags: "--set autogen.enabled=true -f examples/overlays/langy-assistant.yaml"
46-
- name: langy+unsandboxed
47-
flags: "--set autogen.enabled=true -f examples/overlays/langy-assistant.yaml -f examples/overlays/langy-assistant-unsandboxed.yaml"
44+
- name: langy-gvisor
45+
flags: "--set autogen.enabled=true -f examples/overlays/langy-gvisor.yaml"
46+
- name: langy-disabled
47+
flags: "--set autogen.enabled=true -f examples/overlays/langy-disabled.yaml"
4848
- name: prod+external-ch
4949
flags: "--set autogen.enabled=true -f examples/overlays/size-prod.yaml -f examples/overlays/clickhouse-external.yaml"
5050
- name: prod+ext-pg+ext-redis

.github/workflows/mcp-javascript-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ jobs:
2727
- uses: ./.github/actions/detect-changes
2828
id: detect
2929
with:
30+
# push-strategy diff + no release-please-manifest entry: the
31+
# integration step spends real LLM money (Anthropic), so it must
32+
# not run on pushes or release PRs that touched nothing under
33+
# mcp-server/. A release PR still matches via
34+
# mcp-server/CHANGELOG.md.
35+
push-strategy: diff
3036
filters: |
3137
relevant:
3238
- 'mcp-server/**'
3339
- '.github/workflows/mcp-javascript-ci.yml'
3440
- '.github/actions/setup-pnpm-node/**'
35-
- '.github/.release-please-manifest.json'
3641
3742
typecheck:
3843
needs: changes

.github/workflows/sdk-go-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ jobs:
2727
- uses: ./.github/actions/detect-changes
2828
id: detect
2929
with:
30+
# push-strategy diff + no release-please-manifest entry: the test
31+
# job spends real LLM money, so it must not run on pushes or
32+
# release PRs that touched nothing under sdk-go/. An SDK release
33+
# PR still matches via sdk-go/CHANGELOG.md.
34+
push-strategy: diff
3035
filters: |
3136
relevant:
3237
- 'sdk-go/**'
3338
- '.github/workflows/sdk-go-ci.yml'
34-
- '.github/.release-please-manifest.json'
3539
3640
test:
3741
needs: changes

.github/workflows/sdk-javascript-cd.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ jobs:
4141
- name: Run tests
4242
working-directory: ./typescript-sdk
4343
env:
44-
OPENAI_API_KEY: ${{ secrets.TYPESCRIPT_SDK_OPENAI_API_KEY }}
44+
# OpenAI traffic rides the LangWatch AI Gateway (virtual key +
45+
# gateway base URL), same as sdk-javascript-ci.yml.
46+
OPENAI_API_KEY: ${{ secrets.TYPESCRIPT_SDK_GATEWAY_VIRTUAL_KEY }}
47+
OPENAI_BASE_URL: https://gateway.langwatch.ai/v1
48+
OPENAI_API_BASE: https://gateway.langwatch.ai/v1
4549
LANGWATCH_ENDPOINT: ${{ secrets.TYPESCRIPT_SDK_LANGWATCH_ENDPOINT }}
4650
LANGWATCH_API_KEY: ${{ secrets.TYPESCRIPT_SDK_LANGWATCH_API_KEY }}
4751
run: pnpm test

0 commit comments

Comments
 (0)