@onlineapps/conn-orch-validator 3.2.3 → 3.3.0
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/CHANGELOG.md +36 -0
- package/README.md +2 -2
- package/docs/DESIGN.md +4 -4
- package/jest.config.js +2 -2
- package/package.json +1 -1
- package/src/CookbookTestRunner.js +9 -5
- package/src/ServiceReadinessValidator.js +1 -1
- package/src/helpers/README.md +1 -1
- package/src/index.js +2 -2
- package/src/validators/ServiceStructureValidator.js +4 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog — @onlineapps/conn-orch-validator
|
|
2
|
+
|
|
3
|
+
All notable changes to this package. Follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
|
|
4
|
+
|
|
5
|
+
## [3.3.0] — 2026-08-17
|
|
6
|
+
|
|
7
|
+
**Env-var contract rename per env-conventions.md.** Details: `api/docs/biz/60-templates/env-conventions.md`, `api/docs/biz/40-cookbooks/test-env-vars.md`.
|
|
8
|
+
|
|
9
|
+
### BREAKING
|
|
10
|
+
|
|
11
|
+
- **`CookbookTestRunner._dispatchViaHandler`** now reads `TESTING_TENANT_ID` and `TESTING_WORKSPACE_ID` from `process.env`. Old names `OA_VALIDATION_TENANT_ID` / `OA_VALIDATION_WORKSPACE_ID` are no longer recognised.
|
|
12
|
+
- **Missing-var error message** updated: `Missing required environment variables TESTING_TENANT_ID and/or TESTING_WORKSPACE_ID` (was: `OA_VALIDATION_*`).
|
|
13
|
+
- **No backward compatibility.** Per Architecture Principle #11, the runner does NOT fall back to the old names. Deploy pipelines and container env files must ship `TESTING_*`. A biz service that starts with only `OA_VALIDATION_*` in env will fail Tier-1 validation on first cookbook execution.
|
|
14
|
+
|
|
15
|
+
### Migration
|
|
16
|
+
|
|
17
|
+
Every biz-service env-template file under `api_biz/*/config/env-templates/*.env` has been updated in the same session (Fáze B2 in the biz-services alignment). Deployment steps:
|
|
18
|
+
|
|
19
|
+
1. `npm publish @onlineapps/conn-orch-validator@3.3.0`
|
|
20
|
+
2. In each `api_biz/*/package.json`: exact `"@onlineapps/conn-orch-validator": "3.3.0"` + `npm install`
|
|
21
|
+
3. Restart containers; `init.sh` regenerates `config/env-active/*.env` from the updated templates so the new `TESTING_*` names land in the runtime env.
|
|
22
|
+
|
|
23
|
+
### Rationale
|
|
24
|
+
|
|
25
|
+
- The `OA_VALIDATION_` prefix was semantically overloaded (`OA_VALIDATION_*` sounds like it could be a general-purpose "validation" flag, not specifically a cookbook-runner probe).
|
|
26
|
+
- `TESTING_*` is the canonical instance of the `TESTING_*` category defined in `env-conventions.md` — values that legitimately run in dev + CI + production because the Tier-1 cookbook runner fires everywhere.
|
|
27
|
+
- Rename enforced by `api/scripts/lint-env-prefixes.sh` (0 violations across the workspace as of the same-day commits).
|
|
28
|
+
|
|
29
|
+
### Tests
|
|
30
|
+
|
|
31
|
+
- `CookbookTestRunner.testingPrefix.test.js` (3 tests) — GREEN. Asserts source references only the new names, missing-var errors mention `TESTING_*`.
|
|
32
|
+
- Existing `CookbookTestRunner.handlerDispatch.test.js`, `resolveHeaders.test.js`, `CookbookTestRunner.integration.test.js`, and `jest.config.js` all updated to set/reference `TESTING_*`.
|
|
33
|
+
|
|
34
|
+
## [3.2.3] — Pre-3.3.0 baseline
|
|
35
|
+
|
|
36
|
+
Last version reading `OA_VALIDATION_TENANT_ID` / `OA_VALIDATION_WORKSPACE_ID`. Documented in `api/docs/biz/40-cookbooks/test-env-vars.md` Status section as historical.
|
package/README.md
CHANGED
|
@@ -124,13 +124,13 @@ ServiceStructureValidator.getStandardLevels();
|
|
|
124
124
|
// [{ level: 'v1.0', name: 'Base Service Standard', since: '2025-06-01' }, ...]
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
**Related:** [Service
|
|
127
|
+
**Related:** [Biz Service Canonical Shape — Implementation Standard Levels](/docs/biz/00-model/service-shape.md#implementation-standard-levels), [Error Handling Standard](/docs/standards/ERROR_HANDLING.md#business-service-error-standard)
|
|
128
128
|
|
|
129
129
|
## Related Documentation
|
|
130
130
|
|
|
131
131
|
- [SERVICE_REGISTRATION_FLOW.md](/services/hello-service/docs/SERVICE_REGISTRATION_FLOW.md)
|
|
132
132
|
- [/docs/architecture/validator.md](/docs/architecture/validator.md)
|
|
133
|
-
- [/docs/
|
|
133
|
+
- [/docs/biz/30-operations/schema-v3.md](/docs/biz/30-operations/schema-v3.md)
|
|
134
134
|
- [/docs/standards/ERROR_HANDLING.md](/docs/standards/ERROR_HANDLING.md)
|
|
135
135
|
- [@onlineapps/service-validator-core](/shared/service-validator-core/README.md)
|
|
136
136
|
|
package/docs/DESIGN.md
CHANGED
|
@@ -13,7 +13,7 @@ Validation framework for OA Drive microservices. Drives two flows:
|
|
|
13
13
|
of individual biz services.
|
|
14
14
|
|
|
15
15
|
The single source of truth for service endpoint metadata is
|
|
16
|
-
[`operations.json`](../../../docs/
|
|
16
|
+
[`operations.json`](../../../docs/biz/30-operations/registration-wire.md).
|
|
17
17
|
OpenAPI iteration (`paths`/`operationId`) is NOT supported — that legacy
|
|
18
18
|
surface was removed together with the now-retired `ServiceValidator` /
|
|
19
19
|
`TestOrchestrator` / `ServiceTestHarness` classes.
|
|
@@ -56,7 +56,7 @@ surface was removed together with the now-retired `ServiceValidator` /
|
|
|
56
56
|
wrapper startup. Proof is cached under `conn-runtime/validation-proof.json`
|
|
57
57
|
(30-day validity, invalidated by config fingerprint change — includes
|
|
58
58
|
operations map, see
|
|
59
|
-
[operations-registry-contract.md §3](../../../docs/
|
|
59
|
+
[operations-registry-contract.md §3](../../../docs/biz/30-operations/registration-wire.md)).
|
|
60
60
|
- Biz-service templates import `createPreValidationTests` /
|
|
61
61
|
`createServiceReadinessTests` from this package for their own test suites.
|
|
62
62
|
|
|
@@ -75,6 +75,6 @@ surface was removed together with the now-retired `ServiceValidator` /
|
|
|
75
75
|
|
|
76
76
|
## Related Documentation
|
|
77
77
|
|
|
78
|
-
- [operations-registry-contract.md](../../../docs/
|
|
79
|
-
- [
|
|
78
|
+
- [operations-registry-contract.md](../../../docs/biz/30-operations/registration-wire.md) — operations.json schema
|
|
79
|
+
- [test-runner-flow.md](../../../docs/biz/40-cookbooks/test-runner-flow.md) — required `example`/`default` fields for probes + full dispatch mechanics
|
|
80
80
|
- [validator.md](../../../docs/architecture/validator.md) — architecture overview
|
package/jest.config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
process.env.
|
|
4
|
-
process.env.
|
|
3
|
+
process.env.TESTING_TENANT_ID = process.env.TESTING_TENANT_ID || '99';
|
|
4
|
+
process.env.TESTING_WORKSPACE_ID = process.env.TESTING_WORKSPACE_ID || '200';
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
testEnvironment: 'node',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-validator",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Validation orchestrator for OA Drive microservices - coordinates validation across all layers (base, infra, orch, business)",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@ const { resolveHeaders } = require('./utils/resolveHeaders');
|
|
|
21
21
|
* matching the shape ServiceWrapper.ContextBuilder produces in production
|
|
22
22
|
* (see api/docs/architecture/biz-service-invocation-model.md §5). Handlers
|
|
23
23
|
* that need DB access import sequelize directly from their own
|
|
24
|
-
* src/config/database.js module (see
|
|
24
|
+
* src/config/database.js module (see biz/60-templates/onboarding-checklist.md §9a);
|
|
25
25
|
* connector slots stay null and the handler surfaces its own failure if
|
|
26
26
|
* something it genuinely needs is missing.
|
|
27
27
|
*
|
|
@@ -185,10 +185,14 @@ class CookbookTestRunner {
|
|
|
185
185
|
// { modulePath, exportName } (v3 handler dispatch is the only mode).
|
|
186
186
|
const spec = await this.resolveOperation(step.service, step.operation);
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
// Env-var contract (docs/biz/40-cookbooks/test-env-vars.md +
|
|
189
|
+
// docs/biz/60-templates/env-conventions.md): TESTING_* prefix marks
|
|
190
|
+
// values that legitimately ship to production because Tier-1 cookbook
|
|
191
|
+
// runner fires at every service startup, including in prod.
|
|
192
|
+
const rawTenantId = process.env.TESTING_TENANT_ID;
|
|
193
|
+
const rawWorkspaceId = process.env.TESTING_WORKSPACE_ID;
|
|
190
194
|
if (!rawTenantId || !rawWorkspaceId) {
|
|
191
|
-
throw new Error('[CookbookTestRunner] Missing required environment variables
|
|
195
|
+
throw new Error('[CookbookTestRunner] Missing required environment variables TESTING_TENANT_ID and/or TESTING_WORKSPACE_ID');
|
|
192
196
|
}
|
|
193
197
|
// Coerce numeric env vars to integers so ctx matches production
|
|
194
198
|
// ContextBuilder (which receives already-typed values from the MQ envelope).
|
|
@@ -225,7 +229,7 @@ class CookbookTestRunner {
|
|
|
225
229
|
* handler(input, ctx). Mirrors the production ContextBuilder shape
|
|
226
230
|
* (see api/docs/architecture/biz-service-invocation-model.md §5) with
|
|
227
231
|
* all connector slots set to null — handlers that need DB access use
|
|
228
|
-
* direct sequelize import per
|
|
232
|
+
* direct sequelize import per biz/60-templates/onboarding-checklist.md §9a.
|
|
229
233
|
*/
|
|
230
234
|
async _dispatchViaHandler({ step, spec, testConfig, validationTenantId, validationWorkspaceId, result, startTime }) {
|
|
231
235
|
const stepTimeout = testConfig.timeout || this.timeout;
|
|
@@ -12,7 +12,7 @@ const CookbookTestUtils = require('./CookbookTestUtils');
|
|
|
12
12
|
* adopted in-process handler invocation.
|
|
13
13
|
*
|
|
14
14
|
* @see /api/docs/architecture/biz-service-invocation-model.md §5.3
|
|
15
|
-
* @see /api/docs/
|
|
15
|
+
* @see /api/docs/biz/40-cookbooks/test-runner-flow.md (input probe contract)
|
|
16
16
|
*/
|
|
17
17
|
class ServiceReadinessValidator {
|
|
18
18
|
constructor(options = {}) {
|
package/src/helpers/README.md
CHANGED
|
@@ -146,7 +146,7 @@ If validation fails, clear error messages are shown:
|
|
|
146
146
|
✗ Service configuration missing: conn-config/config.json
|
|
147
147
|
Type: MISSING_CONFIG
|
|
148
148
|
File: conn-config/config.json
|
|
149
|
-
Fix: Create config.json with service metadata. See: /docs/
|
|
149
|
+
Fix: Create config.json with service metadata. See: /docs/biz/60-templates/service-template.md
|
|
150
150
|
|
|
151
151
|
⚠️ WARNINGS (1):
|
|
152
152
|
|
package/src/index.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Production entry point: {@link ValidationOrchestrator} (6-step pre-validation
|
|
8
8
|
* driven by operations.json — OpenAPI path iteration is NOT supported).
|
|
9
9
|
*
|
|
10
|
-
* @see /api/docs/
|
|
11
|
-
* @see /api/docs/
|
|
10
|
+
* @see /api/docs/biz/30-operations/registration-wire.md §3 (operations.json)
|
|
11
|
+
* @see /api/docs/biz/40-cookbooks/test-runner-flow.md (validation probes)
|
|
12
12
|
* @see /api/docs/architecture/validator.md (validator architecture)
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -223,7 +223,7 @@ class ServiceStructureValidator {
|
|
|
223
223
|
level: nextLevel.level,
|
|
224
224
|
check: check.id,
|
|
225
225
|
message: `Standard ${nextLevel.level} (${nextLevel.name}): missing ${check.message}`,
|
|
226
|
-
fix: `Implement ${check.message} to reach standard ${nextLevel.level}. See docs/
|
|
226
|
+
fix: `Implement ${check.message} to reach standard ${nextLevel.level}. See docs/biz/60-templates/service-template.md`
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -305,7 +305,7 @@ class ServiceStructureValidator {
|
|
|
305
305
|
type: 'MISSING_CONFIG',
|
|
306
306
|
path: 'config/service/config.json (or conn-config/config.json)',
|
|
307
307
|
message: 'Service configuration missing: config/service/config.json (or conn-config/config.json)',
|
|
308
|
-
fix: 'Create config.json with service metadata. See: /docs/
|
|
308
|
+
fix: 'Create config.json with service metadata. See: /docs/biz/60-templates/service-template.md'
|
|
309
309
|
});
|
|
310
310
|
} else {
|
|
311
311
|
try {
|
|
@@ -328,7 +328,7 @@ class ServiceStructureValidator {
|
|
|
328
328
|
type: 'MISSING_OPERATIONS',
|
|
329
329
|
path: 'config/service/operations.json (or conn-config/operations.json)',
|
|
330
330
|
message: 'Operations specification missing: config/service/operations.json (or conn-config/operations.json)',
|
|
331
|
-
fix: 'Create operations.json. See: /docs/
|
|
331
|
+
fix: 'Create operations.json. See: /docs/biz/30-operations/schema-v3.md'
|
|
332
332
|
});
|
|
333
333
|
} else {
|
|
334
334
|
try {
|
|
@@ -603,7 +603,7 @@ class ServiceStructureValidator {
|
|
|
603
603
|
type: 'MISSING_APP',
|
|
604
604
|
path: 'src/app.js',
|
|
605
605
|
message: 'Express application missing: src/app.js',
|
|
606
|
-
fix: 'Create src/app.js with Express app. See: /docs/
|
|
606
|
+
fix: 'Create src/app.js with Express app. See: /docs/biz/60-templates/service-template.md'
|
|
607
607
|
});
|
|
608
608
|
} else {
|
|
609
609
|
this.info.push('✓ Found src/app.js');
|