-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form fields removal and form merges #683
Conversation
Codecov Report
@@ Coverage Diff @@
## master #683 +/- ##
==========================================
- Coverage 64.62% 64.58% -0.05%
==========================================
Files 109 110 +1
Lines 6159 6152 -7
Branches 820 820
==========================================
- Hits 3980 3973 -7
- Misses 1920 1922 +2
+ Partials 259 257 -2
Continue to review full report at Codecov.
|
Pull Request Test Coverage Report for Build 2224
💛 - Coveralls |
3 similar comments
Pull Request Test Coverage Report for Build 2224
💛 - Coveralls |
Pull Request Test Coverage Report for Build 2224
💛 - Coveralls |
Pull Request Test Coverage Report for Build 2224
💛 - Coveralls |
Pull Request Test Coverage Report for Build 2273
💛 - Coveralls |
Which classes/fields are different ? |
tcms/xmlrpc/api/testplan.py
Outdated
@@ -7,7 +7,7 @@ | |||
from tcms.testplans.models import TestPlan | |||
from tcms.testcases.models import TestCase, TestCasePlan | |||
|
|||
from tcms.xmlrpc.forms import EditPlanForm, NewPlanForm | |||
from tcms.xmlrpc.forms import RPCEditPlanForm, RPCNewPlanForm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be something like tcms.xmlrpc.api.forms.testplan import EditPlanForm, NewPlanForm
.
If you re-organize where the classes are defined and make the modules smaller, then you can keep the existing class names (resulting in smaller diff below) because now you know where the form classes are coming from. If the RPC app is self contained (but dependent on other base classes) then we don't really need to overload all class names with meaning, like it is now, and later have to change the names because the meaning has changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done that reorganization. IMO the next steps here should be to do the same for TestCase RPC forms - the mess there is almost the same as the one we are fixing now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw for this I had to squash the two commits:
- Delete XMLRPCEditPlanForm and XMLRPCNewPlanForm
- Introduce RPCPlanForm as base form
because otherwise we had the problem with duplicate names and imports you have exposed above.
3520eb3
to
ef2db63
Compare
As for your first question - different fields in RPC and regular forms, here they are: regular: there are other fields in regular form which are not required and they are not predefined in the RPC form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tcms/xmlrpc/api/forms/testplan/__init__.py
- you don't need this so there's no point in that file appearing in one commit (and later be removed in another). Squash the changes so this file never appears in the history.
These follow the definition of the TestPlan model and are fine.
when creating a new TP via the API all of these fields, including The only place where form fields may not be required is the TestPlan.update API which allows the user to update only selected fields! |
The form that I got those fields from was: As for NewPlanForm (regular) and NewPlanForm (RPC) - there are only two differences:
|
dd9c6f0
to
4fc0b1b
Compare
This is ready for review |
It is merged with NewPlanForm
They are only used as parent forms Introduce RPCPlanForm as base form
They are not used anywhere
Move RPC TestPlan forms to xmlrpc/api/forms/testplan.py
As discussed in #677
DONE
DONE - The forms were removed and their field were put into their respective anchestors
DONE
There are predefined fields, but there is a reason for that - in the RPC* forms all of the fields are not required, while in the regular forms all of them are. It looks like we can't remove any more code for these respecitve forms. Also all of the fields in RPC forms are used in their respective controllers, again, nothing we can delete
#681
#682