Skip to content

feat(logs): add launch:logs:get for deployment, server and live logs - #269

Merged
SakshiKoli-CS merged 11 commits into
v2-devfrom
CL-7171
Oct 30, 2026
Merged

SakshiKoli-CS merged 11 commits into
v2-devfrom
CL-7171

Conversation

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor

🤖 Opened by the Launch dev agent (Claude), on behalf of Sakshi Koli.

Jira: https://contentstack.atlassian.net/browse/CL-7171

Builds on CL-7170 (#256, merged); v2-dev is merged in.

What

csdx launch:logs:get for a deployment's logs:

  • --type deployment (default): follows an in-flight deployment or prints a finished one. The watcher now drains the log tail on the terminal poll, so more than 5000 lines are no longer cut off.
  • --type server --since/--until: windowed server logs (relative or ISO, never mixed), 24 h retention notice, 5000-line cap notice.
  • --type live: SSE stream (new src/transport/event-stream.ts: idle timeout, reconnect with backoff, ends when the server ends the session). Ctrl-C exits 3 for any follow. REST and SSE clients share one header builder.
  • No flags: prompts for org, project, environment on a terminal (never for --deployment/--type); in CI exits 2 naming the missing flag.

Decisions

--type is its own flag (the catalog type key is the project type). --deployment is verified first, else the latest is used. The watcher keeps v2-dev's single stop mechanism plus an abortable sleep and the drain.

Tests

QA Planner plan T1–T94 on the ticket plus no-flag cases. Whole suite: 3418 of 3420 pass; the 2 failures are src/uploads/upload.archive.test.ts chmod cases that cannot fail as root (file untouched, same as v2-dev). tsc, eslint, Snyk (4 unfixable existing findings) and TruffleHog clean.

Known gaps

  • dev11 verification items, not run here: logs-service base path, x-cs-api-version, real SSE (14 s timeout, 5 s heartbeat, 5-min cap), harness cases.
  • v2-dev's watcher no longer prints a notice when a log read fails, so a failed read shows as "No deployment logs found" plus the status line. Worth a look by CL-7170's owner.
  • --search, --limit and paging wait for CL-7180.

QA: the Launch QA agent tests CL-7171 in the repos once it is in QA; GoCD sanity covers dev11.


Generated by Claude Code

claude added 11 commits October 28, 2026 11:05
… inputs

Add parseLogWindow (relative or ISO 8601 pair, defaults, 24 h clamp info)
and the log-type, since and until inputs with the server-only rules.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
…terminal poll

onInterrupt is the shared Ctrl-C listener that stays attached until the
signal reached every listener. The watcher now drains the logs (bounded
by MAX_PAGES) on the terminal poll and ends at once on an aborted stop
signal, with a cancellable default sleep.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
Reads a deployment's build logs (following an in-flight one, Ctrl-C
exits 3) or its server logs for a --since/--until window. --type live
is refused as not available yet.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
Refresh the stale checksums of AGENTS.md, deployment.watcher.test.ts
and projects-create.test.ts after the G2 edits.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
Streams a deployment's server logs from the logs-service live route
through a new idle-timeout SSE client, with reconnect and backoff, the
server-limit end line, and Ctrl-C exiting 3. The REST and SSE clients
now share one request-header builder.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Refreshed the checksums of the files G4 changed that already had an
entry (rest-client, service-context, logs-get tests); Talisman flagged
only prose and fixtures already on the branch, no credentials.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Each connection now has its own AbortController linked to the Ctrl-C
signal. The session-ended frame aborts it, later frames are ignored and
the abort counts as a clean end, so heartbeats can no longer keep the
command waiting. The link to the stop signal is removed after every
connection.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
The live session-end test changed the file; Talisman flagged only
fixtures and prose already allowlisted, no credentials.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Brings CL-7170 (merged in #256) into this branch. The deployment
watcher keeps one stop mechanism (v2-dev's, plus the abortable sleep and
the terminal drain). The logs tests follow v2-dev's silent failed log
read, and logs.presenter owns its scope hint now that the deployments
presenter dropped it.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Pin that logs:get with no flags prompts organisation, project and
environment on a terminal (never --deployment or --type), and refuses
with exit 2 naming the first missing flag when there is no terminal.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Refreshed the checksums of the changed files that already had an entry;
Talisman flagged only fixtures and prose, no credentials.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners October 30, 2026 06:38
@snyk-io

snyk-io Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 6 9 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 9
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@SakshiKoli-CS
SakshiKoli-CS merged commit 07eda4f into v2-dev Oct 30, 2026
7 checks passed
@SakshiKoli-CS
SakshiKoli-CS deleted the CL-7171 branch October 30, 2026 09:24
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.

3 participants