Skip to content

Commit 3869bf4

Browse files
committed
fix(ci): preserve remaining compatibility coverage
1 parent da315c5 commit 3869bf4

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- next
8+
- 'stl/**'
89
pull_request:
910
branches:
1011
- main

‎scripts/detect-breaking-changes‎

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ SUPPORT_PATHS=(
2525
openai-java-core/src/test/kotlin/com/openai/core/StructuredOutputsTestUtils.kt
2626
)
2727

28-
# These generated tests explicitly exercise Kotlin `internal` structured-output or validation
29-
# helpers. They remain covered by the normal test suite, but are not consumer fixtures and must not
30-
# define the public compatibility surface.
28+
# This generated test explicitly exercises Kotlin `internal` structured-output helpers. It remains
29+
# covered by the normal test suite, but is not a consumer fixture and must not define the public
30+
# compatibility surface.
3131
INTERNAL_FIXTURES=(
3232
openai-java-core/src/test/kotlin/com/openai/models/chat/completions/StructuredChatCompletionCreateParamsTest.kt
33-
openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt
34-
openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt
3533
)
3634

3735
# Multipart fixtures exercise public parameter builders and union factories, but their generated
@@ -93,6 +91,53 @@ for PATHSPEC in "${INTERNAL_FIXTURES[@]}"; do
9391
fi
9492
done
9593

94+
# These baseline tests combine public API coverage with Kotlin-internal implementation setup.
95+
# Replace them with consumer-style fixtures that preserve the public expressions without relying on
96+
# internal constructors or helpers.
97+
cat > "${COMPATIBILITY_ROOT}/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt" <<'KOTLIN'
98+
package com.openai.models.responses
99+
100+
import com.openai.models.ChatModel
101+
import com.openai.services.async.ResponseServiceAsync
102+
import com.openai.services.blocking.ResponseService
103+
104+
internal class StructuredResponseOutput(val value: String)
105+
106+
internal fun publicBuilder(): StructuredResponseCreateParams<StructuredResponseOutput> =
107+
StructuredResponseCreateParams.builder<StructuredResponseOutput>()
108+
.input("input")
109+
.model(ChatModel.GPT_4O_MINI)
110+
.text(StructuredResponseOutput::class.java)
111+
.build()
112+
113+
internal fun blockingServiceOverloads(
114+
service: ResponseService,
115+
params: StructuredResponseCreateParams<StructuredResponseOutput>,
116+
) {
117+
service.create(params)
118+
service.createStreaming(params)
119+
}
120+
121+
internal fun asyncServiceOverloads(
122+
service: ResponseServiceAsync,
123+
params: StructuredResponseCreateParams<StructuredResponseOutput>,
124+
) {
125+
service.create(params)
126+
service.createStreaming(params)
127+
}
128+
KOTLIN
129+
130+
cat > "${COMPATIBILITY_ROOT}/openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt" <<'KOTLIN'
131+
package com.openai.services
132+
133+
import com.openai.models.responses.ResponseStreamEvent
134+
135+
internal class ResponseStreamEventValidationTest {
136+
fun outputTextDelta(event: ResponseStreamEvent): String? =
137+
if (event.isOutputTextDelta()) event.asOutputTextDelta().delta() else null
138+
}
139+
KOTLIN
140+
96141
# Keep the public API coverage in structured-output fixtures while replacing only references to
97142
# Kotlin-internal constructors and JsonField helpers.
98143
replace_internal_reference() {

0 commit comments

Comments
 (0)