Catalog visibility in Tutor deployed Open edX

The reason I was still posting in this topic is because the subject line is my topic, but it was never fully solved here. Because you suggested he create and post a patching plugin, but never confirmed if his example was right or not.

So for instance now I’ve tried:

name: set_default_enrollment
version: 0.1.0
patches:
 lms-env: |
  "COURSE_MODE_DEFAULTS": {
    "name": "Honor",
    "slug": "honor",
    "bulk_sku": null,
    "currency": "usd",
    "description": null,
    "expiration_datetime": null,
    "min_price": 0,
    "sku": null,
    "suggested_prices": ""
  }
patches:
 lms-env-features: |
  "ENABLE_COURSE_DISCOVERY": false,
  "ENABLE_COURSEWARE_SEARCH": false,
  "ENABLE_DASHBOARD_SEARCH": false

But the net result when I grep for it is:

/home/tutor/.local/share/tutor/env/apps/openedx/config/lms.env.json:    "ENABLE_COURSE_DISCOVERY": false,
/home/tutor/.local/share/tutor/env/apps/openedx/config/lms.env.json:    "ENABLE_COURSE_DISCOVERY": true,

So it seems like what he posted above wouldn’t necessarily work, since it seems to just inject the stuff at line 10 of tutor/lms.env.json at 6ca863e04c5943002f94a8bbc877494444242bf9 · overhangio/tutor · GitHub
But, then there will be duplicative values below it. (And my course discovery UI is still not hidden so I assume it’s using the true below the false.)

Also I got the same results (two hits in grep) when I tried a variant from some other thread (How to set ENABLE_COURSEWARE_SEARCH flag in configuration):

patches:
 openedx-common-settings: |
  FEATURES["ENABLE_COURSE_DISCOVERY"] = False,
  FEATURES["ENABLE_COURSEWARE_SEARCH"] = False,
  FEATURES["ENABLE_DASHBOARD_SEARCH"] = False

So what’s the correct way to override an existing variable instead of patching in variables which were not present in the first place? I would think it’s the “config” “set” mechanism, but there’s no example for how to use this in YAML and I can’t write a python plugin