test(chat_files): pin lazy-heal mint contract for both Upload and Download - #2370
Merged
Merged
Conversation
…nload The 2026-04-30 lazy-heal fix in chat_files.go (PR #2366) ATTEMPTS to mint platform_inbound_secret on miss so legacy workspaces self-heal without requiring destructive reprovision. The pre-existing TestChatUpload_NoInboundSecret + TestChatDownload_NoInboundSecret tests asserted the 503 response shape but did NOT pin that the mint UPDATE actually fires — they happened to exercise the mint-failure branch (sqlmock unmatched UPDATE = error = "Failed to mint" code path returns 503 with "RFC #2312" detail, which still passed the original assertions). This means a regression that: - skipped the lazy-heal mint entirely - inverted the success/failure response branches - moved the mint to a different code path would not fail those tests. Fix: - TestChatUpload_NoInboundSecret_LazyHeal: mock the UPDATE successfully; assert sqlmock.ExpectationsWereMet (mint MUST run) + body contains "retry" + "30" (success branch). - TestChatUpload_NoInboundSecret_LazyHealFailure: mock the UPDATE to fail; assert body contains "Reprovision" (failure branch). - Same pair for the Download handler — independent code path means independent test. Pins both branches of both handlers (4 tests) so future drift trips the gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
April 30, 2026 09:38
HongmingWang-Rabbit
enabled auto-merge
April 30, 2026 09:38
This was referenced Apr 30, 2026
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
…RC) Per CR2 RC: the status-reaper observability fix was complete, but the merge-queue exception handlers in main() still returned 0 on ApiError, URLError, and TimeoutError. This hid persistent infra issues from operators — the cron stayed green while the queue could not evaluate merge state. Now all three handlers return 1 so the cron job surfaces red and operators are paged to investigate. Diff-proof: 52/52 gitea-merge-queue tests pass. Refs: core#2370, CR2 RC.
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
…ability hardening' (#2370) from fix/status-reaper-observability into main 2 genuine officials current head + required-green, mergeable — direct-merge (avoid rebase-churn approval-dismissal). CTO diff-reviewed (efficiency unblock).
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.
Summary
The 2026-04-30 lazy-heal fix in `chat_files.go` (PR #2366) attempts to mint `platform_inbound_secret` on miss so legacy workspaces self-heal without requiring destructive reprovision.
The pre-existing `TestChatUpload_NoInboundSecret` + `TestChatDownload_NoInboundSecret` tests asserted the 503 response shape but did NOT pin that the mint UPDATE actually fires — they happened to exercise the mint-failure branch (sqlmock unmatched UPDATE = err = "Failed to mint" code path returns 503 with "RFC #2312" detail, which still passed the original assertions).
A regression that skipped the lazy-heal mint entirely, inverted the success/failure branches, or moved the mint elsewhere would not fail those tests.
Changes
Replaced each of the two existing tests with a pair pinning both branches:
Independent code paths into `ReadPlatformInboundSecret` mean each handler gets its own test — a partial regression that healed Upload but skipped Download is now a test failure, not a quiet ship.
Test plan
🤖 Generated with Claude Code