compiler-explorer / infra

Infrastructure to set up the public Compiler Explorer instances and compilers

Home Page:https://godbolt.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging issue concerning duplicate fields

partouf opened this issue · comments

There's a record somewhere in the compile_stats logging that includes a duplicate 'skipasm' key.

HIVE_CURSOR_ERROR: Row is not a valid JSON Object - JSONException: Duplicate key "skipasm"

It's confusing as there's no actual field called skipasm, but I know it's part of the backendOptions. Perhaps someone manually put it in the Filters field and then had 2 differently cased skipasm entries?

Might be best to iterate over filters and lowercase here https://github.com/compiler-explorer/compiler-explorer/blob/f59bad3a7eb145245ce530a83fbba65e6a475821/lib/stats.ts#L86

Not sure how Object.fromEntries handles that. The situations not documented here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

Seems it handles it fine (and indeed differently cased keys are included)
https://jsfiddle.net/fkjd7s5e/

Tested solution, seems to work https://jsfiddle.net/fkjd7s5e/1/

Cute solution