Generated with Hive: Add shareRef to HtmlPage for secure public links - #5232
Open
gonzaloaune wants to merge 39 commits into
Open
Generated with Hive: Add shareRef to HtmlPage for secure public links#5232gonzaloaune wants to merge 39 commits into
gonzaloaune wants to merge 39 commits into
Conversation
…lope ## Why PR #5224 changed the outbound Stakwork `/projects` request body from a flat object to `{ project: stakworkPayload }`. 156 unit tests across 7 files still assert against the old flat shape (`body.workflow_id`, `body.workflow_params.set_var.attributes.vars`, `body.webhook_url`, etc.), so they now read `undefined` and fail. Build, lint, integration, and Playwright all pass — only these payload-shape assertions need updating. ## Change Update the assertions/mocks in the affected test files to read the payload from the nested `project` envelope (e.g. `body.project.workflow_id`, `body.project.workflow_params.set_var.attributes.vars`, `body.project.webhook_url`, `body.project.webhook_full_output`). No production code changes — this only realigns tests with the new wrapped request shape.
…k_full_output survives
## Problem
For plan_mode / workflow_editor runs, `callStakworkAPI` sets `webhook_full_output: false` as a top-level key in the Stakwork `/projects` request body. But Stakwork stores `webhook_full_output: true` anyway.
## Root cause
Hive sends a **flat** JSON body (no `{ project: ... }` envelope). Stakwork's `ProjectsController` relies on Rails `wrap_parameters` (`format: [:json]`, no explicit `include`), which wraps **only real `Project` DB columns** into `params[:project]`. `webhook_full_output` (like `stop_on_errors` and `debug_mode`) is NOT a column — it lives inside the `project_configs` JSON blob — so the wrapper drops it. Strong params then see `nil`, and `create_project` defaults it back to `true`.
If the body is sent pre-nested under `project`, Rails uses the explicit nested key as-is and the drop does not happen.
## Fix
Wrap the outbound payload as `{ project: stakworkPayload }` in `callStakworkAPI` so `webhook_full_output` (and the other non-column config keys) are correctly nested. Sending a body that already has a `project` root key is safe: `wrap_parameters` only *adds* a synthetic copy, it never alters an already-present `project` key.
Two independent commits (one on this branch, one merged in from master) each added a migration for HtmlPage.shareRef with identical SQL, causing prisma migrate deploy to fail with P3018 (column already exists) on the second one. Keep the earlier migration (20260902140000_add_html_page_share_ref) and drop the later duplicate (20260902180000_add_html_page_share_ref).
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.
Generated with Hive: Add shareRef to HtmlPage for secure public links