Repository navigation
Conversation
… is active The dev server deactivates an override when the user deletes it. If the user sets the flag again, UpsertOverride must make the row active again. No test covered this case. If the update keeps the old active value, the dev server serves the source value, and the new override does nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a change to
UpsertOverridekeeps the oldactivevalue, a developer who deletes an override and then sets the flag again gets the source value from the dev server. The new override does nothing, and no test fails.This PR adds tests only. It adds one subtest (+25 lines) to
TestDBFunctionsininternal/dev_server/db/sqlite_test.go. It does not change library code.Requirements
Related issues
None. This PR adds only a test.
Describe the solution you've provided
The subtest runs after the existing
DeactivateOverridesubtest, so the override forflag-1is inactive. It callsUpsertOverrideforflag-1with a new value. Then it makes sure that the returned override and the row fromGetOverridesForProjectare both active and have the new value.I ran these checks on main
e12bf55with Go 1.27.4:go test ./internal/dev_server/db/passes with the new subtest.gofmt -landgo vetreport nothing for the package. I did not rungolangci-lint.active=excluded.activetoactive=activein theON CONFLICTclause ofUpsertOverride. Then I rango test ./.... The new subtest was the only new failure.TestGoldenIndexBytesininternal/symbols/r8indexalso fails on clean main on my machine.Describe alternatives you've considered
None.
Additional context
None.
This test was written with Claude Code during a planted-bug run by SK @ Trenyx.
Note
Overview
Adds a subtest to
TestDBFunctionsininternal/dev_server/db/sqlite_test.gothat runs after the existing DeactivateOverride case. It callsUpsertOverrideon a previously deactivated override with a new value and asserts the returned row andGetOverridesForProjectboth showActive: truewith the updated value.No production code changes — this only locks in the expectation that upserting an override after deactivation turns it back on, rather than leaving it inactive so the dev server still serves source flag values.
Reviewed by Cursor Bugbot for commit 64116cc. Bugbot is set up for automated code reviews on this repo. Configure here.