Skip to content

SP-1173: extend CUI marking to every --json command - #407

Open
Dennis Woditsch (dwoditsch) wants to merge 4 commits into
feat/SP-1173-cui-marking-datafrom
feat/SP-1173-cui-marking-json-commands
Open

SP-1173: extend CUI marking to every --json command#407
Dennis Woditsch (dwoditsch) wants to merge 4 commits into
feat/SP-1173-cui-marking-datafrom
feat/SP-1173-cui-marking-json-commands

Conversation

@dwoditsch

@dwoditschDennis Woditsch (dwoditsch) commented Aug 10, 2026

Copy link
Copy Markdown

Description

Stacked on #405, which added the marking mechanism and the first two commands. This PR finishes the --json row: every remaining --json listing and report is now marked.

Scope: how the write is triggered

TriggerCommandsCUI marking
--json listings and reportslist spaces, list packagesDone in #405, together with the marking mechanism
--json listings and reportslist assets/assignments/data-pools, config *, t2tc package list/diff, deployment *, asset-registry *This PR
-o, --outputToJsonFile reportsanalyze/import action-flows, export data-pool, import data-pools, t2tc package import reportTo follow in #410
artifact is already an archiveconfig package export --zip, config branch export --zip, t2tc package export, export action-flows, pull packageTo follow in #411
single non-archive exportpull asset/skill/data-pool/view-bookmarks/bookmarks, export bookmarksTo follow in #412
output is a directoryconfig package export, config branch export, t2tc package export --unzipTo follow in #413: cover sheet into the directory, prefix the directory name
--gitBranch variantsconfig package export, config branch export, t2tc package exportOut of scope, nothing reaches local disk
no output flagconsole-only listings, profile/git-profile/log filesOut of scope

Both open questions from #405 are unaffected: how to mark an artifact that is already a zip, and what to do for directory output.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

Note

Medium Risk
Wide but mechanical refactor across many commands; behavior change when CUI applies (JSON becomes a classified zip) could surprise automation that expected .json filenames, though unclassified/no-cover paths stay the same.

Overview
Completes CUI marking for every CLI path that writes --json listings and reports (building on the earlier marking mechanism). fileService.writeToFileWithGivenName is replaced with CuiFileService.writeToFileWithGivenName across config management, deployment, asset-registry, studio assets, t2tc, and data-pool list/export flows so classified tenants get a cover sheet and a CUI - …zip artifact instead of a bare .json.

Each affected service now constructs CuiFileService from context, awaits the async write helpers, and logs the actual filename returned (which may differ when marking applies). Console-only output is unchanged.

Tests: new cui-marking-json-commands.spec.ts exercises representative commands end-to-end (classified zip prefix, PDF cover, JSON payload inside the archive). list-assignments.spec.ts switches to shared mockAxiosGet helpers.

Out of scope here:-o/--outputToJsonFile reports, zip/directory exports, and data-pool batch import/export file writes still use plain fileService (follow-up PRs).

Reviewed by Cursor Bugbot for commit e80318d. Bugbot is set up for automated code reviews on this repo. Configure here.

Sixteen write sites whose enclosing method is already async and awaited
to the Commander action, so this is call-site substitution only: no
signature changes. Each now logs the returned filename, since marking
renames the file to "CUI - <name>.zip".
Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
Ten private write helpers were synchronous, so they could not await the
CUI cover probe. Each becomes async and every caller awaits it.
list-assignments used a blanket axios mock that shadowed the shared
cover-endpoint default and left the probe without a status; it now goes
through mockAxiosGet like the other specs.
Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
Both were private static, so they could not reach an instance field to
get at the CuiFileService. Nine call sites move from the static form to
await this.writeJson(...).
Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
One classified-outcome test per family, asserting the command produces
"CUI - <name>.zip" with the cover sheet inside and logs that name. The
marking logic itself stays covered by the CuiFileService unit tests.
Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
@dwoditsch
Dennis Woditsch (dwoditsch)force-pushed the feat/SP-1173-cui-marking-json-commands branch from aa47776 to e80318dCompareAugust 10, 2026 12:14
@sonarqubecloud

Copy link
Copy Markdown

fileService.writeToFileWithGivenName(JSON.stringify(packageVersionTransport, null, 2), filename);
logger.info(FileService.fileDownloadedMessage + filename);
const writtenFilename = await this.cuiFileService.writeToFileWithGivenName(JSON.stringify(packageVersionTransport, null, 2), filename);
logger.info(FileService.fileDownloadedMessage + writtenFilename);

@alex-probstAlexander Probst (alex-probst)Aug 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to extract fileDownloadedMessage? CuiFileService is used now as a replacement but for logging we still rely on FileService, which does basically nothing. This question also applies for the other parts.

Another possibility: duplicate fileDownloadedMessage and use it in CuiFileService

Sign up for freeto 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.

3 participants

@dwoditsch@nikolai-celonis@alex-probst