Skip to content

Update version hash#1238

Merged
josephjclark merged 14 commits intoversion-history-fixfrom
update-version-hash
Jan 29, 2026
Merged

Update version hash#1238
josephjclark merged 14 commits intoversion-history-fixfrom
update-version-hash

Conversation

@josephjclark
Copy link
Collaborator

A rewrite of the version hash algorithm to better align with Lightning

I am now convinced that lightning and the CLI MUST generate identical hashes, otherwise we can't really work out what's changed when deploying.

The basic strategy here is, rather than use the Project structure to generate the hash, convert to app state and use that. This means we're much more closer to the lightning structure, and it's a lot easier to compare the algos.

Fixes #1078

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

- Don't include keys in the hash
- Fixes for edges and triggers
This aligns the implementation a lot closer to lightnign

A couple of fixes in support of this
@josephjclark josephjclark changed the base branch from main to version-history-fix January 23, 2026 17:31
@github-project-automation github-project-automation bot moved this to New Issues in v2 Jan 23, 2026
@josephjclark
Copy link
Collaborator Author

Ok, that was super hard to debug, but I've finally got CLI and Lightning hashes to look identical.

All tests should be passing on this branch, so I've gotta investigate those fails before I can merge down

@josephjclark josephjclark merged commit be505e6 into version-history-fix Jan 29, 2026
6 checks passed
@josephjclark josephjclark deleted the update-version-hash branch January 29, 2026 08:11
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Jan 29, 2026
josephjclark added a commit that referenced this pull request Feb 16, 2026
* project: support forked_from key

* update forked_from to a map

* ensure history serializes

* only include forked_from if it has values

* add forked_from on checkkout

* project: omit forked_from from openfn object when loading from fs

* deploy changes against local server

* tweak error

* Update version hash (#1238)

version hash now matches Lightning

* update merge strategy with onlyUpdated option

We'll use this on deploy to ensure that only locally changed workflows get replaced in the merge

* typo in logging

* tidy

* fix fetch test

* types

* fix deploy sync and merge after deploy

* ensure trigger enabled state is tracked in workflow.yaml

* remove logs

* remove logs

* fix test

* update dry run messaging

* types

* fix tests

* another test fix

* integration tests

* alias [CLI] ⚠ WARNING: the project deploy command is in BETA and may not be stable. Use cautiously on production projects.

[CLI] ✘ Command failed!
[CLI] ✘ Error: ENOENT: no such file or directory, open '/home/joe/repo/openfn/kit/openfn.json'
    at readFileSync (node:fs:441:20)
    at findWorkspaceFile (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+project@0.12.1/node_modules/@openfn/project/dist/index.js:497:20)
    at parseProject (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+project@0.12.1/node_modules/@openfn/project/dist/index.js:836:29)
    at Project.from (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+project@0.12.1/node_modules/@openfn/project/dist/index.js:1398:16)
    at handler (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:2266:38)
    at parse (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:3684:18)
    at process.<anonymous> (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:3711:5)
    at process.emit (node:events:524:28)
    at emit (node:internal/child_process:949:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:91:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/joe/repo/openfn/kit/openfn.json'
} to
[Workspace] ⚠ Could not find openfn.yaml at /home/joe/repo/openfn/kit. Using default values.
[Workspace] ⚠ No projects found: directory at /home/joe/repo/openfn/kit/.projects does not exist

[CLI] ✘ Command failed!
[CLI] ✘ Error: No OpenFn projects found
    at handler5 (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:3338:11)
    at parse (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:3684:18)
    at process.<anonymous> (file:///home/joe/.local/share/pnpm/global/5/.pnpm/@OpenFn+cli@1.25.0/node_modules/@openfn/cli/dist/process/runner.js:3711:5)
    at process.emit (node:events:524:28)
    at emit (node:internal/child_process:949:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:91:21)

* project: lower case workflow names in hash

* project: allow a filter for workflow diffs

* revert lowercase

* revert lowercase

* smarter traacking of diffs and divergence

Tests are likely to break but the logic is about there

* warn when checkout may result in lost work

* fix test

* little fix to checkout for uninitialised repos

* fixes

* fix tests

* when fetching a sandbox, default the alias to the sandbox id

* relax validation on trigger.enabled

* version bumps

* changelog and comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CLI and App version hashes are not the same

1 participant