Fix UI form parsing that created invalid FuzzerJob entries#5381
Conversation
896ff4a to
a3d4d16
Compare
a3d4d16 to
562f99c
Compare
The /jobs form submission retrieved 'fuzzers' as a string and blindly called .split(','), meaning an empty field evaluated as [''] instead of []. This string parsed as a valid mapping attempt for a fuzzer named "", leading to the creation of orphaned FuzzerJob entries in Datastore.
This updates the form ingestion to correctly coerce missing values to an empty list.
A follow up commit will sweep Datastore to remove any existing ghost mappings.
TAG=agy
CONV=b5fdacea-8cda-4418-8906-dee99c91f929
562f99c to
a048d85
Compare
|
Making sure I understand the high level stuff: at some point we had a valid This PR is addressing the issue, so when we uncheck all the boxes, we correctly pass an empty In http://b/538130903#comment17 you mentioned that the UI doesn't let you an invalid entity. That was the invalid Fuzzer with the empty name, right? |
Yes, that's correct!
Yeah, the invalid Fuzzer is showing up in the https://clusterfuzz.com/fuzzers page but I couldn't disable the jobs from that UI. I opened crbug.com/538684224 to fix that Fuzzer |
The
/jobsform submission retrieved'fuzzers'as a string and blindly called .split(','), meaning an empty field evaluated as['']instead of[].I tested in dev and the browser is actually sending a POST with the
fuzzerkey, i.e....&fuzzers=&description=...which results in an empty stringfuzzers= ""in Flask . Since there is a value"", this overrides the default[]This fuzzers value of
['']leads to the creation of invalidFuzzerJobentries in Datastore withfuzzer=""This updates the form ingestion to correctly ignore missing values as an empty list.
Testing
I verified this with the unit test by reverting the PR back to the old behavior:
The last parameter in the assert is the fuzzers
['']. We're passing an empty string into the list of fuzzers to map to the jobdev:
libfuzzerFuzzeron thelibfuzzer_chrome_asan_highendjob in dev.Fuzzerby uncheckinglibfuzzer, then querying the Datastore to verify no danglingFuzzerJobwas created withfuzzer=''SELECT * FROMFuzzerJobwhere job = 'libfuzzer_chrome_asan_highend'