Skip to content

[25.1] Fix dataset collection tag duplication when copying a history#21984

Merged
jmchilton merged 3 commits intogalaxyproject:release_25.1from
mvdbeek:fix-redundant-tag-copy
Mar 11, 2026
Merged

[25.1] Fix dataset collection tag duplication when copying a history#21984
jmchilton merged 3 commits intogalaxyproject:release_25.1from
mvdbeek:fix-redundant-tag-copy

Conversation

@mvdbeek
Copy link
Copy Markdown
Member

@mvdbeek mvdbeek commented Mar 4, 2026

HistoryDatasetCollectionAssociation.copy() was internally calling copy_tags_from(), but both callers (History.copy() and DatasetCollectionManager.copy()) also called copy_tags_from() on the returned HDCA, resulting in every tag being duplicated.

Move the tag-copying responsibility entirely into HDCA.copy() via a new target_user parameter (falling back to source history user), and remove the redundant copy_tags_from() calls from both callers. This is safer than the reverse approach since any future caller of HDCA.copy() will get correct tag copying automatically.

Fixes #21872

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-project-automation github-project-automation Bot moved this to Needs Review in Galaxy Dev - weeklies Mar 4, 2026
@github-actions github-actions Bot added area/testing area/database Galaxy's database or data access layer area/testing/api labels Mar 4, 2026
@github-actions github-actions Bot added this to the 26.1 milestone Mar 4, 2026
Copy link
Copy Markdown
Member

@jmchilton jmchilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a make format.

HistoryDatasetCollectionAssociation.copy() was internally calling
copy_tags_from(), but both callers (History.copy() and
DatasetCollectionManager.copy()) also called copy_tags_from() on the
returned HDCA, resulting in every tag being duplicated.

Move the tag-copying responsibility entirely into HDCA.copy() via a new
target_user parameter (falling back to source history user), and remove
the redundant copy_tags_from() calls from both callers. This is safer
than the reverse approach since any future caller of HDCA.copy() will
get correct tag copying automatically.

Fixes galaxyproject#21872
@mvdbeek mvdbeek force-pushed the fix-redundant-tag-copy branch from db43119 to 8f4577e Compare March 10, 2026 13:24
mvdbeek added 2 commits March 10, 2026 19:27
`__datasets_for_update` can return an empty list when the given ID
doesn't match an HDA in the history, causing an unhandled IndexError.
The test was using the legacy untyped endpoint which defaults to
dataset type, causing a 500 error when updating a collection's tags.
@jmchilton jmchilton merged commit 50b8a14 into galaxyproject:release_25.1 Mar 11, 2026
47 of 54 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Galaxy Dev - weeklies Mar 11, 2026
@github-actions
Copy link
Copy Markdown

This PR was merged without a "kind/" label, please correct.

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

Labels

Projects

Development

Successfully merging this pull request may close these issues.

3 participants