Organize Shell JS files into those that are shell-only, mongod only, or both

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Correctness
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Though many .js files and functionality live in src/mongo/shell, it is misleading to think that these are only imported into the [legacy test] shell; some them live in mongod as well.

      Moving the .js files that are actually shared by mongo and mongod should probably reside with src/mongo/scripting, if not next to the .cpp file that they are directly extending. There could be another pass based on actual functionality and implementation (there are some files that extend a handful of objects, but those may be distributed as well).

       

      From my understanding (and to confirm)...

      JS files included in scripting/implscope.cpp go into both mongo and mongod:

      • assert.js
      • assert_global.js
      • types.js

      This is also true of scripting/engine.cpp:

      • bulk_api.js
      • bulk_api_global.js
      • check_log.js
      • check_log_global.js
      • collection.js
      • crud_api.js
      • db.js
      • db_global.js
      • error_codes.js
      • explain_query.js
      • explain_query_global.js
      • explainable.js
      • explainable_global.js
      • mongo.js
      • prelude.js
      • query.js
      • session.js
      • session_global.js
      • query_global.js
      • utils.js
      • utils_global.js
      • utils_sh.js
      • utils_sh_global.js
      • utils_auth.js
      • utils_auth_global.js

      js_global_scope.js serves as the de facto source of truth, and shows what is exposed to the server-side JS.

      Those files in src/mongo/shell/shell_utils.cpp and src/mongo/shell/kms_shell.cpp (just the one) are confined to just the shell:

      • bridge.js
      • bridge_global.js
      • data_consistency_checker.js
      • data_consistency_checker_global.js
      • feature_compatibility_version.js
      • feature_compatibility_version_global.js
      • servers.js
      • servers_global.js
      • servers_misc.js
      • servers_misc_global.js
      • keyvault.js

            Assignee:
            Steve McClure
            Reporter:
            Steve McClure
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: