Skip to content

Generated with Hive: Add shareRef to HtmlPage for secure public links - #5232

Open
gonzaloaune wants to merge 39 commits into
masterfrom
swarm/swarm-change-381a8d6a
Open

Generated with Hive: Add shareRef to HtmlPage for secure public links#5232
gonzaloaune wants to merge 39 commits into
masterfrom
swarm/swarm-change-381a8d6a

Conversation

@gonzaloaune

Copy link
Copy Markdown
Collaborator

Generated with Hive: Add shareRef to HtmlPage for secure public links

gonzaloaune and others added 4 commits September 2, 2026 13:39
…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.
@gonzaloaune gonzaloaune added the system label Sep 2, 2026 — with Hive Chat PM
gonzaloaune and others added 25 commits September 2, 2026 17:30
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants