[26.1] Fix Workflow.copy() dropping readme, help, logo_url and doi#23117
Merged
mvdbeek merged 1 commit intoJul 15, 2026
Merged
Conversation
These columns were added to the workflow table in 25.0 (57cf7d3, e886353, migration 71eeb8d91f92), but Workflow.copy() was never updated, so every operation that copies a workflow silently destroyed them. Export skips these keys when they are None, so the metadata does not come back as null - it is absent from the exported .ga entirely. Reachable via the rename-only update in the workflows API (renaming a workflow destroys its readme) and via _import_shared_workflow. source_metadata is deliberately still not copied: it records where this exact content was fetched from, and is already dropped whenever a workflow is modified (see test_trs_import). copy() has now regressed this way three times (470baa5 added license and creator_metadata, bbbe7f2 added reports_config), so the new unit test drives its assertions off Workflow.__table__.columns: a column added by a later migration has to be classified there rather than silently dropped.
jmchilton
approved these changes
Jul 15, 2026
jmchilton
left a comment
Member
There was a problem hiding this comment.
Good comments and good tests - is this one also not Claude?
Member
Author
|
Plan was fable, implementer was opus with a minor manual steer (wanted to copy all model attributes and maintain a string list of attributes to exclude, which i think was a little brittle) |
|
This PR was merged without a "kind/" label, please correct. |
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.
readme,help,logo_urlanddoiwere added to theworkflowtable in 25.0 (57cf7d38d53,e886353b90a, migration71eeb8d91f92), butWorkflow.copy()was never updated to copy them. Every operation that copies a workflow silently destroys them.Export is guarded by
if workflow.readme is not None, so the metadata doesn't come back asnull— the key is absent from the exported.gaentirely, which is what makes this look like an export bug. It isn't: import, export, editor and API paths all handlereadmecorrectly.Affected paths
lib/galaxy/webapps/galaxy/api/workflows.py:466) —name_updated and not steps_updatedcopies the workflow into a new revision, so renaming a workflow destroys its readme._import_shared_workflow(lib/galaxy/webapps/base/controller.py:626) — reached via/workflow/imp?id=andPOST /api/workflows {shared_workflow_id}.Reported against an IWC workflow with a 7398-character readme on usegalaxy.eu (galaxyproject/iwc#1234). The uuid changing across the round-trip pins the cause to
copy()rather than to export, and the survival pattern is a fingerprint: everythingcopy()handles survived, only the fields it omits vanished.On
source_metadataStill deliberately not copied. It records where this exact content was fetched from and is already dropped whenever a workflow is modified (
test_trs_importasserts this, and the comment attest_workflows.py:1484calls it out as intentional). Copying it would also changeget_workflow_by_trs_id_and_version, which matches onlatest_workflow.source_metadata.Worth noting separately: because
source_metadataisn't copied, renaming a TRS-imported workflow still breaks its TRS dedup lookup. That's arguably its own bug, but it's a behavioral change I didn't fold into this fix.Tests
copy()has regressed this way three times now —470baa59216addedlicense+creator_metadata,bbbe7f2182caddedreports_config— because the assignments are hand-maintained. The new unit test therefore drives its assertions offWorkflow.__table__.columnsminus an explicitly annotatednot_copiedset, so a column added by a later migration trips"<column> is not covered by this test"and has to be classified rather than silently dropped.test_workflow_copy_preserves_metadata(unit) — verified to fail on an unmodified tree (AssertionError: help / assert None == 'Some help text') and pass with the fix. I also deleted thedoiassignment with the fix otherwise in place to confirm the guard catches exactly the recurrence mode.test_update_name(API) — extended; it already coveredlicensefor precisely this reason.test_import_published_preserves_metadata(API) — new, covers the shared-import path.The existing suite is not evidence here:
test_update_namepassed the whole time the bug was live, which is how this regressed.Bug dates to 25.0 — worth checking whether 25.0/26.0 are still supported and need this too.