fix(httpapi): accept planned in the test-publications state filter

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.
This commit is contained in:
姚章浩
2026-09-14 11:18:41 +08:00
parent d24e402ef6
commit 4c86c5e659
+2 -2
View File
@@ -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