@memberjunction/codegen-lib 6.2.0-edge.4 → 6.2.0-edge.6
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/README.md +7 -0
- package/dist/Angular/angular-codegen.d.ts.map +1 -1
- package/dist/Angular/angular-codegen.js +2 -0
- package/dist/Angular/angular-codegen.js.map +1 -1
- package/dist/Config/config.d.ts +162 -0
- package/dist/Config/config.d.ts.map +1 -1
- package/dist/Config/config.js +81 -2
- package/dist/Config/config.js.map +1 -1
- package/dist/Database/codeGenDatabaseProvider.d.ts +205 -6
- package/dist/Database/codeGenDatabaseProvider.d.ts.map +1 -1
- package/dist/Database/codeGenDatabaseProvider.js +367 -5
- package/dist/Database/codeGenDatabaseProvider.js.map +1 -1
- package/dist/Database/heal-schema-params.d.ts +7 -0
- package/dist/Database/heal-schema-params.d.ts.map +1 -1
- package/dist/Database/heal-schema-params.js +5 -0
- package/dist/Database/heal-schema-params.js.map +1 -1
- package/dist/Database/manage-metadata.d.ts +290 -7
- package/dist/Database/manage-metadata.d.ts.map +1 -1
- package/dist/Database/manage-metadata.js +737 -67
- package/dist/Database/manage-metadata.js.map +1 -1
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts +61 -8
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts.map +1 -1
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js +238 -48
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js.map +1 -1
- package/dist/Database/providers/postgresql/__tests__/MetadataSupportObjectsDDL.test.d.ts +2 -0
- package/dist/Database/providers/postgresql/__tests__/MetadataSupportObjectsDDL.test.d.ts.map +1 -0
- package/dist/Database/providers/postgresql/__tests__/MetadataSupportObjectsDDL.test.js +127 -0
- package/dist/Database/providers/postgresql/__tests__/MetadataSupportObjectsDDL.test.js.map +1 -0
- package/dist/Database/providers/postgresql/metadataSupportObjects.js +200 -8
- package/dist/Database/providers/postgresql/metadataSupportObjects.js.map +1 -1
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts +63 -13
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts.map +1 -1
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js +204 -72
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js.map +1 -1
- package/dist/Database/providers/sqlserver/__tests__/VerifiedJoinIndexes.test.d.ts +2 -0
- package/dist/Database/providers/sqlserver/__tests__/VerifiedJoinIndexes.test.d.ts.map +1 -0
- package/dist/Database/providers/sqlserver/__tests__/VerifiedJoinIndexes.test.js +141 -0
- package/dist/Database/providers/sqlserver/__tests__/VerifiedJoinIndexes.test.js.map +1 -0
- package/dist/Database/providers/sqlserver/sqlServerDefaultValues.d.ts +47 -0
- package/dist/Database/providers/sqlserver/sqlServerDefaultValues.d.ts.map +1 -0
- package/dist/Database/providers/sqlserver/sqlServerDefaultValues.js +167 -0
- package/dist/Database/providers/sqlserver/sqlServerDefaultValues.js.map +1 -0
- package/dist/Database/providers/sqlserver/sqlServerScriptText.d.ts +31 -0
- package/dist/Database/providers/sqlserver/sqlServerScriptText.d.ts.map +1 -0
- package/dist/Database/providers/sqlserver/sqlServerScriptText.js +116 -0
- package/dist/Database/providers/sqlserver/sqlServerScriptText.js.map +1 -0
- package/dist/Database/sql.d.ts +13 -0
- package/dist/Database/sql.d.ts.map +1 -1
- package/dist/Database/sql.js +39 -8
- package/dist/Database/sql.js.map +1 -1
- package/dist/Database/sql_codegen.d.ts +176 -4
- package/dist/Database/sql_codegen.d.ts.map +1 -1
- package/dist/Database/sql_codegen.js +676 -37
- package/dist/Database/sql_codegen.js.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts +9 -0
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.js +28 -7
- package/dist/Manifest/GenerateClassRegistrationsManifest.js.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.js +18 -2
- package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
- package/dist/Misc/system_integrity.d.ts +48 -0
- package/dist/Misc/system_integrity.d.ts.map +1 -1
- package/dist/Misc/system_integrity.js +151 -75
- package/dist/Misc/system_integrity.js.map +1 -1
- package/dist/runCodeGen.d.ts +35 -3
- package/dist/runCodeGen.d.ts.map +1 -1
- package/dist/runCodeGen.js +135 -45
- package/dist/runCodeGen.js.map +1 -1
- package/package.json +29 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_integrity.js","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system_integrity.js","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA6BxE;;;GAGG;AACH,SAAS,EAAE,CAAC,IAAY;IACpB,IAAI,UAAU,EAAE,KAAK,YAAY,EAAE,CAAC;QAChC,OAAO,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;IAC5B,CAAC;IACD,OAAO,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;AAC5B,CAAC;AAqBD,SAAS,UAAU,CAAC,MAAc,EAAE,UAAkB;IAClD,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;AAC/E,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,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C5O,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,eAAe,CAAC,OAA+B;QACzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAChC,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC;YACtB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;YACxC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IACpD,CAAC"}
|
package/dist/runCodeGen.d.ts
CHANGED
|
@@ -18,16 +18,34 @@ type DataSourceResult = ProviderDataSourceResult;
|
|
|
18
18
|
/**
|
|
19
19
|
* Main orchestrator class for the MemberJunction code generation process.
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* Counts validators by identity (`entityName|functionName`, entity compared case-insensitively),
|
|
23
|
+
* so a validator regenerated or loaded twice is reported once.
|
|
24
|
+
*/
|
|
25
|
+
export declare function CountDistinctValidators(validators: ReadonlyArray<{
|
|
26
|
+
entityName: string;
|
|
27
|
+
functionName: string;
|
|
28
|
+
}>): number;
|
|
21
29
|
export declare class RunCodeGenBase {
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
31
|
+
* Every step failure captured during a pipeline run: BEFORE/AFTER commands, SQL scripts,
|
|
32
|
+
* metadata management, the SQL pass, validators, file generation and integrity checks.
|
|
33
|
+
* The pipeline runs every step to the end, then fails (success=false, non-zero exit) with
|
|
34
|
+
* this full list, instead of stopping at the first failure or logging and reporting success.
|
|
26
35
|
*/
|
|
27
36
|
protected commandFailures: Array<{
|
|
28
37
|
context: string;
|
|
29
38
|
message: string;
|
|
30
39
|
}>;
|
|
40
|
+
/** Records a step failure for the end-of-run list, and logs it now. */
|
|
41
|
+
protected RecordStepFailure(context: string, message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Formats the end-of-run failure list. Returns an empty string when there are none.
|
|
44
|
+
*/
|
|
45
|
+
static FormatStepFailures(failures: ReadonlyArray<{
|
|
46
|
+
context: string;
|
|
47
|
+
message: string;
|
|
48
|
+
}>): string;
|
|
31
49
|
/**
|
|
32
50
|
* Record any failed entries from a BEFORE/AFTER command batch, paired by index.
|
|
33
51
|
*
|
|
@@ -77,6 +95,20 @@ export declare class RunCodeGenBase {
|
|
|
77
95
|
* Accepts an existing data source — does NOT create connections or call process.exit().
|
|
78
96
|
*/
|
|
79
97
|
protected executeCodeGenPipeline(dataSource: DataSourceResult, skipDatabaseGeneration?: boolean, skipFileGeneration?: boolean): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Refreshes every metadata provider the rest of the pipeline reads, once `manageMetadata` has written to
|
|
100
|
+
* the database.
|
|
101
|
+
*
|
|
102
|
+
* There can be two. `provider` is the one this pipeline was handed, but SQL generation reads entities
|
|
103
|
+
* through `new MJ.Metadata()` — the process's GLOBAL provider. The CLI creates one provider and makes it the
|
|
104
|
+
* global one, so they are the same object and one refresh covers both. In-process (`RunInProcess`, the
|
|
105
|
+
* runtime schema-update path) the host hands the pipeline a SEPARATE CodeGen-credential provider, and
|
|
106
|
+
* refreshing only that one left SQL generation on whatever snapshot the host's timed refresh last took. The
|
|
107
|
+
* entities `manageMetadata` had just given their soft primary keys still had none there, so every one of them
|
|
108
|
+
* was skipped as "no primary key field in metadata" — tables and entity rows, but no base view and no CRUD
|
|
109
|
+
* routines. Observed on a SQL Server tenant for 348 of 884 entities, on two consecutive runs.
|
|
110
|
+
*/
|
|
111
|
+
private refreshMetadataAfterManageMetadata;
|
|
80
112
|
/**
|
|
81
113
|
* Resolve dirty-schema emit options for one generator call.
|
|
82
114
|
* `--skipdb` (files only) and `fileEmit.dirtySchemaOnly === false` rebuild
|
package/dist/runCodeGen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCodeGen.d.ts","sourceRoot":"","sources":["../src/runCodeGen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAA4G,WAAW,EAA8E,MAAM,iBAAiB,CAAC;AACpO,OAAO,EAAyC,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAI9F,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAmB,sBAAsB,EAA8B,MAAM,mBAAmB,CAAC;AASxG,OAAO,EAAE,iBAAiB,EAA2B,gBAAgB,IAAI,wBAAwB,EAAkC,MAAM,oCAAoC,CAAC;AAK9K,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,8DAA8D,CAAC;AAStE,KAAK,gBAAgB,GAAG,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"runCodeGen.d.ts","sourceRoot":"","sources":["../src/runCodeGen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAA4G,WAAW,EAA8E,MAAM,iBAAiB,CAAC;AACpO,OAAO,EAAyC,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAI9F,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAmB,sBAAsB,EAA8B,MAAM,mBAAmB,CAAC;AASxG,OAAO,EAAE,iBAAiB,EAA2B,gBAAgB,IAAI,wBAAwB,EAAkC,MAAM,oCAAoC,CAAC;AAK9K,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;A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E,OAAe;IAQ7F;;;;OAIG;IACU,aAAa,CAAC,sBAAsB,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAiD9H;;;OAGG;cACa,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IA6bpK;;;;;;;;;;;;OAYG;YACW,kCAAkC;IAQhD;;;;;;OAMG;IACH,SAAS,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,iBAAiB;IAa/F;;;;;;;;OAQG;cACa,sBAAsB,CACpC,IAAI,EAAE,iBAAiB,EACvB,WAAW,EAAE,QAAQ,EACrB,EAAE,EAAE,EAAE,CAAC,QAAQ,EACf,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,OAAO,CAAC;CAoVpB;AAED;;GAEG;AACH,wBAAsB,+BAA+B,CAAC,sBAAsB,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,iBAGjI;AAED,+DAA+D;AAC/D,wBAAsB,+BAA+B,CAAC,sBAAsB,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,iBAEjI;AAED;;;;;GAKG;AACH,wBAAsB,yCAAyC,CAC7D,sBAAsB,GAAE,OAAe,EACvC,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,WAAW,CAAC,CAGtB;AAED,yEAAyE;AACzE,wBAAsB,yCAAyC,CAC7D,sBAAsB,GAAE,OAAe,EACvC,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,WAAW,CAAC,CAEtB"}
|
package/dist/runCodeGen.js
CHANGED
|
@@ -35,18 +35,46 @@ import { AIEngine } from '@memberjunction/aiengine';
|
|
|
35
35
|
import '@memberjunction/server-bootstrap-lite/mj-class-registrations';
|
|
36
36
|
/** Extract core schema name from configuration */
|
|
37
37
|
const { mjCoreSchema } = configInfo;
|
|
38
|
+
/**
|
|
39
|
+
* Failure context for the SQL generation/execution pass. Named so the CRUD self-heal can clear
|
|
40
|
+
* exactly this entry when it repairs what the pass left missing.
|
|
41
|
+
*/
|
|
42
|
+
const SQL_PASS_FAILURE_CONTEXT = 'SQL_PASS';
|
|
38
43
|
/**
|
|
39
44
|
* Main orchestrator class for the MemberJunction code generation process.
|
|
40
45
|
*/
|
|
46
|
+
/**
|
|
47
|
+
* Counts validators by identity (`entityName|functionName`, entity compared case-insensitively),
|
|
48
|
+
* so a validator regenerated or loaded twice is reported once.
|
|
49
|
+
*/
|
|
50
|
+
export function CountDistinctValidators(validators) {
|
|
51
|
+
return new Set(validators.map((v) => `${v.entityName.toLowerCase()}|${v.functionName}`)).size;
|
|
52
|
+
}
|
|
41
53
|
export class RunCodeGenBase {
|
|
42
54
|
constructor() {
|
|
43
55
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
56
|
+
* Every step failure captured during a pipeline run: BEFORE/AFTER commands, SQL scripts,
|
|
57
|
+
* metadata management, the SQL pass, validators, file generation and integrity checks.
|
|
58
|
+
* The pipeline runs every step to the end, then fails (success=false, non-zero exit) with
|
|
59
|
+
* this full list, instead of stopping at the first failure or logging and reporting success.
|
|
47
60
|
*/
|
|
48
61
|
this.commandFailures = [];
|
|
49
62
|
}
|
|
63
|
+
/** Records a step failure for the end-of-run list, and logs it now. */
|
|
64
|
+
RecordStepFailure(context, message) {
|
|
65
|
+
this.commandFailures.push({ context, message });
|
|
66
|
+
logError(`${context}: ${message}`);
|
|
67
|
+
CodeGenReporter.Instance.note(`${context}: ${message}`);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Formats the end-of-run failure list. Returns an empty string when there are none.
|
|
71
|
+
*/
|
|
72
|
+
static FormatStepFailures(failures) {
|
|
73
|
+
if (failures.length === 0)
|
|
74
|
+
return '';
|
|
75
|
+
const lines = failures.map((f, i) => ` ${i + 1}. [${f.context}] ${f.message}`);
|
|
76
|
+
return `CodeGen finished with ${failures.length} failure${failures.length === 1 ? '' : 's'}:\n${lines.join('\n')}`;
|
|
77
|
+
}
|
|
50
78
|
/**
|
|
51
79
|
* Record any failed entries from a BEFORE/AFTER command batch, paired by index.
|
|
52
80
|
*
|
|
@@ -246,8 +274,10 @@ export class RunCodeGenBase {
|
|
|
246
274
|
}
|
|
247
275
|
}
|
|
248
276
|
UpdateSpinner('Executing before-all SQL Scripts...');
|
|
249
|
-
if (!(await sqlCodeGenObject.runCustomSQLScripts(conn, 'before-all')))
|
|
250
|
-
|
|
277
|
+
if (!(await sqlCodeGenObject.runCustomSQLScripts(conn, 'before-all'))) {
|
|
278
|
+
this.RecordStepFailure('BEFORE_ALL_SQL', 'One or more before-all SQL scripts failed');
|
|
279
|
+
pipelineSuccess = false;
|
|
280
|
+
}
|
|
251
281
|
const newUserSetup = configInfo.newUserSetup;
|
|
252
282
|
if (newUserSetup) {
|
|
253
283
|
UpdateSpinner('Setting up new user...');
|
|
@@ -255,8 +285,8 @@ export class RunCodeGenBase {
|
|
|
255
285
|
const result = await newUserObject.createNewUser(newUserSetup);
|
|
256
286
|
if (!result.Success) {
|
|
257
287
|
if (result.Severity === 'error') {
|
|
258
|
-
|
|
259
|
-
|
|
288
|
+
this.RecordStepFailure('NEW_USER_SETUP', result.Message);
|
|
289
|
+
pipelineSuccess = false;
|
|
260
290
|
}
|
|
261
291
|
else {
|
|
262
292
|
LogWarning('Warning: (New User Setup) ' + result.Message);
|
|
@@ -272,9 +302,10 @@ export class RunCodeGenBase {
|
|
|
272
302
|
// rows for newly-discovered entities. Skipping Refresh here causes the SQL-gen entity
|
|
273
303
|
// loop to use stale snapshots and silently drop CRUD for those entities — Bug 1 in the
|
|
274
304
|
// 3-bug chain, observed first-run on PG for entities like SystemEvent.
|
|
275
|
-
await
|
|
305
|
+
await this.refreshMetadataAfterManageMetadata(provider);
|
|
276
306
|
if (!metadataSuccess) {
|
|
277
307
|
FailSpinner('ERROR managing metadata (refresh applied; downstream will use latest available state)');
|
|
308
|
+
this.RecordStepFailure('MANAGE_METADATA', 'Metadata management reported a failure; see the errors logged above');
|
|
278
309
|
pipelineSuccess = false;
|
|
279
310
|
}
|
|
280
311
|
else {
|
|
@@ -285,7 +316,11 @@ export class RunCodeGenBase {
|
|
|
285
316
|
// FLS-enabled entity a field with no permission rows is DENIED, so a column added
|
|
286
317
|
// without this step would be invisible to every user until something else reconciled.
|
|
287
318
|
// It also removes rows orphaned by a dropped column or a revoked role.
|
|
288
|
-
await reporter.phase('reconcileFieldPermissions', () => ReconcileFieldLevelSecurity(provider, currentUser));
|
|
319
|
+
const flsOk = await reporter.phase('reconcileFieldPermissions', () => ReconcileFieldLevelSecurity(provider, currentUser));
|
|
320
|
+
if (flsOk === false) {
|
|
321
|
+
this.RecordStepFailure('FIELD_LEVEL_SECURITY', 'Field-level security reconciliation failed');
|
|
322
|
+
pipelineSuccess = false;
|
|
323
|
+
}
|
|
289
324
|
const sqlOutputDir = OutputDir('SQL', true);
|
|
290
325
|
let sqlGenerationSucceeded = true;
|
|
291
326
|
if (sqlOutputDir) {
|
|
@@ -293,6 +328,7 @@ export class RunCodeGenBase {
|
|
|
293
328
|
const sqlSuccess = await reporter.phase('manageSQLScriptsAndExecution', () => sqlCodeGenObject.manageSQLScriptsAndExecution(conn, md.Entities, sqlOutputDir, currentUser));
|
|
294
329
|
if (!sqlSuccess) {
|
|
295
330
|
FailSpinner('Error managing SQL scripts and execution');
|
|
331
|
+
this.RecordStepFailure(SQL_PASS_FAILURE_CONTEXT, 'SQL generation/execution reported a failure; see the errors logged above');
|
|
296
332
|
sqlGenerationSucceeded = false;
|
|
297
333
|
pipelineSuccess = false;
|
|
298
334
|
}
|
|
@@ -358,6 +394,7 @@ export class RunCodeGenBase {
|
|
|
358
394
|
missing = await sqlCodeGenObject.DBProvider.validateExpectedCRUDFunctions(conn, baseline);
|
|
359
395
|
if (missing.length === 0) {
|
|
360
396
|
logStatus('Self-heal succeeded — all expected CRUD routines now exist');
|
|
397
|
+
this.commandFailures = this.commandFailures.filter((f) => f.context !== SQL_PASS_FAILURE_CONTEXT);
|
|
361
398
|
// Self-heal closed the runtime gap that the upstream batch
|
|
362
399
|
// failure left behind. Clear the upstream failure flag so
|
|
363
400
|
// codegen reports success: every entity that runtime needs
|
|
@@ -386,7 +423,8 @@ export class RunCodeGenBase {
|
|
|
386
423
|
` • Stale entity-field metadata caused per-entity PK detection to fail\n` +
|
|
387
424
|
` • Cascade-delete dependency analysis dropped entities silently\n` +
|
|
388
425
|
`Run codegen again on the same DB to see if the issue persists; if it does, this is a real generation bug.`);
|
|
389
|
-
|
|
426
|
+
this.commandFailures.push({ context: 'CRUD_VALIDATION', message: `${missing.length} expected CRUD routine(s) missing:\n${list}` });
|
|
427
|
+
pipelineSuccess = false;
|
|
390
428
|
}
|
|
391
429
|
else {
|
|
392
430
|
SucceedSpinner(`Post-CodeGen CRUD validation passed (${md.Entities.length} entities checked)`);
|
|
@@ -394,8 +432,8 @@ export class RunCodeGenBase {
|
|
|
394
432
|
}
|
|
395
433
|
catch (e) {
|
|
396
434
|
FailSpinner('Post-CodeGen CRUD validation errored');
|
|
397
|
-
|
|
398
|
-
|
|
435
|
+
this.RecordStepFailure('CRUD_VALIDATION', `CRUD validator threw: ${e instanceof Error ? e.message : String(e)}`);
|
|
436
|
+
pipelineSuccess = false;
|
|
399
437
|
}
|
|
400
438
|
}
|
|
401
439
|
// Metadata/view coherence. The CRUD validator asks "can the runtime WRITE this
|
|
@@ -434,11 +472,13 @@ export class RunCodeGenBase {
|
|
|
434
472
|
`CREATE OR REPLACE VIEW, so no DROP/CASCADE is required.`;
|
|
435
473
|
if (strict) {
|
|
436
474
|
FailSpinner(`Field-resolution validation FAILED: ${gaps.length} unreadable field(s)`);
|
|
437
|
-
|
|
438
|
-
|
|
475
|
+
this.RecordStepFailure('FIELD_RESOLUTION', summary);
|
|
476
|
+
pipelineSuccess = false;
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
WarnSpinner(`Field-resolution validation found ${gaps.length} unreadable field(s)`);
|
|
480
|
+
LogWarning(summary);
|
|
439
481
|
}
|
|
440
|
-
WarnSpinner(`Field-resolution validation found ${gaps.length} unreadable field(s)`);
|
|
441
|
-
LogWarning(summary);
|
|
442
482
|
}
|
|
443
483
|
else {
|
|
444
484
|
SucceedSpinner('Entity fields all resolve against their base views');
|
|
@@ -449,11 +489,12 @@ export class RunCodeGenBase {
|
|
|
449
489
|
WarnSpinner('Field-resolution validation could not run');
|
|
450
490
|
LogWarning(`Field-resolution validator threw: ${e instanceof Error ? e.message : String(e)}`);
|
|
451
491
|
}
|
|
452
|
-
//
|
|
453
|
-
// green validator just means whatever DID get generated is
|
|
454
|
-
// it doesn't whitewash an upstream batch error.
|
|
492
|
+
// An upstream SQL-pipeline failure stays recorded (SQL_PASS_FAILURE_CONTEXT) even if the
|
|
493
|
+
// validators passed: a green validator just means whatever DID get generated is
|
|
494
|
+
// consistent; it doesn't whitewash an upstream batch error. The run continues so every
|
|
495
|
+
// later step's failures are reported too.
|
|
455
496
|
if (!sqlGenerationSucceeded) {
|
|
456
|
-
|
|
497
|
+
pipelineSuccess = false;
|
|
457
498
|
}
|
|
458
499
|
}
|
|
459
500
|
else {
|
|
@@ -482,8 +523,10 @@ export class RunCodeGenBase {
|
|
|
482
523
|
const metadataSuccess = await reporter.phase('loadGeneratedCode', () => manageMD.loadGeneratedCode(conn, currentUser));
|
|
483
524
|
if (!metadataSuccess) {
|
|
484
525
|
FailSpinner('ERROR checking/loading AI Generated Code from Metadata');
|
|
526
|
+
// File generation is skipped below: emitting without the loaded validators would delete
|
|
527
|
+
// every committed Validate() override (see above).
|
|
528
|
+
this.RecordStepFailure('LOAD_GENERATED_CODE', 'Loading AI generated code from metadata failed; file generation was skipped');
|
|
485
529
|
pipelineSuccess = false;
|
|
486
|
-
return false;
|
|
487
530
|
}
|
|
488
531
|
else {
|
|
489
532
|
// Report the COUNT, not just success. Loading zero validators is a legitimate state for a
|
|
@@ -491,7 +534,7 @@ export class RunCodeGenBase {
|
|
|
491
534
|
// generation emits each entity as though it had no `Validate()` override, silently deleting
|
|
492
535
|
// whatever was committed. Both times that regression shipped, the log said exactly this
|
|
493
536
|
// line and nothing else. A number here makes the next one visible in CI output.
|
|
494
|
-
const loadedValidators = ManageMetadataBase.generatedValidators
|
|
537
|
+
const loadedValidators = CountDistinctValidators(ManageMetadataBase.generatedValidators);
|
|
495
538
|
SucceedSpinner(`AI Generated Code loaded from Metadata (${loadedValidators} validator${loadedValidators === 1 ? '' : 's'})`);
|
|
496
539
|
}
|
|
497
540
|
const skipFiles = skipFileGeneration || GetSettingValue('skip_file_generation', false);
|
|
@@ -499,9 +542,11 @@ export class RunCodeGenBase {
|
|
|
499
542
|
WarnSpinner('Skipping file generation (skip_file_generation = true)');
|
|
500
543
|
SQLLogging.finishSQLLogging();
|
|
501
544
|
}
|
|
545
|
+
else if (!metadataSuccess) {
|
|
546
|
+
SQLLogging.finishSQLLogging();
|
|
547
|
+
}
|
|
502
548
|
else if (!(await this.runFileGenerationPhase(conn, currentUser, md, skipDB))) {
|
|
503
549
|
pipelineSuccess = false;
|
|
504
|
-
return false;
|
|
505
550
|
}
|
|
506
551
|
StartSpinner('Running system integrity checks...');
|
|
507
552
|
// Three outcomes, not two. `SystemIntegrityBase.ClassifyResults` owns the distinction and is
|
|
@@ -529,10 +574,7 @@ export class RunCodeGenBase {
|
|
|
529
574
|
FailSpinner(`System integrity checks FAILED: ${integrityOutcome.Failures.map((f) => f.Name).join(', ')}`);
|
|
530
575
|
pipelineSuccess = false;
|
|
531
576
|
for (const failure of integrityOutcome.Failures) {
|
|
532
|
-
|
|
533
|
-
logError(msg);
|
|
534
|
-
reporter.note(msg);
|
|
535
|
-
this.commandFailures.push({ context: 'INTEGRITY_CHECK', message: msg });
|
|
577
|
+
this.RecordStepFailure('INTEGRITY_CHECK', `Integrity check '${failure.Name}' failed: ${failure.Message}`);
|
|
536
578
|
}
|
|
537
579
|
break;
|
|
538
580
|
}
|
|
@@ -558,8 +600,11 @@ export class RunCodeGenBase {
|
|
|
558
600
|
}
|
|
559
601
|
if (!skipDB) {
|
|
560
602
|
StartSpinner('Executing after-all SQL Scripts...');
|
|
561
|
-
if (!(await sqlCodeGenObject.runCustomSQLScripts(conn, 'after-all')))
|
|
603
|
+
if (!(await sqlCodeGenObject.runCustomSQLScripts(conn, 'after-all'))) {
|
|
562
604
|
FailSpinner('ERROR running after-all SQL Scripts');
|
|
605
|
+
this.RecordStepFailure('AFTER_ALL_SQL', 'One or more after-all SQL scripts failed');
|
|
606
|
+
pipelineSuccess = false;
|
|
607
|
+
}
|
|
563
608
|
else
|
|
564
609
|
SucceedSpinner('After-all SQL Scripts completed');
|
|
565
610
|
}
|
|
@@ -568,11 +613,21 @@ export class RunCodeGenBase {
|
|
|
568
613
|
// Visible final summary (succeedSpinner persists a ✔ line in both verbose and
|
|
569
614
|
// non-verbose modes). The detailed/timestamped form stays on logStatus for the
|
|
570
615
|
// verbose log + report.
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
//
|
|
574
|
-
|
|
575
|
-
|
|
616
|
+
// Any recorded step failure fails the run (success=false, exit 1) so it isn't silently
|
|
617
|
+
// swallowed. A failure that set pipelineSuccess without recording a message still fails
|
|
618
|
+
// it, with a generic entry so the list is never empty on a failed run.
|
|
619
|
+
if (!pipelineSuccess && this.commandFailures.length === 0) {
|
|
620
|
+
this.commandFailures.push({ context: 'PIPELINE', message: 'CodeGen pipeline reported a failure — see the log output above for detail.' });
|
|
621
|
+
}
|
|
622
|
+
pipelineSuccess = this.commandFailures.length === 0;
|
|
623
|
+
if (pipelineSuccess) {
|
|
624
|
+
SucceedSpinner(`MJ CodeGen complete — ${md.Entities.length} entities in ${totalSeconds.toFixed(2)}s`);
|
|
625
|
+
logStatus('MJ CodeGen Complete! ' + md.Entities.length + ' entities processed in ' + totalSeconds + 's @ ' + endTime.toLocaleString());
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
FailSpinner(`MJ CodeGen finished with ${this.commandFailures.length} failure(s) — ${md.Entities.length} entities in ${totalSeconds.toFixed(2)}s`);
|
|
629
|
+
logError(RunCodeGenBase.FormatStepFailures(this.commandFailures));
|
|
630
|
+
}
|
|
576
631
|
return pipelineSuccess;
|
|
577
632
|
}
|
|
578
633
|
catch (err) {
|
|
@@ -599,6 +654,26 @@ export class RunCodeGenBase {
|
|
|
599
654
|
logStatus('CodeGen report written: ' + filePath);
|
|
600
655
|
}
|
|
601
656
|
}
|
|
657
|
+
/**
|
|
658
|
+
* Refreshes every metadata provider the rest of the pipeline reads, once `manageMetadata` has written to
|
|
659
|
+
* the database.
|
|
660
|
+
*
|
|
661
|
+
* There can be two. `provider` is the one this pipeline was handed, but SQL generation reads entities
|
|
662
|
+
* through `new MJ.Metadata()` — the process's GLOBAL provider. The CLI creates one provider and makes it the
|
|
663
|
+
* global one, so they are the same object and one refresh covers both. In-process (`RunInProcess`, the
|
|
664
|
+
* runtime schema-update path) the host hands the pipeline a SEPARATE CodeGen-credential provider, and
|
|
665
|
+
* refreshing only that one left SQL generation on whatever snapshot the host's timed refresh last took. The
|
|
666
|
+
* entities `manageMetadata` had just given their soft primary keys still had none there, so every one of them
|
|
667
|
+
* was skipped as "no primary key field in metadata" — tables and entity rows, but no base view and no CRUD
|
|
668
|
+
* routines. Observed on a SQL Server tenant for 348 of 884 entities, on two consecutive runs.
|
|
669
|
+
*/
|
|
670
|
+
async refreshMetadataAfterManageMetadata(provider) {
|
|
671
|
+
await provider.Refresh();
|
|
672
|
+
const hostProvider = MJ.Metadata.Provider; // global-provider-ok: SQL generation reads `new MJ.Metadata()`, which is this provider; in-process it is the host's, not `provider`
|
|
673
|
+
if (hostProvider && hostProvider !== provider) {
|
|
674
|
+
await hostProvider.Refresh();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
602
677
|
/**
|
|
603
678
|
* Resolve dirty-schema emit options for one generator call.
|
|
604
679
|
* `--skipdb` (files only) and `fileEmit.dirtySchemaOnly === false` rebuild
|
|
@@ -623,6 +698,8 @@ export class RunCodeGenBase {
|
|
|
623
698
|
*/
|
|
624
699
|
async runFileGenerationPhase(conn, currentUser, md, skipDB) {
|
|
625
700
|
const reporter = CodeGenReporter.Instance;
|
|
701
|
+
// Every generator runs even after one fails, so the run reports all failures at once.
|
|
702
|
+
let allSucceeded = true;
|
|
626
703
|
EmitStats.Reset();
|
|
627
704
|
const apiEntities = md.Entities.filter((e) => e.IncludeInAPI);
|
|
628
705
|
const excludedSchemaNames = configInfo.excludeSchemas.map(s => SchemaKey(s));
|
|
@@ -663,7 +740,8 @@ export class RunCodeGenBase {
|
|
|
663
740
|
const ok = await reporter.phase('generateGraphQLCore', async () => graphQLGenerator.generateGraphQLServerCode(coreEntities, graphQLCoreResolversOutputDir, '@memberjunction/core-entities', true, this.buildSchemaEmitOptions(coreEntities, skipDB)));
|
|
664
741
|
if (!ok) {
|
|
665
742
|
FailSpinner('Error generating GraphQL server code');
|
|
666
|
-
|
|
743
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating CORE GraphQL server code');
|
|
744
|
+
allSucceeded = false;
|
|
667
745
|
}
|
|
668
746
|
else if (isVerbose)
|
|
669
747
|
SucceedSpinner('CORE Entity GraphQL Resolver Code generated');
|
|
@@ -688,7 +766,8 @@ export class RunCodeGenBase {
|
|
|
688
766
|
});
|
|
689
767
|
if (!ok) {
|
|
690
768
|
FailSpinner('Error generating GraphQL Resolver code');
|
|
691
|
-
|
|
769
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating GraphQL Resolver code');
|
|
770
|
+
allSucceeded = false;
|
|
692
771
|
}
|
|
693
772
|
else if (isVerbose)
|
|
694
773
|
SucceedSpinner('GraphQL Resolver Code generated');
|
|
@@ -703,7 +782,8 @@ export class RunCodeGenBase {
|
|
|
703
782
|
const ok = await reporter.phase('generateEntitySubclassesCore', () => entitySubClassGeneratorObject.generateAllEntitySubClasses(conn, coreEntities, coreEntitySubClassOutputDir, skipDB, this.buildSchemaEmitOptions(coreEntities, skipDB)));
|
|
704
783
|
if (!ok) {
|
|
705
784
|
FailSpinner('Error generating entity subclass code');
|
|
706
|
-
|
|
785
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating CORE entity subclass code');
|
|
786
|
+
allSucceeded = false;
|
|
707
787
|
}
|
|
708
788
|
else if (isVerbose)
|
|
709
789
|
SucceedSpinner('CORE Entity Subclass Code generated');
|
|
@@ -725,7 +805,8 @@ export class RunCodeGenBase {
|
|
|
725
805
|
});
|
|
726
806
|
if (!ok) {
|
|
727
807
|
FailSpinner('Error generating entity subclass code');
|
|
728
|
-
|
|
808
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating entity subclass code');
|
|
809
|
+
allSucceeded = false;
|
|
729
810
|
}
|
|
730
811
|
else if (isVerbose)
|
|
731
812
|
SucceedSpinner('Entity Subclass Code generated');
|
|
@@ -740,7 +821,8 @@ export class RunCodeGenBase {
|
|
|
740
821
|
const ok = await reporter.phase('generateAngularCore', () => angularGenerator.generateAngularCode(coreEntities, angularCoreEntitiesOutputDir, 'Core', currentUser, 'AngularCoreEntities'));
|
|
741
822
|
if (!ok) {
|
|
742
823
|
FailSpinner('Error generating Angular CORE Entities code');
|
|
743
|
-
|
|
824
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating Angular CORE Entities code');
|
|
825
|
+
allSucceeded = false;
|
|
744
826
|
}
|
|
745
827
|
else if (isVerbose)
|
|
746
828
|
SucceedSpinner('Angular CORE Entities Code generated');
|
|
@@ -762,7 +844,8 @@ export class RunCodeGenBase {
|
|
|
762
844
|
});
|
|
763
845
|
if (!ok) {
|
|
764
846
|
FailSpinner('Error generating Angular code');
|
|
765
|
-
|
|
847
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating Angular code');
|
|
848
|
+
allSucceeded = false;
|
|
766
849
|
}
|
|
767
850
|
else if (isVerbose)
|
|
768
851
|
SucceedSpinner('Angular Code generated');
|
|
@@ -793,7 +876,8 @@ export class RunCodeGenBase {
|
|
|
793
876
|
const ok = await reporter.phase('generateActionsCore', () => actionsGenerator.generateActions(ActionEngineBase.Instance.CoreActions, coreActionsOutputDir));
|
|
794
877
|
if (!ok) {
|
|
795
878
|
FailSpinner('Error generating CORE Actions code');
|
|
796
|
-
|
|
879
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating CORE Actions code');
|
|
880
|
+
allSucceeded = false;
|
|
797
881
|
}
|
|
798
882
|
else if (isVerbose)
|
|
799
883
|
SucceedSpinner('CORE Actions Code generated');
|
|
@@ -806,7 +890,8 @@ export class RunCodeGenBase {
|
|
|
806
890
|
const ok = await reporter.phase('generateActions', () => actionsGenerator.generateActions(ActionEngineBase.Instance.NonCoreActions, actionsOutputDir));
|
|
807
891
|
if (!ok) {
|
|
808
892
|
FailSpinner('Error generating Actions code');
|
|
809
|
-
|
|
893
|
+
this.RecordStepFailure('FILE_GENERATION', 'Error generating Actions code');
|
|
894
|
+
allSucceeded = false;
|
|
810
895
|
}
|
|
811
896
|
else if (isVerbose)
|
|
812
897
|
SucceedSpinner('Actions Code generated');
|
|
@@ -886,7 +971,8 @@ export class RunCodeGenBase {
|
|
|
886
971
|
const ok = await reporter.phase(target.phase, () => remoteOpsGenerator.generateRemoteOperations(target.ops, target.dir));
|
|
887
972
|
if (!ok) {
|
|
888
973
|
FailSpinner(`Error generating ${target.label} code`);
|
|
889
|
-
|
|
974
|
+
this.RecordStepFailure('FILE_GENERATION', `Error generating ${target.label} code`);
|
|
975
|
+
allSucceeded = false;
|
|
890
976
|
}
|
|
891
977
|
else if (isVerbose)
|
|
892
978
|
SucceedSpinner(`${target.label} typed bases generated`);
|
|
@@ -904,9 +990,13 @@ export class RunCodeGenBase {
|
|
|
904
990
|
`schemas emitted ${emit.schemasEmitted} / skipped ${emit.schemasSkipped} ` +
|
|
905
991
|
`(assemble ${emit.assembleMs}ms)`);
|
|
906
992
|
SQLLogging.finishSQLLogging();
|
|
907
|
-
if (!isVerbose)
|
|
908
|
-
|
|
909
|
-
|
|
993
|
+
if (!isVerbose) {
|
|
994
|
+
if (allSucceeded)
|
|
995
|
+
SucceedSpinner('TypeScript code generation completed');
|
|
996
|
+
else
|
|
997
|
+
FailSpinner('TypeScript code generation finished with failures');
|
|
998
|
+
}
|
|
999
|
+
return allSucceeded;
|
|
910
1000
|
}
|
|
911
1001
|
}
|
|
912
1002
|
/**
|