Actions
Issue #3290
closedRefactor PublishTagsStep to make clear where data comes from
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Docker:
Platform Release:
2.15.1
Target Release - Docker:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
In python, I find that passing a data structure to a function/class makes me
think the function/class has a local copy of it.
In the case of redirect_data, the parent step should "own" the data structure,
and child steps should "reach" into the parent to fetch it, instead of using
a locally stored reference. Then it's more obvious that it's a "borrowed"
data structure and its change should be visible to sibling steps.
Actions
Do not pass a data structure to a function and mutate it.
In python, I find that passing a data structure to a function/class makes me think the function/class has a local copy of it.
In the case of redirect_data, the parent step should "own" the data structure, and child steps should "reach" into the parent to fetch it, instead of using a locally stored reference. Then it's more obvious that it's a "borrowed" data structure and its change should be visible to sibling steps.