From 4c86c5e6594fe8272ad53cbfbb6671e260f7a442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Mon, 14 Sep 2026 11:18:41 +0800 Subject: [PATCH] fix(httpapi): accept planned in the test-publications state filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit validProcessingState predated policy-driven ingestion and rejected processing_state=planned with a 400, so the 待入库 lane silently fetched an empty plan list while annotation, fetch and planning had all succeeded. --- internal/httpapi/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/httpapi/server.go b/internal/httpapi/server.go index 443db8b..9056a8a 100644 --- a/internal/httpapi/server.go +++ b/internal/httpapi/server.go @@ -1678,7 +1678,7 @@ func getReleaseBatch(w http.ResponseWriter, r *http.Request, store Store) { func listTestPublications(w http.ResponseWriter, r *http.Request, store Store) { filter := governance.TestPublicationFilter{ProcessingState: r.URL.Query().Get("processing_state"), TargetScope: r.URL.Query().Get("target_scope"), Limit: 50} if filter.ProcessingState != "" && !validProcessingState(filter.ProcessingState) { - writeJSON(w, http.StatusBadRequest, map[string]string{"error": "processing_state must be pending, processing, finalizing, completed, failed, or stalled"}) + writeJSON(w, http.StatusBadRequest, map[string]string{"error": "processing_state must be planned, pending, processing, finalizing, completed, failed, or stalled"}) return } if filter.TargetScope != "" && filter.TargetScope != "internal" && filter.TargetScope != "external" { @@ -1932,7 +1932,7 @@ func decodeStrictJSON(r *http.Request, destination any) error { func validProcessingState(state string) bool { switch state { - case "pending", "processing", "finalizing", "completed", "failed", "stalled": + case "planned", "pending", "processing", "finalizing", "completed", "failed", "stalled": return true default: return false