Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR modifies database test setup/teardown across three files to preserve shared Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
71257bb to
33fd1fc
Compare
|
|
Confidence Score: 5/5Safe to merge; the only findings are P2 test naming and coverage observations that do not affect production behaviour. All three code changes (DB test isolation, streaming default, alias matching) are logically correct. The two P2 findings are limited to test names and an unreachable unit-test case — neither affects runtime correctness or data integrity. plugins/prompts/plugin_test.go — misleading test name and an unreachable unit-test case worth cleaning up before the file grows larger.
|
| Filename | Overview |
|---|---|
| framework/configstore/migrations_test.go | Uses DELETE FROM migrations instead of DROP TABLE to preserve the shared migrations table for concurrent test packages; logic is sound. |
| framework/logstore/migrations_test.go | Same DELETE FROM migrations pattern applied consistently; cleanup is scoped to logs table and GIN index only, leaving migrations table intact. |
| framework/logstore/rdb_postgres_perf_test.go | Test setup and cleanup both use DELETE FROM migrations correctly; no regression risk. |
| plugins/prompts/plugin_test.go | Test name and function comment for TestHTTPTransportPreHook_NoStreamParam_NoStreamContext directly contradict the actual assertion (stream IS expected to be true); the empty-params test case in TestIncludesStreamInModelParams exercises a code branch that is unreachable through the production path. |
| transports/bifrost-http/handlers/providers.go | Alias matching in keyAllowsModelForList is directionally correct (specific-version → base) and only affects listing visibility, not auth. |
Comments Outside Diff (1)
-
plugins/prompts/plugin_test.go, line 807-827 (link)Test name and doc comment contradict the assertion
Both the function name (
_NoStreamContext) and the leading comment ("the stream context key is not set") describe the old behaviour, but the assertion on line 825 expectsBifrostContextKeyPromptStreamRequestto equaltrue. Any future reader relying on the name or comment will get exactly the wrong mental model of what this PR changed.
Reviews (1): Last reviewed commit: "fixes failing tests" | Re-trigger Greptile
| {"absent key", tables.ModelParams{"temperature": 0.7}, true}, | ||
| {"empty params", tables.ModelParams{}, true}, |
There was a problem hiding this comment.
Unit-test case is unreachable through the production path
includesStreamInModelParams correctly returns true for an empty map, but setPromptStreamFromVersionForTransport (in main.go) guards with len(version.ModelParams) == 0 { return } before ever calling this function. A version with no params will therefore never set BifrostContextKeyPromptStreamRequest, regardless of what this function returns.
The isolated unit test is harmless, but it gives a false signal about observable behaviour. Consider adding an integration-style test through HTTPTransportPreHook with a version whose ModelParams is truly empty, and document the expected result explicitly (streaming context is not set in that case).

Summary
Fixes database test isolation issues by preserving the shared migrations table across concurrent test packages, and changes the default streaming behavior for prompts to enable streaming by default when no explicit stream parameter is provided.
Changes
DELETE FROM migrationsinstead ofDROP TABLE migrations, preventing interference between concurrent test packages that share the same PostgreSQL instancetrue) when nostreamparameter is specified in model parameters, rather than defaulting to disabledType of change
Affected areas
How to test
Validate database test isolation and streaming behavior:
Screenshots/Recordings
N/A
Breaking changes
The streaming behavior change is potentially breaking - applications that previously relied on streaming being disabled by default when no
streamparameter was provided will now have streaming enabled by default. This affects the prompt plugin's behavior and may impact downstream consumers expecting non-streaming responses.Related issues
N/A
Security considerations
The database test isolation changes improve test reliability but don't introduce security implications. The streaming default change and model alias matching don't affect authentication or authorization mechanisms.
Checklist
docs/contributing/README.mdand followed the guidelines