Feat v0.7.2 package runners ci gate #56

Merged
xcaliber merged 17 commits from feat/v0.7.2-package-runners-ci-gate into main 2026-04-02 12:10:57 +00:00
2 changed files with 19 additions and 0 deletions
Showing only changes of commit 6ebffc1078 - Show all commits

View File

@@ -5,6 +5,7 @@ package handlers
import (
"encoding/base64"
"encoding/json"
"log"
"net/http"
"github.com/gin-gonic/gin"
@@ -30,6 +31,7 @@ func (h *ConnectionHandler) ListConnections(c *gin.Context) {
// so users can see which connections are available to them.
conns, err := h.stores.Connections.ListAccessible(c.Request.Context(), userID)
if err != nil {
log.Printf("[connections] ListAccessible failed for user %s: %v", userID, err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to list connections"})
return
}

View File

@@ -253,6 +253,23 @@ func InstallWorkflowFromManifest(ctx *gin.Context, stores store.Stores, pkgID st
}
}
// Publish version 1 (snapshot of stages) and activate the workflow
// so it's immediately usable after install.
stages, _ := stores.Workflows.ListStages(reqCtx, workflowID)
snapshot, _ := json.Marshal(stages)
ver := &models.WorkflowVersion{
WorkflowID: workflowID,
VersionNumber: 1,
Snapshot: snapshot,
}
if err := stores.Workflows.Publish(reqCtx, ver); err != nil {
log.Printf("[workflow-pkg] failed to publish version for %s: %v", pkgID, err)
}
active := true
if err := stores.Workflows.Update(reqCtx, workflowID, models.WorkflowPatch{IsActive: &active}); err != nil {
log.Printf("[workflow-pkg] failed to activate %s: %v", pkgID, err)
}
// Store workflow_id in package_settings for reference
settingsJSON, _ := json.Marshal(map[string]string{"workflow_id": workflowID})
stores.Packages.SetPackageSettings(reqCtx, pkgID, json.RawMessage(settingsJSON))