Skip to content

SP-45: Add asset-registry validate command#342

Merged
Zgjim Haziri (ZgjimHaziri) merged 3 commits intomainfrom
SP-45-add-asset-registry-validate-command
Apr 27, 2026
Merged

SP-45: Add asset-registry validate command#342
Zgjim Haziri (ZgjimHaziri) merged 3 commits intomainfrom
SP-45-add-asset-registry-validate-command

Conversation

@ZgjimHaziri
Copy link
Copy Markdown
Contributor

@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) commented Apr 17, 2026

Summary

Add asset-registry validate command with three mutually exclusive modes for validating asset configurations:

  • --configuration/-c with --packageKey: validate a configuration JSON before import (CLI builds the ValidateRequest envelope)
  • --nodeKey with --packageKey: validate an already-stored node on the platform
  • -f: provide a file with the full ValidateRequest body (standalone alternative to all other options)

Proxies to Pacman's POST /core/asset-registry/validate/{assetType} endpoint.

Ticket: SP-45
Depends on: #341

Test plan

  • 18 unit tests covering all three modes, mutual exclusivity errors, JSON parse errors, and missing required options
  • All 36 asset-registry tests pass locally
  • content-cli asset-registry validate --help output verified

@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) requested a review from a team as a code owner April 17, 2026 13:31
@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) force-pushed the SP-45-add-asset-registry-validate-command branch from 2f8aaaf to 8378d01 Compare April 17, 2026 13:34
Base automatically changed from SP-39-add-asset-registry-proxy-commands to main April 17, 2026 13:35
Three mutually exclusive modes:
- --configuration/-c: validate a configuration JSON before import
- --nodeKey: validate an already-stored node on the platform
- -f: provide a full ValidateRequest file (multi-node/advanced)

The CLI assembles the ValidateRequest envelope in the first two modes.
Update SKILL.md, agentic guide, and command docs.

Includes-AI-Code: true
Made-with: Cursor
@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) force-pushed the SP-45-add-asset-registry-validate-command branch from 8378d01 to a90cb3e Compare April 17, 2026 14:39
Comment thread docs/user-guide/asset-registry-commands.md Outdated
Comment thread docs/user-guide/asset-registry-commands.md Outdated
The "save as JSON file" test asserted exact equality of the third
argument to fs.writeFileSync ({ encoding: "utf-8" }). On the GitHub
Actions runner, the per-file `jest.mock("fs", () => ...requireActual)`
factory in this spec interacts with jest.setup's mock such that the
captured args also include `mode: 384` (= 0o600), even though the
production code only passes `{ encoding: "utf-8" }`. The same call
captures only `encoding` locally on macOS.

Use `expect.objectContaining({ encoding: "utf-8" })` so the test
verifies the field we actually care about and is resilient to
runtime-injected options. Also restored the trailing newline on
asset-registry.service.ts.

Includes-AI-Code: true
Made-with: Cursor
@sonarqubecloud
Copy link
Copy Markdown

@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) merged commit 671daa9 into main Apr 27, 2026
6 checks passed
@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) deleted the SP-45-add-asset-registry-validate-command branch April 27, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants