Project

Profile

Help

Issue #3290

Refactor PublishTagsStep to make clear where data comes from

Added by dkliban@redhat.com almost 4 years ago. Updated over 2 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.

Associated revisions

Revision c428b877 View on GitHub
Added by Mihai Ibanescu about 4 years ago

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.

History

#1 Updated by dkliban@redhat.com almost 4 years ago

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

#2 Updated by pcreech almost 4 years ago

  • Platform Release set to 2.15.1

#3 Updated by pcreech almost 4 years ago

  • Status changed from MODIFIED to 5

#4 Updated by pcreech almost 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#5 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF