Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/command-graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
options: ["-p, --profile <profile>", "--overwrite", "--validate (default: false)", "--gitProfile <gitProfile>", "--gitBranch <gitBranch>", "-f, --file <file>", "-d, --directory <directory>", "-h, --help"] },
{ id: "config_validate", label: "validate", group: "command", path: "config validate",
description: "[Deprecated] Use 'config package validate' instead. Validate package node configurations.",
options: ["-p, --profile <profile>", "--packageKey <packageKey>", "--layers <layers...> (SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES; default: [\"SCHEMA\"])", "--nodeKeys <nodeKeys...> (default: all nodes)", "--json", "-h, --help"] },
options: ["-p, --profile <profile>", "--packageKey <packageKey>", "--layers <layers...> (SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES; default: every layer available for the team)", "--nodeKeys <nodeKeys...> (default: all nodes)", "--json", "-h, --help"] },
{ id: "config_diff", label: "diff", group: "command", path: "config diff",
description: "[Deprecated] Use 't2tc package diff' instead. Diff a local Team-to-Team Copy archive against deployed or staging packages.",
options: ["-p, --profile <profile>", "--hasChanges", "--baseVersion <version> (Compare against a given version or STAGING)", "--json", "-f, --file <file>", "-h, --help"] },
Expand All @@ -308,7 +308,7 @@
options: ["-p, --profile <profile>", "--packageKey <packageKey>", "--zip (default: false)", "--gitProfile <gitProfile>", "--gitBranch <gitBranch>", "-h, --help"] },
{ id: "config_package_validate", label: "validate", group: "command", path: "config package validate",
description: "Validate package node configurations",
options: ["-p, --profile <profile>", "--packageKey <packageKey>", "--layers <layers...> (SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES; default: [\"SCHEMA\"])", "--nodeKeys <nodeKeys...> (default: all nodes)", "--json", "-h, --help"] },
options: ["-p, --profile <profile>", "--packageKey <packageKey>", "--layers <layers...> (SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES; default: every layer available for the team)", "--nodeKeys <nodeKeys...> (default: all nodes)", "--json", "-h, --help"] },
{ id: "config_package_list", label: "list", group: "command", path: "config package list",
description: "List packages in the target team. Lists staging packages by default.",
options: ["-p, --profile <profile>", "--json", "--flavors <flavors...>", "-h, --help"] },
Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/config-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ info: ERROR my-knowledge-model (SEMANTIC_MODEL) - $.requiredField: is mis

### Validation Layers

The `--layers` option selects which validation layers to run. Multiple layers can be passed and are executed in a single request; their findings are merged into one report.
The `--layers` option selects which validation layers to run. Multiple layers can be passed and are executed in a single request; their findings are merged into one report. Omit `--layers` to run every layer available for the team, which is what the Studio problems panel reports; pass an explicit list only to narrow the run.

| Layer | What it checks | Owner |
|---|---|---|
Expand All @@ -281,12 +281,12 @@ The `--layers` option selects which validation layers to run. Multiple layers ca
| `PIG_SEMANTICS` | Semantic-model validation delegated to the Process Intelligence Graph semantic-layer runtime (PIG-SL), surfacing the `list-problems` findings the live service reports for Knowledge Models. | Semantic layer (`cloud-semantic-layer`) |
| `DATA_PIPELINES` | Validation delegated to the data-pipeline platform service for the package's data-integration assets. | Data pipeline service |

`SCHEMA`, `BUSINESS`, `PACKAGE_SETTINGS`, `PIG_SEMANTICS`, and `DATA_PIPELINES` are the layers accepted by the Pacman API. Other values are rejected with a `400 layers.unsupported` error.
`SCHEMA`, `BUSINESS`, `PACKAGE_SETTINGS`, `PIG_SEMANTICS`, and `DATA_PIPELINES` are the layers accepted by the Pacman API. Other values are rejected with a `400 layers.unsupported` error, and so is an empty `--layers`.

To run all layers:
To run all layers, omit the option:

```bash
content-cli config package validate --packageKey <packageKey> --layers SCHEMA BUSINESS PACKAGE_SETTINGS PIG_SEMANTICS DATA_PIPELINES
content-cli config package validate --packageKey <packageKey>
```

Use `PACKAGE_SETTINGS` when you need to verify that the package's own settings are usable in the destination team before continuing authoring or import work. It reports issues such as missing dependency versions, duplicate dependency or variable keys, blank variable keys/types, missing Studio data model assignments, and OCDM package-settings problems when the corresponding backend validation is enabled.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface PackageValidationRequest {
layers: string[];
layers?: string[];
nodeKeys?: string[];
}

Expand Down
6 changes: 2 additions & 4 deletions src/commands/configuration-management/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ class Module extends IModule {
.requiredOption("--packageKey <packageKey>", "Key of the package to validate")
.option(
"--layers <layers...>",
"Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS PACKAGE_SETTINGS PIG_SEMANTICS DATA_PIPELINES). Defaults to SCHEMA.",
["SCHEMA"]
"Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS). Omit to run every layer available for the team."
)
.option("--nodeKeys <nodeKeys...>", "Specific node keys to validate (default: all nodes)")
.option("--json", "Return the response as a JSON file")
Expand All @@ -196,8 +195,7 @@ class Module extends IModule {
.requiredOption("--packageKey <packageKey>", "Key of the package to validate")
.option(
"--layers <layers...>",
"Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS PACKAGE_SETTINGS PIG_SEMANTICS DATA_PIPELINES). Defaults to SCHEMA.",
["SCHEMA"]
"Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS). Omit to run every layer available for the team."
)
.option("--nodeKeys <nodeKeys...>", "Specific node keys to validate (default: all nodes)")
.option("--json", "Return the response as a JSON file")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export class PackageValidationService {
}

public async validatePackage(packageKey: string, layers: string[], nodeKeys: string[], jsonOutput: boolean): Promise<void> {
const request: PackageValidationRequest = { layers };
const request: PackageValidationRequest = {};
// Omitted rather than defaulted here: the API reads an absent "layers" as every layer available for
// the team, and rejects an empty list.
if (layers && layers.length > 0) {
request.layers = layers;
}
if (nodeKeys && nodeKeys.length > 0) {
request.nodeKeys = nodeKeys;
}
Expand Down
30 changes: 30 additions & 0 deletions tests/commands/configuration-management/config-validate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ describe("Config validate", () => {
expect(mockedPostRequestBodyByUrl.get(VALIDATE_URL)).toEqual(JSON.stringify({ layers: ["SCHEMA"] }));
})

it("Should omit layers from the request body when the option is not passed", async () => {
const response: SchemaValidationResponse = {
packageKey: "my-package",
valid: true,
summary: { errors: 0, warnings: 0, info: 0 },
results: []
};

mockAxiosPost(VALIDATE_URL, response);

await new PackageValidationService(testContext).validatePackage("my-package", undefined, null, false);

expect(mockedPostRequestBodyByUrl.get(VALIDATE_URL)).toEqual(JSON.stringify({}));
})

it("Should omit an empty layers list rather than send one the API rejects", async () => {
const response: SchemaValidationResponse = {
packageKey: "my-package",
valid: true,
summary: { errors: 0, warnings: 0, info: 0 },
results: []
};

mockAxiosPost(VALIDATE_URL, response);

await new PackageValidationService(testContext).validatePackage("my-package", [], ["node-1"], false);

expect(mockedPostRequestBodyByUrl.get(VALIDATE_URL)).toEqual(JSON.stringify({ nodeKeys: ["node-1"] }));
})

it("Should include nodeKeys in request body when specified", async () => {
const response: SchemaValidationResponse = {
packageKey: "my-package",
Expand Down
Loading