Skip to content

chore(info): Adding invocation_method and in-flight status_info#86

Merged
ashishkurmi merged 4 commits into
step-security:mainfrom
shubham-stepsecurity:sm/update
May 22, 2026
Merged

chore(info): Adding invocation_method and in-flight status_info#86
ashishkurmi merged 4 commits into
step-security:mainfrom
shubham-stepsecurity:sm/update

Conversation

@shubham-stepsecurity
Copy link
Copy Markdown
Member

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances enterprise telemetry reporting by adding (1) an invocation_method field to distinguish scheduled vs. manual runs and (2) in-flight status_info progress snapshots (phase completions + elapsed time) posted to the run-status endpoint and embedded in the final telemetry payload.

Changes:

  • Add invocation-method detection (install vs one_time) and include it in both run-status posts and the final telemetry payload.
  • Introduce phase tracking with periodic heartbeats and phase-boundary progress upserts via /telemetry/run-status.
  • Add scanner sub-progress hooks (Python/Node) to surface in-phase detail in status_info, plus new unit tests for tracker/hook/shutdown behavior.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/telemetry/telemetry.go Adds invocation detection, phase tracking, heartbeat progress posting, and payload stamping.
internal/telemetry/telemetry_test.go Updates uploadToS3 tests for new function signature.
internal/telemetry/run_status.go Adds runStatusBody, invocation_method, progress posting (status_info), and heartbeat interval constants.
internal/telemetry/run_status_test.go Updates existing tests for new signature and adds new tests for invocation/progress behavior.
internal/telemetry/progress_hook_test.go New test validating ProgressHook → tracker detail propagation.
internal/telemetry/phase_tracker.go New PhaseTracker + RunStatusInfo model for progress snapshots.
internal/telemetry/phase_tracker_test.go New unit tests covering tracker behavior, copying, and concurrency safety.
internal/telemetry/invocation.go New invocation-method detection logic across darwin/linux/windows.
internal/telemetry/invocation_test.go New tests for invocation detection and fileExists helper.
internal/telemetry/heartbeat_shutdown_test.go New regression test for correct cancel-then-wait heartbeat shutdown pattern.
internal/systemd/systemd.go Exposes TimerUnitPath for invocation detection.
internal/schtasks/schtasks.go Adds IsTaskRegistered for Windows invocation detection.
internal/launchd/launchd.go Exposes launchd plist paths for invocation detection and hardens home-dir resolution.
internal/detector/pythonscan.go Adds ProgressHook to emit sub-progress from Python global package scanning.
internal/detector/nodescan.go Adds ProgressHook to emit sub-progress during Node global/project scans.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/telemetry/invocation_test.go Outdated
Comment thread internal/telemetry/telemetry.go
@ashishkurmi ashishkurmi merged commit 567a4a3 into step-security:main May 22, 2026
11 checks passed
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