Skip to content

Add --json flag to 'tps pulse status' command.#216

Merged
tps-flint merged 1 commit intomainfrom
task/91bae7b3-0211-4d51-9dbe-382b856819e8
Mar 10, 2026
Merged

Add --json flag to 'tps pulse status' command.#216
tps-flint merged 1 commit intomainfrom
task/91bae7b3-0211-4d51-9dbe-382b856819e8

Conversation

@tps-ember
Copy link
Copy Markdown
Contributor

Add --json flag to 'tps pulse status' command.

Files to modify (3 files, ~30 lines total):

  1. packages/cli/src/commands/pulse.ts

    • Add 'json?: boolean' to PulseArgs interface (~line 570)
    • In printStatus() (~line 534), add parameter 'args: Pick<PulseArgs, "json"> = {}' and state param
    • After the 'active' filter, add: if (args.json) { console.log(JSON.stringify({ lastPollAt: state.lastPollAt, activeCount: active.length, active })); return; }
    • In runPulse() 'status' case (~line 592), pass { json: args.json } to printStatus()
    • Export printStatus so it's testable
  2. packages/cli/bin/tps.ts

    • In the pulse command handler (~line 1005), add: json: Boolean(cli.flags.json)
  3. packages/cli/test/pulse.test.ts

    • Import printStatus
    • Add test: create a state with one PR instance, call printStatus({ json: true }, state), capture console.log, verify JSON.parse works and has lastPollAt + activeCount + active array

Write code immediately. Do not explore beyond these three files.

Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

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

LGTM. The changes add a JSON output option to the 'pulse status' command. The implementation is safe, using on non-sensitive data. No security risks identified.

@tps-flint tps-flint merged commit a54e360 into main Mar 10, 2026
11 checks passed
@tps-flint tps-flint deleted the task/91bae7b3-0211-4d51-9dbe-382b856819e8 branch March 10, 2026 04:14
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

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

Approved. The addition of a output option to the 'pulse status' command is safe and introduces no security risks. The implementation uses on non-sensitive data and has no discernible attack surface.

Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

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

Approved. The addition of a output option to the 'pulse status' command is safe. The implementation uses on non-sensitive, internally-managed data and has no discernible attack surface.

Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

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

Approved. The addition of a --json output option to the pulse status command is safe. It introduces no security risks as it uses JSON.stringify on non-sensitive, internally-managed data and has no discernible attack surface.

Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

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

Approved. The addition of a output option to the command is safe. It introduces no security risks as it uses on non-sensitive, internally-managed data and has no discernible attack surface.

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