Refactor prod validators to be split into individual validators
See original GitHub issueRefactor prod_validators.py such that there is one validator module per model module in core/storage/
.
List of model categories
TODO
In progress
- subtopic [John Jia]
Done
- activity @ankita240796 (#10416)
- audit @kate-perkins (#10995)
- base_model @ankita240796 (#10360)
- classifier @rlhouser (#11116)
- collection @KhushiGangopadhyay (#11152)
- config @iramin (#11148)
- email @krishita30j (#11077)
- feedback @archi15 (#11340)
- exploration @hardikkat24 (https://github.com/oppia/oppia/pull/11926)
- improvements @MeetVys (#10952)
- job @nskirkey (#11373)
- opportunity @savithakj (#10735)
- question @mozammel (#11222)
- recommendations @sunny1401 (#10855)
- skill @sajalasati (#10907)
- statistics @arora-ria (#10960)
- story @purvimisal (#10973)
- suggestion @jcqli (#11345)
- topic @vextor22 (#10967)
- user @jian-en (#11117)
Steps to refactor
- Extract all the validators related to a given model type for example
activity
into a new file named as<model-type>_validators.py
for exampleactivity_validators.py
fromprod_validators.py
. Make sure you name the validators file exactly as<folder-name-in-above-list>_validators.py
- Extract all the test related to the model type from
prod_validators_test.py
to<model-type>_validators_test.py
. - Clean up the unused imports from the new validators file and existing prod validators file.
- Clean up the unused variables from the new validators file and existing prod validators file.
- Fix the file overview to have the correct explanation and copyright year.
Example PR: https://github.com/oppia/oppia/pull/10416 #10360
Note: For a guide on how to access Oppia’s webpages, see this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:74 (55 by maintainers)
Top Results From Across the Web
Improving your validation code — a refactoring exercise
Today we're going to talk about validation. Most people have some concept where they validate an entity object before it is saved to...
Read more >How to implement validation in a separate file using ...
I am trying to use express-validator to validate the req.body before sending a post request to insert data to postgres. I have a...
Read more >Split up UpdateValidator per each state-transitions, & Tendermint ...
Split off from #2312 (comment) into a separate issue. Once we move all validator state changes from UpdateValidator, called on many different transactions, ......
Read more >Replacing Throwing Exceptions with Notification in ...
Splitting the original method allows me to separate the validation check from the decision about how to respond to failure.
Read more >Advanced Topic - Refactoring
As with user stories, splitting refactors is important, as it helps sustain better development flow. Table 1 provides some useful methods for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @archi15 & @jcqli , I’ve assigned you to the
feedback
&suggestion
part of this issue. You can start working on it. Do let us know if you have any questions. Thanks! 😃@Koushikk-24 Could you please first complete your work on subtopic?