Fix integrate-postgres CI: implement real SQL workflow store and API controller#3966
Draft
Copilot wants to merge 2 commits into
Draft
Fix integrate-postgres CI: implement real SQL workflow store and API controller#3966Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…controller - pro/db/sql/workflow.go: Replace no-op stub with real SQL CRUD implementation for all workflow entities (templates, nodes, edges, runs, approvals) - pro/db/factory/factory.go: Wire DB connection into WorkflowStoreImpl so the dredd hooks get a functional store instead of a disconnected stub - pro/api/projects/workflows.go: Replace 404-stub handlers with real implementations backed by workflowRepo Root cause: addWorkflowApproval() in dredd hooks panicked because CreateWorkflowTemplate() returned an empty WorkflowTemplate (no Nodes), so the search for an approval-kind node found nothing and panicked, killing the hooks server and causing all subsequent dredd tests to fail.
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job integrate-postgres
Fix integrate-postgres CI: implement real SQL workflow store and API controller
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
integrate-postgres(andintegrate-sqlite) dredd jobs were crashing becauseaddWorkflowApproval()in the test hooks panicked whenworkflow.Nodeswas nil — a consequence ofCreateWorkflowTemplate()being a no-op stub that returned an empty struct. This killed the hooks server process, failing every subsequent dredd test.Changes
pro/db/sql/workflow.goCreateWorkflowTemplate/UpdateWorkflowTemplatehandle logical→DB node ID remapping so edgesource_node_id/destination_node_idreferences resolve correctly after autoincrement assignmentpro/db/factory/factory.goNewWorkflowStorenow type-asserts thedb.Storeto*coreSql.SqlDb, extracts the live connection viaGetConnection(), and passes it toNewWorkflowStoreImpl— previously the store was constructed with no connection at allpro/api/projects/workflows.goworkflowRepo db.WorkflowManagerfield to the controller and wired it throughNewWorkflowControllerResolveWorkflowApprovalusesResolveWorkflowApprovalIfPendingfor atomic status transitionGetWorkflowRunreturns aworkflowRunDetailsenvelope pairing each node with its approval record for the run