Skip to content

refactor: improve log output in cleanup functions - #663

Open
rohan-stepsecurity wants to merge 19 commits into
step-security:mainfrom
rohan-stepsecurity:main
Open

refactor: improve log output in cleanup functions#663
rohan-stepsecurity wants to merge 19 commits into
step-security:mainfrom
rohan-stepsecurity:main

Conversation

@rohan-stepsecurity

Copy link
Copy Markdown
Member
  • Grouped Logs: Agent, daemon, and service logs are now enclosed within core.startGroup() and core.endGroup() calls. This provides better organization and readability in the GitHub Actions logs.
  • Error Output: In the handleLinuxCleanup function, any stdout from an error during journalctl execution is now also logged, providing more context for debugging.

rohan-stepsecurity and others added 19 commits May 12, 2026 01:10
- **Grouped Logs:** Agent, daemon, and service logs are now enclosed
  within `core.startGroup()` and `core.endGroup()` calls. This provides
  better organization and readability in the GitHub Actions logs.
- **Error Output:** In the `handleLinuxCleanup` function, any `stdout`
  from an error during `journalctl` execution is now also logged,
  providing more context for debugging.
…ctions

- Replace @actions/http-client socketTimeout with fetch + AbortSignal.timeout(3s)
  on monitor, tls-inspect, policy fetch, policy-store fetch, and addSummary,
  so DNS + TCP connect + TLS are bounded (was unbounded, causing ~2-4 min hangs)
- Add unhandledRejection guard in setup.ts and cleanup.ts so Node 22+ does not
  silently kill the step on background async errors from third-party deps
- Skip Windows post-step cleanup when agent dir is missing (Pre-step crashed
  before install), instead of throwing ENOENT on post_event.json
- Bump @types/node to ^24, typescript to ^5, ts-jest to ^29.4 to match node24
  runtime and enable AbortSignal.timeout typings
handleLinuxCleanup and handleMacosCleanup also did an unconditional writeFileSync
to a path inside the agent dir, throwing ENOENT when Pre-step crashed before
installing the agent (proven by integration test on synthetic-reject branch).
Mirror the same dir-existence check that handleWindowsCleanup already has.
- **Grouped Logs:** Agent, daemon, and service logs are now enclosed
  within `core.startGroup()` and `core.endGroup()` calls. This provides
  better organization and readability in the GitHub Actions logs.
- **Error Output:** In the `handleLinuxCleanup` function, any `stdout`
  from an error during `journalctl` execution is now also logged,
  providing more context for debugging.
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.

2 participants