Page MenuHomePhabricator

Investigate default JSON minification behavior in production
Closed, ResolvedPublic

Description

ORES is minifying all JSON responses in production. It should have pretty JSON by default.

Event Timeline

I've confirmed that:

  1. I can't reproduce the behavior with HEAD of wiki-ai/ores by running a simple dev server (via ./utility applications.wsgi)
  2. The current HEAD of wiki-ai/ores is the version of the submodule deployed in production and beta feature

So, still no sense has been made. :/

OK. So here's my hypothesis. We're only setting the Flask config for prettyprint to False. There's no circumstances under which we set it back to True. So I've made a PR that allows the config to be set back to True for any relevant request. See https://github.com/wiki-ai/ores/pull/185 I'd like to get this merged and deployed to beta for testing there.

It works! Ready for a deploy in Prod

http://ores-beta.wmflabs.org/v2/scores/enwiki/

{
  "scores": {
    "enwiki": {
      "damaging": {
        "version": "0.3.0"
      },
      "draftquality": {
        "version": "0.0.1"
      },
      "goodfaith": {
        "version": "0.3.0"
      },
      "reverted": {
        "version": "0.3.0"
      },
      "wp10": {
        "version": "0.5.0"
      }
    }
  }
}

http://ores-beta.wmflabs.org/v2/scores/enwiki/?format=json

{"scores": {"enwiki": {"damaging": {"version": "0.3.0"}, "draftquality": {"version": "0.0.1"}, "goodfaith": {"version": "0.3.0"}, "reverted": {"version": "0.3.0"}, "wp10": {"version": "0.5.0"}}}}