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:
@@ -1678,7 +1678,7 @@ func getReleaseBatch(w http.ResponseWriter, r *http.Request, store Store) {
|
|||||||
func listTestPublications(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}
|
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) {
|
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
|
return
|
||||||
}
|
}
|
||||||
if filter.TargetScope != "" && filter.TargetScope != "internal" && filter.TargetScope != "external" {
|
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 {
|
func validProcessingState(state string) bool {
|
||||||
switch state {
|
switch state {
|
||||||
case "pending", "processing", "finalizing", "completed", "failed", "stalled":
|
case "planned", "pending", "processing", "finalizing", "completed", "failed", "stalled":
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user