Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
Heroku CLI
==========

![Heroku logo](https://d4yt8xl9b7in.cloudfront.net/assets/home/logotype-heroku.png)
[![Node CI Suite](https://github.com/heroku/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/cli/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/heroku.svg)](https://www.npmjs.com/package/heroku)
[![ISC License](https://img.shields.io/github/license/heroku/cli.svg)](https://github.com/heroku/cli/blob/main/LICENSE)

The Heroku CLI is used to manage Heroku apps from the command line. It is built using [oclif](https://oclif.io).

For more about Heroku see <https://www.heroku.com/home>
<div align="center">
<img src="assets/Heroku-Logo-Mark-Light-RGB.svg" alt="Heroku logo" width="100">
<p>&nbsp;</p>

To get started see <https://devcenter.heroku.com/start>
[![Node CI Suite](https://github.com/heroku/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/cli/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/heroku.svg)](https://www.npmjs.com/package/heroku)
[![ISC License](https://img.shields.io/github/license/heroku/cli.svg)](https://github.com/heroku/cli/blob/main/LICENSE)
</div>

Overview
========

The Heroku CLI is a command-line interface for managing Heroku applications and services. Built with Node.js and [oclif](https://oclif.io), it provides an extensible architecture for interacting with the Heroku platform.

Key features include:
For more about Heroku see <https://www.heroku.com/home>

To get started see <https://devcenter.heroku.com/start>

Key features of the CLI include:

- **App management** - Deploy, scale, and monitor your applications
- **Heroku Postgres database management** - Backup, restore, and manage Heroku Postgres databases
Expand Down Expand Up @@ -116,8 +115,7 @@ Using WebStorm (from JetBrains / IntelliJ), you can run/debug an individual test
- Create a new run/debug configuration
- Select the 'Mocha' type

Releasing
Contributing
=========
See the [Heroku CLI Release Steps](https://salesforce.quip.com/aPLDA1ZwjNlW).

Review our [PR guidelines](./.github/PULL_REQUEST_TEMPLATE.md).
Please review our [Contributing guidelines](./CONTRIBUTING.md) as well as our [PR template](./.github/PULL_REQUEST_TEMPLATE.md).
18 changes: 18 additions & 0 deletions assets/Heroku-Logo-Mark-Light-RGB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion install-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
fi
mkdir -p /usr/local/lib
mkdir -p /usr/local/bin
cd /usr/local/lib
rm -rf heroku
rm -rf ~/.local/share/heroku/client
rm -rf $HOME/.local/share/heroku/client
if [ \$(command -v xz) ]; then
URL=https://cli-assets.heroku.com/channels/stable/heroku-\$OS-\$ARCH.tar.xz
TAR_ARGS="xJ"
Expand Down
21 changes: 16 additions & 5 deletions src/lib/analytics-telemetry/global-telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function reportCmdNotFound(config: Config): Telemetry {
commandRunDuration: 0,
exitCode: 0,
exitState: 'command_not_found',
isTTY: process.stdin.isTTY,
isVersionOrHelp: false,
lifecycleHookCompletion: {
command_not_found: true,
Expand All @@ -62,11 +63,20 @@ export async function sendTelemetry(currentTelemetry: TelemetryData): Promise<vo
const telemetry = currentTelemetry

if (telemetry instanceof Error) {
telemetryDebug('Sending error to Honeycomb and Sentry: %s', telemetry.message)
await Promise.all([
sendToHoneycomb(telemetry),
sendToSentry(telemetry),
])
// Filter SIGINT errors from Sentry (user Ctrl+C is not an error to report)
// But still send to Honeycomb for analytics
const isSIGINT = telemetry.message === 'Received SIGINT'

if (isSIGINT) {
telemetryDebug('Sending error to Honeycomb: %s', telemetry.message)
await sendToHoneycomb(telemetry)
} else {
telemetryDebug('Sending error to Honeycomb and Sentry: %s', telemetry.message)
await Promise.all([
sendToHoneycomb(telemetry),
sendToSentry(telemetry),
])
}
} else {
telemetryDebug('Sending telemetry for command: %s', telemetry.command)
await sendToHoneycomb(telemetry)
Expand All @@ -92,6 +102,7 @@ export function setupTelemetry(config: Config, opts: TelemetryOptions): Telemetr
commandRunDuration: cmdStartTime,
exitCode: 0,
exitState: 'successful',
isTTY: process.stdin.isTTY,
isVersionOrHelp: true,
lifecycleHookCompletion: {
command_not_found: false,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/analytics-telemetry/sentry-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function sendToSentry(data: CLIError): Promise<void> {
try {
telemetryDebug('Sentry payload: %O', {
code: data.code,
context: data.context,
message: data.message,
name: data.name,
stack: data.stack,
Expand All @@ -62,6 +63,5 @@ export async function sendToSentry(data: CLIError): Promise<void> {
telemetryDebug('Successfully flushed error to Sentry')
} catch (error) {
telemetryDebug('Error sending to Sentry: %O', error)
debug('Could not send error report')
}
}
4 changes: 4 additions & 0 deletions src/lib/analytics-telemetry/telemetry-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ let cachedToken: string | undefined
export interface CLIError extends Error {
cliRunDuration?: number | string
code?: string
context?: {
isTTY?: boolean
}
http?: {
statusCode?: number
}
Expand All @@ -38,6 +41,7 @@ export interface Telemetry {
commandRunDuration: number
exitCode: number
exitState: string
isTTY: boolean | undefined
isVersionOrHelp: boolean
lifecycleHookCompletion: {
command_not_found: boolean
Expand Down
3 changes: 3 additions & 0 deletions src/lib/analytics-telemetry/worker-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export function setupTelemetryHandlers(options: SetupTelemetryOptions): void {
// Spawn background process to send telemetry
const error: CLIError = Object.assign(new Error('Received SIGINT'), {
cliRunDuration: computeDuration(cliStartTime),
context: {
isTTY: process.stdin.isTTY,
},
})
spawnTelemetryWorker(error)
process.exit(1)
Expand Down
2 changes: 2 additions & 0 deletions test/unit/analytics-telemetry/global-telemetry.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ describe('global-telemetry', function () {
commandRunDuration: 50,
exitCode: 0,
exitState: 'successful',
isTTY: true,
isVersionOrHelp: false,
lifecycleHookCompletion: {
command_not_found: false,
Expand Down Expand Up @@ -142,6 +143,7 @@ describe('global-telemetry', function () {
commandRunDuration: 50,
exitCode: 0,
exitState: 'successful',
isTTY: true,
isVersionOrHelp: false,
lifecycleHookCompletion: {
command_not_found: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('honeycomb-client', function () {
commandRunDuration: 50,
exitCode: 0,
exitState: 'successful',
isTTY: true,
isVersionOrHelp: false,
lifecycleHookCompletion: {
command_not_found: false,
Expand Down
Loading