Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.
JavaScript agent-orchestrationagentic-workflowai-agentsai-codingclaude-codecode-reviewcodebuddycodexcoding-agentscursordeveloper-toolshuman-on-the-loopllmmcpmulti-agentsdlcself-hostedsopworkflow-automationworkflow-engine
package repo
import (
"testing"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
func TestSQLPayloadJSONTextSQLite(t *testing.T) {
s, err := OpenTest()
if err != nil {
t.Fatal(err)
}
t.Cleanup(s.Close)
d := &deps{DB: s.DB}
cases := map[string]string{
"tapdId": "json_extract(payload, '$.tapdId')",
"externalRef.externalUrl": "json_extract(payload, '$.externalRef.externalUrl')",
"clarification.startedAt": "json_extract(payload, '$.clarification.startedAt')",
}
for path, want := range cases {
if got := d.sqlPayloadJSONText(path); got != want {
t.Fatalf("sqlPayloadJSONText(%q) = %q, want %q", path, got, want)
}
}
}
func TestSQLPayloadJSONTextMySQL(t *testing.T) {
db, err := gorm.Open(mysql.New(mysql.Config{
DSN: "user:pass@tcp(127.0.0.1:1)/agentflow",
SkipInitializeWithVersion: true,
}), &gorm.Config{DisableAutomaticPing: true})
if err != nil {
t.Fatal(err)
}
d := &deps{DB: db}
if !d.isMySQL() {
t.Fatal("expected mysql dialect")
}
cases := map[string]string{
"deliveryState": "JSON_UNQUOTE(JSON_EXTRACT(payload, '$.deliveryState'))",
"externalRef.externalUrl": "JSON_UNQUOTE(JSON_EXTRACT(payload, '$.externalRef.externalUrl'))",
"operations": "JSON_UNQUOTE(JSON_EXTRACT(payload, '$.operations'))",
}
for path, want := range cases {
if got := d.sqlPayloadJSONText(path); got != want {
t.Fatalf("sqlPayloadJSONText(%q) = %q, want %q", path, got, want)
}
}
}
func TestSQLExecutionContextJSONText(t *testing.T) {
s, err := OpenTest()
if err != nil {
t.Fatal(err)
}
t.Cleanup(s.Close)
sqlite := &deps{DB: s.DB}
mysqlDB, err := gorm.Open(mysql.New(mysql.Config{
DSN: "user:pass@tcp(127.0.0.1:1)/agentflow",
SkipInitializeWithVersion: true,
}), &gorm.Config{DisableAutomaticPing: true})
if err != nil {
t.Fatal(err)
}
my := &deps{DB: mysqlDB}
cases := []struct {
d *deps
path string
want string
}{
{sqlite, "issueId", "json_extract(execution_context, '$.issueId')"},
{sqlite, "projectId", "json_extract(execution_context, '$.projectId')"},
{my, "issueId", "JSON_UNQUOTE(JSON_EXTRACT(execution_context, '$.issueId'))"},
{my, "projectId", "JSON_UNQUOTE(JSON_EXTRACT(execution_context, '$.projectId'))"},
}
for _, c := range cases {
if got := c.d.sqlExecutionContextJSONText(c.path); got != c.want {
t.Fatalf("sqlExecutionContextJSONText(%q) = %q, want %q", c.path, got, c.want)
}
}
}