The deployment log follow dropped lines. Logs become searchable out of
timestamp order (the logs background-jobs service batches its bulk
writes every 2 s and the deployment-logs index has two shards that
refresh on their own), and a deployment turns LIVE before its last
lines are indexed. The CLI asked only for logs after its newest
printed line minus 1 ms and stopped reading at the first empty fetch
after a terminal status, so an older line indexed late was never
asked for again. Seen as "Edge functions deployed successfully." and
"Build and hosting completed." missing before "Site is live".
- LogTail asks from 10 s (DEPLOYMENT_LOG_LOOKBACK_MS) before the
newest line and skips lines already printed, matched on timestamp,
stage and message with a repeat count.
- After a terminal status the watcher makes logSettleMs / pollDelayMs
more reads (10 s / 2 s = 5), a failed one followed by the next. It
settles only when the watch saw the deployment in flight or its
updatedAt is within the window, so logs:get on an old deployment
returns at once; waitUntilLive passes logSettleMs: 0.
- Integration timing stubs pass logSettleMs: 0; a new integration test
replays the reported sequence over the wire.
AGENTS.md follows. The .talismanrc checksums for AGENTS.md and the
edited test files (watcher, deployments:create, and the logs-get,
deployments-create, projects-create and environments-create
integration suites) are refreshed for these changes; they hold only
fixture ids and key/value fields, no secret.
Refs CL-8805.
#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
Fixes CL-8805: deployment logs skip lines that arrive late.
What
While the CLI follows a deployment, some log lines never print, though the web UI shows them. Most visible at the end of a deployment:
✓ Edge functions deployed successfully.and✓ Build and hosting completed.are missing before✓✓ Site is live.Cause: logs become searchable out of timestamp order (the logs background-jobs service batches bulk writes every 2 s, and the
deployment-logsindex has two shards that refresh independently), and a deployment turns LIVE before its last lines are indexed. The CLI asked only for logs after its newest printed line − 1 ms and stopped reading at the first empty fetch after a terminal status, so a late, older line was never asked for again.LogTailasks from 10 s (DEPLOYMENT_LOG_LOOKBACK_MS) before the newest printed line and skips lines it already printed, matched on timestamp, stage and message with a repeat count (identical lines in one millisecond still all print; nothing prints twice).logSettleMs / pollDelayMsmore reads (10 s / 2 s = 5), a failed read simply followed by the next. It settles only when the watch saw the deployment in flight or itsupdatedAtis within the window, sologs:geton a long-finished deployment returns at once.waitUntilLive(rollback) reads no logs and never waits.AGENTS.mddescribes the look-back and settle behaviour..talismanrc: checksums refreshed forAGENTS.mdand the edited test files (watcher,deployments:create, and thelogs-get,deployments-create,projects-create,environments-createintegration suites), as fix(deps): upgrade open to 11 and override papaparse to 5.7.1 to clear Snyk findings #289 did for its files. They flag only fake fixture ids andkey/valuefields; no secret.User-visible: a late line prints just after the line that overtook it, and create/follow commands return ~10 s later after the deployment ends.
Tests
deployment.log-tail.test.ts,deployment.watcher.test.ts,deployment.follower.test.ts): the reported sequence, the look-backsince, no reprint inside the window, late lines after LIVE, a retry after a failed settle read, no settle for a deployment that ended before the watch, settle for one that ended within the window,waitUntilLivenot waiting.deployments-create.test.ts): replays the reported sequence over the wire; with settling off, exactly the two reported lines go missing. Other integration timing stubs passlogSettleMs: 0to keep their scope.snyk test --fail-on=allpasses on top of fix(deps): upgrade open to 11 and override papaparse to 5.7.1 to clear Snyk findings #289.Note:
logs-getT47 (Ctrl-C) failed intermittently under full-suite load on this machine and passed in isolation (5/5) and in full integration runs. It counts real timers around a real 2 s sleep; this change touches only the logsincevalue on its path (settle is off there).Pending: live check on dev11 with an edge-functions project (CL-8805 acceptance criterion 6).
Follow-up, not in this PR:
contentfly-deployment-agentsendsBuild and hosting completed.after starting the go-live job; sending it first would make the UI more reliable too.#claude_code#
🤖 Generated with Claude Code