Skip to content

Fix cross-project deploy and add --remove-unmapped to project deploy - #1588

Open
midigofrank wants to merge 1 commit into
release/nextfrom
ofn-4761-cross-project-deploy
Open

midigofrank wants to merge 1 commit into
release/nextfrom
ofn-4761-cross-project-deploy

Conversation

@midigofrank

Copy link
Copy Markdown
Contributor

Short Description

Deploying a workspace to a different project sent none of its workflows. Cross-project deploys now send every local workflow, and a new --remove-unmapped flag deletes target workflows that don't exist locally.

Fixes OFN-4761, OFN-4762

Implementation Details

  • Root cause: merge candidates came from findLocallyChangedWorkflows, which compares the workspace with its own forked_from. An unchanged workspace of A had no candidates, so deploying it to B sent B's workflows back unchanged (only a channel diff got past "Nothing to deploy"). This broke Lightning's GitHub -> OpenFn setup: green run, nothing deployed.
  • When the target uuid differs from the local project's, deploy now takes the existing skipLocallyChangedCheck path: every local workflow is a candidate.
  • --remove-unmapped (off by default): target workflows whose id isn't in the local project are sent as delete: true, and count as a change. Done in deploy rather than via Project.merge's removeUnmapped, which only omits workflows (Lightning rejects that) and would delete unchanged workflows under onlyUpdated.
  • The divergence error now says when the target is a different project. --force is still required in that case.
  • @openfn/project now exports Workflow.

QA Notes

  • New deploy tests: unchanged A → B sends A's workflow and keeps B's; with --remove-unmapped B ends with only A's; same-project --remove-unmapped deletes a remote-only workflow; cross-project divergence message and --force. All fail before the fix.
  • --remove-unmapped on a same-project deploy also deletes workflows created in Lightning since the last sync, without a divergence warning. That's what the flag means, but worth documenting.
  • The printed plan doesn't list --remove-unmapped deletes (it diffs workspace vs remote, not the payload); --json-diff does.
  • Will conflict trivially with the OFN-4760 PR in deploy.ts.
  • Full-package ava runs segfault locally (also on the base commit); every test file passes individually.

AI Usage

  • I have used Claude Code
  • I have used another model
  • I have not used AI

Deploying a workspace to a different project now treats every local
workflow as a merge candidate, instead of only those changed since the
workspace's own last sync. --remove-unmapped sends delete entries for
target workflows that don't exist locally.
@josephjclark
josephjclark force-pushed the ofn-4761-cross-project-deploy branch from c41f26d to 54032a0 Compare October 16, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

2 participants