.arcconfig is defaulting to Jupyter notebooks view

Noticed the issue when we had a patch submitted with change to .arcconfig in it. This resulted in the following error message printed in the diffusion’s view:

This document is missing an “nbformat” field. Jupyter notebooks must have this field.

While this is indeed a JSON document, the fact that there is no nbformat should mean it is not a Jupyter notebook document, so the Default view shouldn’t try to render it as one (should just use JSON view or plain text).

If the user manually tries to show it as a Jupyter document then it’s likely fine to show such error to inform that this is not a valid Jupyter document.

Also while this issue was initially discovered with .arcconfig file, think any JSON file should not be treated as Jupyter by default if they don’t have “nbformat” (or any other signature used to verify validness of the document when showing it).

Reproduction Instructions

I’ve simply made a commit to a local Blender’s branch with the following change:

diff --git a/.arcconfig b/.arcconfig
index 4a126cd6d01..76c3e325ad5 100644
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,7 +1,8 @@
 {
        "project_id" : "Blender",
-       "conduit_uri" : "https://developer.blender.org/",
+       "conduit_uri" : "https://phabricator.local/",
        "git.default-relative-commit" : "origin/master",
        "arc.land.update.default" : "rebase",
-       "arc.land.onto.default" : "master"
+       "arc.land.onto.default" : "master",
+       "history.immutable": true
 }

Then I did arc diff HEAD^ and opened the URL of the differential revision in my browser.

Phabricator/Arcanist Version
phabricator 76d9912932bc3d25230a4f8a014c5d46db38633d (Mon, Sep 30)
arcanist 3cdfe1fff806d2b54a2df631cf90193e518f42b7 (Thu, Sep 5)
phutil 39ed96cd818aae761ec92613a9ba0800824d0ab0 (Mon, Sep 30)

Thanks! This is at the top of my list to deal with once I have a chance, I’m just tied up in meetings until later today at the earliest.

This should now be fixed in master and stable by https://secure.phabricator.com/D20850.