Skip to content

feat(sdk,cli): fill gaps for run items and metadata management#147

Open
santi698 wants to merge 1 commit into
mainfrom
tssdk-63-fill-run-item-metadata-gaps
Open

feat(sdk,cli): fill gaps for run items and metadata management#147
santi698 wants to merge 1 commit into
mainfrom
tssdk-63-fill-run-item-metadata-gaps

Conversation

@santi698

Copy link
Copy Markdown
Collaborator

Summary

Fills SDK/CLI gaps for run items and metadata management, per TSSDK-63.

Adds SDK methods and corresponding CLI commands:

SDK method CLI command API endpoint
getRunItem(runId, externalId) runs items get <runId> <externalId> GET /v1/runs/{run_id}/items/{external_id}
updateRunMetadata(runId, customMetadata) runs metadata set <runId> <json> PUT /v1/runs/{run_id}/custom-metadata
updateRunItemMetadata(runId, externalId, customMetadata) runs items metadata set <runId> <externalId> <json> PUT /v1/runs/{run_id}/items/{external_id}/custom-metadata
deleteRunResults(runId) runs results delete <runId> DELETE /v1/runs/{run_id}/artifacts

--items-style JSON parsing for the metadata commands supports "null" to explicitly clear existing custom metadata.

Side fix

Found and fixed a stale nested packages/cli/node_modules/@aignostics/sdk@3.6.1 (a real directory, not a symlink) that shadowed the workspace symlink to packages/sdk. It silently broke CLI tests exercising new SDK methods (sdk.updateRunMetadata is not a function) even though the SDK source/dist had them. A full clean reinstall (rm -rf node_modules packages/*/node_modules package-lock.json && npm install) regenerated a correct lockfile — this also reduced npm audit findings on this branch from 7 to 1 (low severity).

Testing

  • npm run test (both packages) — 251 tests passing (55 SDK + 196 CLI)
  • npm run typecheck — clean
  • npm run lint — clean
  • npm run build — clean

Refs: TSSDK-63

Adds SDK methods and corresponding CLI commands:

- PlatformSDKHttp.getRunItem() -> `runs items get <runId> <externalId>`
- PlatformSDKHttp.updateRunMetadata() -> `runs metadata set <runId> <json>`
- PlatformSDKHttp.updateRunItemMetadata() -> `runs items metadata set <runId> <externalId> <json>`
- PlatformSDKHttp.deleteRunResults() -> `runs results delete <runId>`

Maps to GET /v1/runs/{run_id}/items/{external_id}, PUT /v1/runs/{run_id}/custom-metadata,
PUT /v1/runs/{run_id}/items/{external_id}/custom-metadata, DELETE /v1/runs/{run_id}/artifacts.

Also fixes a stale nested packages/cli/node_modules/@aignostics/sdk (pinned to
an old published version) that shadowed the workspace symlink and silently
broke CLI tests against new SDK methods. Full clean reinstall regenerates a
correct package-lock.json.

Refs TSSDK-63
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant