Skip to content

Commit 9353e4b

Browse files
committed
feat(api): ensure StackRunConfig
StackRunConfig is part of our public API, ensure stability of this datatype using a pytest snapshot test. If the pydantic model changes, it will fail. Signed-off-by: Charlie Doern <[email protected]>
1 parent 48a551e commit 9353e4b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/conformance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ jobs:
6969
oasdiff breaking --fail-on ERR base/docs/_static/llama-stack-spec.yaml docs/_static/llama-stack-spec.yaml --match-path '^/v1/openai/v1' \
7070
--match-path '^/v1/vector-io' \
7171
--match-path '^/v1/vector-dbs'
72+
73+
- name: Run Pydantic Model Test
74+
run: |
75+
python ./scripts/pydantic-diff.py

scripts/pydantic-diff.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the terms described in the LICENSE file in
5+
# the root directory of this source tree.
6+
7+
from llama_stack.core.datatypes import StackRunConfig
8+
9+
10+
def test_build_config_v1_schema_is_unchanged(snapshot):
11+
"""
12+
Ensures the V1 schema never changes.
13+
"""
14+
snapshot.assert_match(StackRunConfig.model_json_schema(), "stored_build_config_v1_schema.json")

0 commit comments

Comments
 (0)