Requirement of refactoring

Bug #1308932 reported by vishal yadav
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Invalid
Undecided
vishal yadav

Bug Description

While reviewing https://review.openstack.org/#/c/83345/ and https://review.openstack.org/#/c/83666/ requirement for below re-factoring was observed.

* Avoid duplicate code especially at implementation level(using readily available methods-helper, wrapper, decorator, metaclasses etc.)
* Convert Magic literals to constants or Enums and move under some namespace(Class-Level).
* More justified and elaborative error messages in assertions.
* Move module level global variables under class level namespace or use module level public methods to access or update global variables.
* Define the criteria for level or depth by which data structures (for example dictionary) can be nested. Beyond which the nesting could break the readability and maintainability of data structure.
* Scenarios under which such deep level nesting cannot be avoided, appropriate interface should be provided for access and manipulation of values of individual components of data structure. Access and manipulation of values of individual components using nested sequence of indices/keys should be avoided whereever possible.

I think we should plan such re-factoring in future (juno release?). Such pattern is also observed in other projects as well. I will cite the instance and change affected projects later.

Changed in tempest:
assignee: nobody → vishal yadav (vishalcdac07)
Revision history for this message
vishal yadav (vishalcdac07) wrote :

Since the re-factoring requires significant changes can anyone suggest if it can be moved to BP and can be targeted for Juno release.

description: updated
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

I think Schema code is fine as discussed on mentioned patch. Other mentioned refactoring is too generic.

https://review.openstack.org/#/c/83345/ is still open, please feel free to provide review comment if that can be done there.

If refactoring is required in other place It will be better if that can be posted as patch (can report bug also with specific area where improvement needed).

Marking this as incomplete as mentioned refactoring is too generic and exact problem code set is not mentioned.

Changed in tempest:
status: New → Incomplete
Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

As Ghanshyam said, this bug describes very common things. As an alternative you could file another bug with more specific description what we should change and provide a patch for it (or patches). In particular this issue is "Invalid" rather than "Incomplete".

Changed in tempest:
status: Incomplete → Invalid
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.