[Nailgun] Rename "role" into "node_role"

Bug #1473077 reported by Ihor Kalnytskyi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Opinion
Low
Fuel Python (Deprecated)

Bug Description

Since 7.0 we'll have:

  * node roles
  * network roles

By legacy, everywhere in the code we assume by "role" the "node role" entity.

Perhaps in order to avoid confusion with network role we should rename it to "node role".

Pros:

  * Avoid confusion, let's keep code clear

Cons:

  * We can't rename all the stuff, or we'll need to introduce new hacks in order to be compatible with old serializers

I'd like to hear there more opinion.

Changed in fuel:
status: New → Opinion
Revision history for this message
deactivateduser (deactivateduser-deactivatedaccount) wrote :

The idea is to have clear-cut distinction in term role. Each time you look at a role, you have to figure out which entity it refers to. I vote for the principle of least astonishment in the code and make the distinction in naming.

@Igor, you're talking about introducing new hacks. Could you please list them?

Revision history for this message
Sebastian Kalinowski (prmtl) wrote :

I assume that we want to rename "role" to "node_role" everywhere (plugins, API calls, internal data, etc.).
In such case IMHO having "role" is not so bad. Everyone got used to it and what it means (not only fuel devs, but also third-party devs that creates plugins). And such rename will not only cause hacks in Fuel but also will force people to create separate release of the plugin just because we changed one name in plugins metadata (or we will need to introduce even more hacks).

Revision history for this message
Evgeniy L (rustyrobot) wrote :

I'm not sure where do you want to rename these entities? Is it the field in the model? I don't think that it's reasonable, when you perform Node.role or something like that, it's clear what roles there are.

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

The original idea was to rename it everywhere in the code, so there's will be no confusion which role we're talking about.

@Ivan, for instance you need:

* parse roles_metadata as input of release, even if it'll be called node_roles_metadata (because of api backward compatibility)
* you need node_roles_metadata serialized as roles_metadata too (again, because of backward compatibility)
* we need to do the same for our deployment serializers too

Yeah, we can do it as intermediate step and support it for few releases... and the drop it. but it seems not critical to me.. at all.

Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

Move it to 8.0 because of SCF.

tags: added: tech-debt
Changed in fuel:
milestone: 7.0 → 8.0
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.