Project

Profile

Help

Refactor #5457

closed

Story #5443: [Epic] Remove leading _ from pulpcore model fields

Prepend 'pulp' to fields on Model

Added by dkliban@redhat.com over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 61
Quarter:

Description

pulpcore.app.models.Model has three fields[0] that all start with an _. All these fields need to drop the _ prefix from their names.

_id will become pulp_id
_created will become pulp_created
_last_updated will become pulp_last_updated

The URL field name, _href, is defined in the settings.py[0].

_href will become pulp_href

[0] https://github.com/pulp/pulpcore/blob/3c62889e0c01fe54de66c60147192a03cac73ab2/pulpcore/app/models/base.py#L21-L23
[1] https://github.com/pulp/pulpcore/blob/3c62889e0c01fe54de66c60147192a03cac73ab2/pulpcore/app/settings.py#L117

Actions #1

Updated by dkliban@redhat.com over 4 years ago

  • Tracker changed from Issue to Refactor
  • % Done set to 0
Actions #2

Updated by dkliban@redhat.com over 4 years ago

  • Description updated (diff)
Actions #3

Updated by dalley over 4 years ago

If we remove the leading _ from _id then we're back to the place we were originally -- we need to find a new name for the pk field, or else, plugins will need to avoid "id", which is a pretty common name for a field.

Either would work, but we should decide on a strategy going forwards.

e.g. UpdateRecord https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/models.py#L386

The same applies to _href -> href, if we decide to do that.

https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/models.py#L666

I have no example of "last_updated" but I feel like it would be a likely future conflict.

Personally, I propose using a "pulp_" prefix.

Actions #4

Updated by dkliban@redhat.com over 4 years ago

Adding a 'pulp' or 'pulpcore' to the field names would eliminate the chance of conflict between fields provided by pulpcore and the plugin.

pulp_id
pulp_href
pulp_created
pulp_last_updated

The names are very descriptive. They eliminate ambiguity for the REST API users.

Actions #5

Updated by bmbouter over 4 years ago

wrote:

Adding a 'pulp' or 'pulpcore' to the field names would eliminate the chance of conflict between fields provided by pulpcore and the plugin.

pulp_id
pulp_href
pulp_created
pulp_last_updated

The names are very descriptive. They eliminate ambiguity for the REST API users.

+1, these names are descriptive and they avoid the conflicts so I think that is the goal.

Actions #6

Updated by dkliban@redhat.com over 4 years ago

  • Subject changed from Remove leading _ from fields on Model to Prepend 'pulp' to fields on Model
  • Description updated (diff)
Actions #8

Updated by daviddavis over 4 years ago

+0. Not a big fan of this change but I see no other path forward.

Actions #9

Updated by ttereshc over 4 years ago

+0.75 for prepending everything with pulp_. I agree with @daviddavis.

Actions #10

Updated by fao89 over 4 years ago

  • Sprint set to Sprint 60
Actions #11

Updated by fao89 over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #12

Updated by dalley over 4 years ago

Should we also change the names of "_versions_href" and "_latest_version_href" on RepositoryVersion? We would not need a "pulp_" prefix, but we would potentially want to drop the "_" prefix. I do not know whether that is an issue for the bindings the same way that the others were (as I don't think we filter on those fields at all), but since we're getting rid of that pattern everywhere else, it might no longer fit ergonomically speaking. And, it is not particularly necessary as nobody subclasses RepositoryVersion.

Actions #13

Updated by dkliban@redhat.com over 4 years ago

Let's open a separate ticket to remove _ from "_versions_href" and "_latest_version_href".

Added by Fabricio Aguiar over 4 years ago

Revision 69df3448 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulp_file/pull/284 Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220

Actions #15

Updated by fao89 over 4 years ago

  • Status changed from ASSIGNED to POST

Added by Fabricio Aguiar over 4 years ago

Revision 247c4bed | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulpcore/pull/317 Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220

Added by Fabricio Aguiar over 4 years ago

Revision fce769c3 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulpcore/pull/317 Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220

Added by Fabricio Aguiar over 4 years ago

Revision 96bb65e9 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

closes #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulp_file/pull/284 Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220 Required PR: https://github.com/pulp/pulp-certguard/pull/31

Actions #16

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

Added by Fabricio Aguiar over 4 years ago

Revision 83608d21 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/pulp/pulpcore/pull/317 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220

Added by Fabricio Aguiar over 4 years ago

Revision 99ad773e | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Required PR: https://github.com/pulp/pulp_file/pull/284 Required PR: https://github.com/pulp/pulpcore-plugin/pull/137 Required PR: https://github.com/PulpQE/pulp-smash/pull/1220 Required PR: https://github.com/pulp/pulpcore/pull/317

Actions #17

Updated by daviddavis over 4 years ago

  • Status changed from MODIFIED to POST

Added by Fabricio Aguiar over 4 years ago

Revision 45761f7f | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 70e69cc6 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 945b464e | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 945b464e | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 945b464e | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 945b464e | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision 052aa4c2 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision b1d689f0 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision b1d689f0 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Added by Fabricio Aguiar over 4 years ago

Revision b1d689f0 | View on GitHub

Renaming base fields

_id to pulp_id _created to pulp_created _last_updated to pulp_last_updated _href to pulp_href

ref #5457 https://pulp.plan.io/issues/5457

Actions #18

Updated by daviddavis over 4 years ago

  • Status changed from POST to MODIFIED
Actions #19

Updated by dalley over 4 years ago

  • Status changed from MODIFIED to POST
Actions #20

Updated by rchan over 4 years ago

  • Sprint changed from Sprint 60 to Sprint 61
Actions #21

Updated by fao89 over 4 years ago

  • Status changed from POST to MODIFIED
Actions #22

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #23

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF