Compare commits

...

2 Commits

Author SHA1 Message Date
core-be 59629518e5 fix(handlers): repair instructions_test.go compile errors
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 24s
CI / Detect changes (pull_request) Successful in 1m14s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m18s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m33s
Harness Replays / detect-changes (pull_request) Successful in 25s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m17s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 24s
qa-review / approved (pull_request) Successful in 23s
security-review / approved (pull_request) Successful in 24s
sop-checklist / all-items-acked (pull_request) Successful in 19s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 57s
gate-check-v3 / gate-check (pull_request) Successful in 44s
sop-tier-check / tier-check (pull_request) Successful in 22s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m31s
CI / Canvas (Next.js) (pull_request) Successful in 12s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 9s
audit-force-merge / audit (pull_request) Has been skipped
Harness Replays / Harness Replays (pull_request) Successful in 10s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 13s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 15s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m6s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 5m1s
CI / Platform (Go) (pull_request) Failing after 17m14s
CI / all-required (pull_request) Successful in 9s
- Remove unused import: "github.com/Molecule-AI/molecule-monorepo/platform/internal/db"
- Replace invalid http.BadRequest with http.StatusBadRequest (const, not a field)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:11:39 +00:00
core-be 6ab4a7791a fix(handlers): add rows.Err() checks after all secrets scan loops
Harness Replays / detect-changes (pull_request) Successful in 22s
sop-checklist / na-declarations (pull_request) awaiting /sop-n/a declaration for: qa-review, security-review
Harness Replays / Harness Replays (pull_request) Successful in 10s
audit-force-merge / audit (pull_request) Has been skipped
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 26s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m38s
CI / Detect changes (pull_request) Successful in 1m51s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m44s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 23s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m45s
gate-check-v3 / gate-check (pull_request) Successful in 42s
qa-review / approved (pull_request) Failing after 32s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m34s
security-review / approved (pull_request) Failing after 27s
sop-checklist / all-items-acked (pull_request) Successful in 31s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m12s
sop-tier-check / tier-check (pull_request) Successful in 23s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 10s
CI / Canvas (Next.js) (pull_request) Successful in 11s
CI / Python Lint & Test (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 10s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 6s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m59s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 3m56s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 3m44s
CI / all-required (pull_request) Successful in 9s
Regression from audit #109: rows.Err() checks were removed from List,
ListGlobal, restartAllAffectedByGlobalKey, and Values between commits
3a30b073 and b25b4fb6. Without these checks, a mid-stream query error
(e.g. connection loss during iteration) is silently ignored and partial
results are returned as if the query succeeded.

Fix: add if err := rows.Err(); err != nil { log.Printf(...) } after
every for rows.Next() loop in secrets.go.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:07:44 +00:00
2 changed files with 19 additions and 2 deletions
@@ -11,7 +11,6 @@ import (
"time"
"github.com/DATA-DOG/go-sqlmock"
"github.com/Molecule-AI/molecule-monorepo/platform/internal/db"
"github.com/gin-gonic/gin"
)
@@ -193,7 +192,7 @@ func TestInstructionsHandler_Create_InvalidScope(t *testing.T) {
handler.Create(c)
if w.Code != http.BadRequest {
if w.Code != http.StatusBadRequest {
t.Fatalf("expected 400, got %d: %s", w.Code, w.Body.String())
}
}
@@ -63,6 +63,9 @@ func (h *SecretsHandler) List(c *gin.Context) {
"updated_at": updatedAt,
})
}
if err := rows.Err(); err != nil {
log.Printf("List secrets rows.Err: %v", err)
}
// 2. Global secrets not overridden at workspace level
globalRows, err := db.DB.QueryContext(ctx,
@@ -91,6 +94,9 @@ func (h *SecretsHandler) List(c *gin.Context) {
"updated_at": updatedAt,
})
}
if err := globalRows.Err(); err != nil {
log.Printf("List secrets (global) rows.Err: %v", err)
}
c.JSON(http.StatusOK, secrets)
}
@@ -174,6 +180,9 @@ func (h *SecretsHandler) Values(c *gin.Context) {
out[k] = string(decrypted)
}
}
if err := globalRows.Err(); err != nil {
log.Printf("secrets.Values globalRows.Err: %v", err)
}
}
wsRows, wErr := db.DB.QueryContext(ctx,
@@ -195,6 +204,9 @@ func (h *SecretsHandler) Values(c *gin.Context) {
out[k] = string(decrypted) // workspace override wins over global
}
}
if err := wsRows.Err(); err != nil {
log.Printf("secrets.Values wsRows.Err: %v", err)
}
}
if len(failedKeys) > 0 {
@@ -324,6 +336,9 @@ func (h *SecretsHandler) ListGlobal(c *gin.Context) {
"scope": "global",
})
}
if err := rows.Err(); err != nil {
log.Printf("ListGlobal rows.Err: %v", err)
}
c.JSON(http.StatusOK, secrets)
}
@@ -400,6 +415,9 @@ func (h *SecretsHandler) restartAllAffectedByGlobalKey(key string) {
ids = append(ids, id)
}
}
if err := rows.Err(); err != nil {
log.Printf("restartAllAffectedByGlobalKey rows.Err: %v", err)
}
if len(ids) == 0 {
return
}