feat(sdk,cli): fill gaps for run items and metadata management#147
Merged
Conversation
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
tsconfig.base.json mapped @aignostics/sdk/test to packages/sdk/src/test-utils/index.ts, which never existed (the real file is http-mocks.ts). This has been broken since 77db132 but was masked by a stale nested packages/cli/node_modules/@aignostics/sdk copy with its own built dist. Now that the lockfile is clean, the alias fails to resolve, making cli.test.ts and vitest.setup.ts imports untyped and tripping @typescript-eslint/no-unsafe-* in CI.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #147 +/- ##
==========================================
+ Coverage 97.26% 97.71% +0.44%
==========================================
Files 14 14
Lines 1500 1794 +294
Branches 225 251 +26
==========================================
+ Hits 1459 1753 +294
Misses 41 41
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
tobi-ax
reviewed
Jul 23, 2026
| - name: Checkout code | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| fetch-depth: 0 |
Contributor
There was a problem hiding this comment.
Where do we need that for?
Collaborator
Author
There was a problem hiding this comment.
Sonarcloud scan action, I'll add a comment
The coverage-report job's checkout has always used the default shallow clone (fetch-depth: 1), so SonarQube cannot resolve the 'main' ref to diff against for PR analysis. This makes it unable to attribute uploaded lcov coverage to 'new code', reporting 0% new-code coverage and failing the Quality Gate, even though the same lcov.info reports correct coverage to Codecov in the step above. Set fetch-depth: 0 so Sonar has full history and branch refs available.
… lcov paths
actions/upload-artifact strips the least common ancestor ('packages')
when uploading packages/sdk/coverage/lcov.info and
packages/cli/coverage/lcov.info together, so the artifact actually
contains sdk/coverage/lcov.info and cli/coverage/lcov.info. Downloading
with path: . therefore restored the files at ./sdk/... and ./cli/...
instead of ./packages/sdk/... and ./packages/cli/.... Codecov's
uploader does its own broad file discovery so it found them anyway,
but SonarQube's sonar.javascript.lcov.reportPaths does an exact
lookup and reported 'No LCOV files were found'. Download into
packages/ instead so both tools see the paths they expect.
santi698
force-pushed
the
tssdk-63-fill-run-item-metadata-gaps
branch
from
July 23, 2026 12:53
a7df116 to
bb45b79
Compare
|
tobi-ax
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fills SDK/CLI gaps for run items and metadata management, per TSSDK-63.
Adds SDK methods and corresponding CLI commands:
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-metadataupdateRunItemMetadata(runId, externalId, customMetadata)runs items metadata set <runId> <externalId> <json>PUT /v1/runs/{run_id}/items/{external_id}/custom-metadatadeleteRunResults(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 topackages/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 reducednpm auditfindings 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— cleannpm run lint— cleannpm run build— cleanRefs: TSSDK-63