Skip to content

Version hash utils#4758

Open
josephjclark wants to merge 5 commits into
mainfrom
version-hash-utils
Open

Version hash utils#4758
josephjclark wants to merge 5 commits into
mainfrom
version-hash-utils

Conversation

@josephjclark

Copy link
Copy Markdown
Collaborator

This PR adds a mix task to generate a version hash for a workflow given a UUID

Useful for debugging against CLI hashes.

AI Usage

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

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

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation Bot moved this to New Issues in Core May 15, 2026
@josephjclark

Copy link
Copy Markdown
Collaborator Author

@midigofrank a small PR here which I'd like to merge. Does this exist already or am I duplicating work here? Can you think of any improvements

@midigofrank

Copy link
Copy Markdown
Collaborator

@josephjclark this looks great. It just feels weird having it called generate_hash and still say hash: false. We should probably have another public function that generates the joined data, prehash

Replace the generate_hash/2 `hash: false` option with a dedicated
canonical_form/1 function that returns the pre-hash joined string.
A function named generate_hash that is asked not to hash read as
contradictory; the two concerns are now separate public functions.

Update the gen_workflow_hash task to route --no-hash through
canonical_form/1, and make its repo bootstrap tolerant of an
already-running repo so the task can be tested. Add task coverage.
@midigofrank midigofrank marked this pull request as ready for review June 30, 2026 06:00
@github-actions

Copy link
Copy Markdown

Security Review ✅

  • S0 (project scoping): N/A — diff is a pure refactor of WorkflowVersions.generate_hash/canonical_form plus a read-only Mix task (lib/mix/tasks/gen_workflow_hash.ex) that runs with direct DB access, not a web-layer entrypoint.
  • S1 (authorization): N/A — no new controllers, LiveView handlers, channels, or API actions; Mix tasks bypass Bodyguard policies by design.
  • S2 (audit trail): N/A — Mix task only reads a workflow and prints its hash; no Repo.insert/update/delete on config resources is introduced.

@midigofrank

Copy link
Copy Markdown
Collaborator

@josephjclark I've added a new function which generates the prehash string. Feel free to merge this in when you're ready

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