SERVER-105595: Make feature_compatibility_version.js a module (#38190)
GitOrigin-RevId: fee1faaeffc03edaffe4f9934929e764b85c12fd
This commit is contained in:
parent
acf83f060b
commit
cc5174f49e
@ -72,7 +72,7 @@ export default [
|
||||
// src/mongo/shell/explainable.d.ts
|
||||
Explainable: true,
|
||||
|
||||
// src/mongo/shell/feature_compatibility_version.d.ts
|
||||
// src/mongo/shell/feature_compatibility_version_global.js
|
||||
binVersionToFCV: true,
|
||||
checkFCV: true,
|
||||
isFCVEqual: true,
|
||||
@ -82,7 +82,6 @@ export default [
|
||||
numVersionsSinceLastLTS: true,
|
||||
removeFCVDocument: true,
|
||||
runFeatureFlagMultiversionTest: true,
|
||||
targetFCV: true,
|
||||
|
||||
// src/mongo/shell/query.d.ts
|
||||
DBQuery: true,
|
||||
|
||||
@ -318,6 +318,7 @@ MONGO_SERVER_CPP_JS_FILES = [
|
||||
"data_consistency_checker.js",
|
||||
"data_consistency_checker_global.js",
|
||||
"feature_compatibility_version.js",
|
||||
"feature_compatibility_version_global.js",
|
||||
"keyvault.js",
|
||||
"servers.js",
|
||||
"servers_misc.js",
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
// type declarations for feature_compatibility_version.js
|
||||
|
||||
declare function binVersionToFCV()
|
||||
declare function checkFCV()
|
||||
declare function isFCVEqual()
|
||||
declare function lastContinuousFCV()
|
||||
declare function lastLTSFCV()
|
||||
declare function latestFCV()
|
||||
declare function numVersionsSinceLastLTS()
|
||||
declare function removeFCVDocument()
|
||||
declare function runFeatureFlagMultiversionTest()
|
||||
declare function targetFCV()
|
||||
@ -175,3 +175,15 @@ function runFeatureFlagMultiversionTest(featureFlag, testFunc) {
|
||||
testFunc(lastContinuousFCV);
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
binVersionToFCV,
|
||||
checkFCV,
|
||||
isFCVEqual,
|
||||
lastContinuousFCV,
|
||||
lastLTSFCV,
|
||||
latestFCV,
|
||||
numVersionsSinceLastLTS,
|
||||
removeFCVDocument,
|
||||
runFeatureFlagMultiversionTest
|
||||
};
|
||||
|
||||
23
src/mongo/shell/feature_compatibility_version_global.js
Normal file
23
src/mongo/shell/feature_compatibility_version_global.js
Normal file
@ -0,0 +1,23 @@
|
||||
// Populate global variables from modules for backwards compatibility
|
||||
|
||||
import {
|
||||
binVersionToFCV,
|
||||
checkFCV,
|
||||
isFCVEqual,
|
||||
lastContinuousFCV,
|
||||
lastLTSFCV,
|
||||
latestFCV,
|
||||
numVersionsSinceLastLTS,
|
||||
removeFCVDocument,
|
||||
runFeatureFlagMultiversionTest
|
||||
} from "src/mongo/shell/feature_compatibility_version.js";
|
||||
|
||||
globalThis.binVersionToFCV = binVersionToFCV;
|
||||
globalThis.checkFCV = checkFCV;
|
||||
globalThis.isFCVEqual = isFCVEqual;
|
||||
globalThis.lastContinuousFCV = lastContinuousFCV;
|
||||
globalThis.lastLTSFCV = lastLTSFCV;
|
||||
globalThis.latestFCV = latestFCV;
|
||||
globalThis.numVersionsSinceLastLTS = numVersionsSinceLastLTS;
|
||||
globalThis.removeFCVDocument = removeFCVDocument;
|
||||
globalThis.runFeatureFlagMultiversionTest = runFeatureFlagMultiversionTest;
|
||||
@ -160,6 +160,7 @@ extern const JSFile bridge_global;
|
||||
extern const JSFile data_consistency_checker;
|
||||
extern const JSFile data_consistency_checker_global;
|
||||
extern const JSFile feature_compatibility_version;
|
||||
extern const JSFile feature_compatibility_version_global;
|
||||
extern const JSFile servers;
|
||||
extern const JSFile servers_misc;
|
||||
} // namespace JSFiles
|
||||
@ -1232,15 +1233,16 @@ void initScope(Scope& scope) {
|
||||
// modules
|
||||
scope.execSetup(JSFiles::bridge);
|
||||
scope.execSetup(JSFiles::data_consistency_checker);
|
||||
scope.execSetup(JSFiles::feature_compatibility_version);
|
||||
|
||||
// globals
|
||||
scope.execSetup(JSFiles::bridge_global);
|
||||
scope.execSetup(JSFiles::data_consistency_checker_global);
|
||||
scope.execSetup(JSFiles::feature_compatibility_version_global);
|
||||
|
||||
// scripts
|
||||
scope.execSetup(JSFiles::servers);
|
||||
scope.execSetup(JSFiles::servers_misc);
|
||||
scope.execSetup(JSFiles::feature_compatibility_version);
|
||||
|
||||
initializeEnterpriseScope(scope);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user