Skip to content

feat: update color usage, telemetry activation logic, and command/util dependencies#3646

Merged
eablack merged 12 commits intomainfrom
eb/update-cli-util-and-command
Apr 6, 2026
Merged

feat: update color usage, telemetry activation logic, and command/util dependencies#3646
eablack merged 12 commits intomainfrom
eb/update-cli-util-and-command

Conversation

@eablack
Copy link
Copy Markdown
Contributor

@eablack eablack commented Apr 6, 2026

Summary

This PR updates two key dependencies, refactors color method usage across the codebase, and fixes a telemetry worker issue:

  • Updates @heroku-cli/command from ^12.2.2 to ^12.3.1
  • Updates @heroku/heroku-cli-util from ^10.7.0 to ^10.8.0
  • Replaces deprecated color.dim() calls with color.gray() and color.inactive()
  • Updates telemetry initialization to use the isTelemetryEnabled() helper function
  • Fixes telemetry worker preventing parent process from exiting

Updating these core dependencies brings some lazy loading improvements to cli execution start time. We also correct many instances of using ansis directly with our own themed color.

Also, we changed the logic of heroku-cli-util to default to no color in non-tty environments, even if the environment supports truecolor (which is different from default ansis behavior). Right now, our tests actually expect color, even though it's non-tty. So, I've forced colors in init.mjs for now. Long term, I actually think it would be better to have our tests not test for color generally, and then have specific tests for colors where we think it's important. But, that's a change for a future PR.

Telemetry Worker Fix

The telemetry worker was spawned with stderr: 'inherit', creating a persistent file descriptor reference that prevented the parent CLI process from exiting until the worker completed. This caused the CLI to appear to hang for users.

Changes:

  • Only inherit stderr when DEBUG is set (for development debugging)
  • Worker explicitly closes stderr before exiting when in DEBUG mode
  • Uses setImmediate to ensure stderr flushes before closing

Type of Change

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • deps: Dependency upgrade
  • fix: Bug fix (telemetry worker hanging parent process)

Testing

Steps:

  1. Verify the CLI builds successfully
  2. Test various commands to ensure color output displays correctly
  3. Verify telemetry initialization works as expected
  4. Ensure CLI exits immediately after commands complete (telemetry worker doesn't block)
  5. Verify debug output appears when DEBUG=heroku:* is set
  6. Ensure all existing tests pass

- Update @heroku-cli/command from ^12.2.2 to ^12.3.1
- Update @heroku/heroku-cli-util from ^10.7.0 to ^10.8.0
- Replace deprecated color.dim() calls with color.gray() and color.inactive()
- Update telemetry initialization to use isTelemetryEnabled() helper
- Standardize color method usage across all command files
@eablack eablack requested a review from a team as a code owner April 6, 2026 17:16
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:16 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:16 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:16 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:16 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:23 — with GitHub Actions Inactive
@eablack eablack changed the title deps: update @heroku-cli/command and @heroku/heroku-cli-util feat: update @heroku-cli/command and @heroku/heroku-cli-util, use isTelemetryEnabled() Apr 6, 2026
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:34 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:34 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:34 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:47 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:47 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:47 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:47 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:56 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:56 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:56 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:56 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:59 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 17:59 — with GitHub Actions Inactive
eablack added 2 commits April 6, 2026 11:20
- Fix telemetry tests to enable telemetry in test environment
  - Set ENABLE_WINDOWS_TELEMETRY for Windows CI compatibility
  - Add test to verify telemetry is disabled by default on Windows
  - Properly save/restore environment variables
- Fix spaces/format test for updated color.gray() ANSI code
- Fix pg:copy test to handle line wrapping differences between CI and local
  - Normalize whitespace in warning message assertions
  - Handle oclif's warning prefix (›) in wrapped output
- Set FORCE_COLOR=3 in test init to ensure consistent color output

All tests now pass in local, Linux CI, and Windows CI environments.
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:21 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:21 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:21 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:21 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:24 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:24 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:24 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:24 — with GitHub Actions Inactive
The oclif warning prefix differs between platforms:
- Unix/Linux/macOS: › (single angle quote)
- Windows: » (double angle quote)

Updated the regex to handle both characters when normalizing output.
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:33 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:33 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:33 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 18:33 — with GitHub Actions Inactive
@eablack eablack changed the title feat: update @heroku-cli/command and @heroku/heroku-cli-util, use isTelemetryEnabled() feat: update color usage, telemetry activation logic, and command/util dependencies Apr 6, 2026
The telemetry worker was spawned with stderr set to 'inherit', which created
a persistent file descriptor reference preventing the parent CLI process from
exiting until the worker completed. This caused the CLI to hang for users.

Changes:
- Only inherit stderr when DEBUG is set (for development)
- Worker explicitly closes stderr before exiting (in DEBUG mode)
- Uses setImmediate to allow stderr to flush before closing
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:15 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:15 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:15 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:15 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:19 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:19 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:19 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests April 6, 2026 21:19 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@michaelmalave michaelmalave left a comment

Choose a reason for hiding this comment

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

LGTM!

@eablack eablack merged commit ede6655 into main Apr 6, 2026
17 checks passed
@eablack eablack deleted the eb/update-cli-util-and-command branch April 6, 2026 21:51
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