From 62b5400349c46dec71828ef7d251db500d9f61db Mon Sep 17 00:00:00 2001 From: Alvinosh Date: Thu, 9 May 2024 16:13:31 +0200 Subject: [PATCH 1/3] * Added DBeaver connection --- README.md | 8 +++++++- package-scripts.js | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b5a13f0..9c17aa6c 100644 --- a/README.md +++ b/README.md @@ -799,9 +799,15 @@ Approach 1: (by ssh'ing directly in the k8s pod) Approach 2: (by using external psql with port-forwarding; requires that PostgreSQL be installed on your host computer) * 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) -* 2\) Run: `npm start "db.psql_k8s [dm-local/dm-ovh]"` +* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) * 3\) The shell should now have you logged in as the `admin` user. +Approach 3: (by using dbeaver) +* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) +* 2\) Retrieve the data from "debate-map-pguser-admin" for the "dm-local" context by running "npm start db.local_secrets" +* 3\) Enter the data printed in the console to make a new dbeaver connection. + + diff --git a/package-scripts.js b/package-scripts.js index 2f10ba08..45975b49 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -558,6 +558,15 @@ Object.assign(scripts, { console.log("Connecting psql to database:", database); const psqlProcess = StartPSQLInK8s(K8sContext_Arg(), database, {stdio: "inherit"}, pager); }), + local_secrets: Dynamic(()=>{ + // we only care about local context data here, so no need to pass context to GetK8sPGUserAdminSecretData + const secret = GetK8sPGUserAdminSecretData("dm-local"); + console.log("--- Local Secrets ---"); + console.log("PORT:", 5120); + console.log("DATABASE:", "debate-map"); + console.log("USER:", "admin"); + console.log("PASSWORD:", secret.GetField("password").toString()); + }), // db init/seed commands (using psql to run standard .sql files) buildSeedDBScript: GetBuildSeedDBScriptCommand(), From e55765cf03a2b8b2a1c63df99bd4a0fe96adba64 Mon Sep 17 00:00:00 2001 From: Alvinosh Date: Thu, 9 May 2024 16:24:25 +0200 Subject: [PATCH 2/3] * Fixed Typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c17aa6c..87352b76 100644 --- a/README.md +++ b/README.md @@ -799,12 +799,12 @@ Approach 1: (by ssh'ing directly in the k8s pod) Approach 2: (by using external psql with port-forwarding; requires that PostgreSQL be installed on your host computer) * 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) -* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) +* 2\) Run: `npm start "db.psql_k8s [dm-local/dm-ovh]"` * 3\) The shell should now have you logged in as the `admin` user. Approach 3: (by using dbeaver) * 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) -* 2\) Retrieve the data from "debate-map-pguser-admin" for the "dm-local" context by running "npm start db.local_secrets" +* 2\) Retrieve the data from "debate-map-pguser-admin" for the "dm-local" context by running `npm start db.local_secrets` * 3\) Enter the data printed in the console to make a new dbeaver connection. From a67b55cd7263499f62404fa088f4f759e7c0441d Mon Sep 17 00:00:00 2001 From: Venryx Date: Fri, 10 May 2024 18:13:16 -0700 Subject: [PATCH 3/3] * MS claim-gen subtree-importer supports new "counter_claim" field in the claim object/structure. --- .../client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts | 3 +++ .../Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts index e205ea99..1db3c6fc 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts @@ -115,6 +115,9 @@ export class CG_Claim extends CG_Node { // v3 (tool extending claim-gen) arguments?: (string | CG_Argument)[]; + + // v4 + counter_claim?: string; } export class CG_Argument extends CG_Node { argument: string; diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts index 8d87f4a7..24e42a3e 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts @@ -56,6 +56,7 @@ export const GetResourcesInClaim_CG = CreateAccessor((context: ImportContext, cl const args = [] as CG_Argument[]; if (claim.argument) args.push({argument: claim.argument} as CG_Argument); if (claim.arguments) args.push(...claim.arguments.map(a=>(IsString(a) ? {argument: a} : a)) as CG_Argument[]); + if (claim.counter_claim) args.push({argument: claim.counter_claim} as CG_Argument); for (const [i, argument] of args.entries()) { result.push(NewNodeResource(context, argument, NodeType.claim, path_indexes.concat(i), path_titles.concat(argument.argument), claimResource, ChildGroup.freeform)); }