@resolveio/server-lib 22.3.85 → 22.3.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -170,6 +170,7 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
170
170
|
'source "$TOOLS_DIR/env.sh"',
|
|
171
171
|
'PROJECT_ROOT="${1:-$(pwd)}"',
|
|
172
172
|
'PROJECT_ROOT="$(cd "$PROJECT_ROOT" && pwd)"',
|
|
173
|
+
'export RESOLVEIO_QA_PROJECT_ROOT="$PROJECT_ROOT"',
|
|
173
174
|
'ARTIFACT_DIR="$PROJECT_ROOT/qa-artifacts"',
|
|
174
175
|
'mkdir -p "$ARTIFACT_DIR"',
|
|
175
176
|
'CLIENT_URL="${RESOLVEIO_RUNNER_QA_CLIENT_URL:-${RESOLVEIO_SUPPORT_QA_CLIENT_URL:-http://localhost:${RESOLVEIO_RUNNER_QA_CLIENT_PORT:-${RESOLVEIO_SUPPORT_QA_CLIENT_PORT:-4200}}}}"',
|
|
@@ -254,7 +255,7 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
254
255
|
'kill_local_mongo_processes() {',
|
|
255
256
|
' local mongo_port="$MONGO_PORT"',
|
|
256
257
|
' [ -n "$mongo_port" ] || return 0',
|
|
257
|
-
' for pid in $(ps -eo pid=,args= | awk -v port="$mongo_port" \'$0 !~ /awk -v port=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /mongod/ && $0 ~ ("--port " port) && ($0 ~ /\\/tmp\\/resolveio-support-qa\\/.*mongod/ || $0 ~ /--dbpath mongo\\/data\\/db/) {print $1}\' 2>/dev/null || true); do',
|
|
258
|
+
' for pid in $(ps -eo pid=,args= | awk -v port="$mongo_port" \'$0 !~ /awk -v port=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /mongod/ && $0 ~ ("--port " port) && ($0 ~ /\\/tmp\\/resolveio-support-qa\\/.*mongod/ || $0 ~ /--dbpath .*mongo\\/data\\/db/) {print $1}\' 2>/dev/null || true); do',
|
|
258
259
|
' skip_cleanup_pid "$pid" && continue',
|
|
259
260
|
' [ "$pid" = "$$" ] && continue',
|
|
260
261
|
' kill_tree "$pid"',
|
|
@@ -527,6 +528,7 @@ function buildResolveIORunnerLocalQaStopperScript() {
|
|
|
527
528
|
'source "$TOOLS_DIR/env.sh"',
|
|
528
529
|
'PROJECT_ROOT="${1:-$(pwd)}"',
|
|
529
530
|
'PROJECT_ROOT="$(cd "$PROJECT_ROOT" && pwd)"',
|
|
531
|
+
'export RESOLVEIO_QA_PROJECT_ROOT="$PROJECT_ROOT"',
|
|
530
532
|
'ARTIFACT_DIR="$PROJECT_ROOT/qa-artifacts"',
|
|
531
533
|
'CLIENT_PORT="${RESOLVEIO_RUNNER_QA_CLIENT_PORT:-${RESOLVEIO_SUPPORT_QA_CLIENT_PORT:-4200}}"',
|
|
532
534
|
'SERVER_PORT="${RESOLVEIO_RUNNER_QA_SERVER_PORT:-${RESOLVEIO_SUPPORT_QA_SERVER_PORT:-8080}}"',
|
|
@@ -601,7 +603,7 @@ function buildResolveIORunnerLocalQaStopperScript() {
|
|
|
601
603
|
'kill_local_mongo_processes() {',
|
|
602
604
|
' local mongo_port="$MONGO_PORT"',
|
|
603
605
|
' [ -n "$mongo_port" ] || return 0',
|
|
604
|
-
' for pid in $(ps -eo pid=,args= | awk -v port="$mongo_port" \'$0 !~ /awk -v port=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /mongod/ && $0 ~ ("--port " port) && ($0 ~ /\\/tmp\\/resolveio-support-qa\\/.*mongod/ || $0 ~ /--dbpath mongo\\/data\\/db/) {print $1}\' 2>/dev/null || true); do',
|
|
606
|
+
' for pid in $(ps -eo pid=,args= | awk -v port="$mongo_port" \'$0 !~ /awk -v port=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /mongod/ && $0 ~ ("--port " port) && ($0 ~ /\\/tmp\\/resolveio-support-qa\\/.*mongod/ || $0 ~ /--dbpath .*mongo\\/data\\/db/) {print $1}\' 2>/dev/null || true); do',
|
|
605
607
|
' skip_cleanup_pid "$pid" && continue',
|
|
606
608
|
' [ "$pid" = "$$" ] && continue',
|
|
607
609
|
' kill_tree "$pid"',
|
|
@@ -725,6 +727,16 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
725
727
|
' try { return JSON.parse(fs.readFileSync(filePath, "utf8")); } catch (error) { return null; }',
|
|
726
728
|
'}',
|
|
727
729
|
'',
|
|
730
|
+
'function preserveExistingSeedResult(reason) {',
|
|
731
|
+
' const existing = readJsonIfExists(resultPath);',
|
|
732
|
+
' const status = String(existing && existing.status || "").toLowerCase();',
|
|
733
|
+
' if (["pass", "needs-data"].includes(status)) {',
|
|
734
|
+
' const preserved = { ...existing, reused_existing: true, reuse_reason: reason, checked_at: new Date().toISOString() };',
|
|
735
|
+
' console.log(JSON.stringify(preserved, null, 2));',
|
|
736
|
+
' process.exit(0);',
|
|
737
|
+
' }',
|
|
738
|
+
'}',
|
|
739
|
+
'',
|
|
728
740
|
'function resolveRuntimeSource() {',
|
|
729
741
|
' const envUri = process.env.RESOLVEIO_QA_LIVE_MONGO_URL || process.env.RESOLVEIO_SUPPORT_QA_LIVE_MONGO_URL || process.env.RESOLVEIO_RUNNER_QA_LIVE_MONGO_URL || "";',
|
|
730
742
|
' const envDb = process.env.RESOLVEIO_QA_LIVE_MONGO_DB || process.env.RESOLVEIO_SUPPORT_QA_LIVE_MONGO_DB || process.env.RESOLVEIO_RUNNER_QA_LIVE_MONGO_DB || "";',
|
|
@@ -1004,7 +1016,10 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1004
1016
|
' const { MongoClient } = requireMongo();',
|
|
1005
1017
|
' const source = resolveRuntimeSource();',
|
|
1006
1018
|
' const targetUri = process.env.RESOLVEIO_SUPPORT_QA_MONGO_URL || process.env.RESOLVEIO_RUNNER_QA_MONGO_URL || process.env.MONGO_URL || "mongodb://127.0.0.1:3001/resolveio?directConnection=true";',
|
|
1007
|
-
' if (!source.uri)
|
|
1019
|
+
' if (!source.uri) {',
|
|
1020
|
+
' preserveExistingSeedResult("missing_live_mongo_uri");',
|
|
1021
|
+
' writeResult({ status: isLiveDataRequired() ? "failed" : "skipped", reason: "missing_live_mongo_uri", required: isLiveDataRequired(), result_path: resultPath }, isLiveDataRequired() ? 5 : 0);',
|
|
1022
|
+
' }',
|
|
1008
1023
|
' if (!isLocalMongoUri(targetUri)) writeResult({ status: "failed", reason: "target_mongo_must_be_localhost", target_uri_redacted: redactUri(targetUri), result_path: resultPath }, 3);',
|
|
1009
1024
|
' if (String(source.uri) === String(targetUri)) writeResult({ status: "failed", reason: "source_and_target_mongo_match", result_path: resultPath }, 3);',
|
|
1010
1025
|
' const sourceClient = new MongoClient(source.uri, { readPreference: "secondaryPreferred", serverSelectionTimeoutMS: 15000 });',
|