Project

Profile

Help

Issue #3290

closed

Refactor PublishTagsStep to make clear where data comes from

Added by dkliban@redhat.com about 6 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
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.

Added by Mihai Ibanescu over 6 years ago

Revision c428b877 | View on GitHub

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.

Actions #1

Updated by dkliban@redhat.com about 6 years ago

  • Status changed from NEW to MODIFIED
  • Assignee set to mihai.ibanescu@gmail.com
Actions #2

Updated by pcreech about 6 years ago

  • Platform Release set to 2.15.1
Actions #3

Updated by pcreech about 6 years ago

  • Status changed from MODIFIED to 5
Actions #4

Updated by pcreech about 6 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #5

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF