Skip to content

Commit 19ed38c

Browse files
authored
fix(W-20270674): bump heroku-cli-util and fix resulting errors (#3426)
fix: bump heroku-cli-util and fix resulting errors
1 parent 389b2d2 commit 19ed38c

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@heroku-cli/schema": "^1.0.25",
1414
"@heroku/buildpack-registry": "^1.0.1",
1515
"@heroku/eventsource": "^1.0.7",
16-
"@heroku/heroku-cli-util": "^9.1.3",
16+
"@heroku/heroku-cli-util": "^9.2.0",
1717
"@heroku/http-call": "^5.5.0",
1818
"@heroku/mcp-server": "1.0.7-alpha.1",
1919
"@heroku/plugin-ai": "^1.0.1",

packages/cli/src/commands/pg/psql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class Psql extends Command {
3939

4040
const psqlService = new utils.pg.PsqlService(db)
4141

42-
console.error(`--> Connecting to ${color.yellow(db.attachment.addon.name)}`)
42+
console.error(`--> Connecting to ${color.yellow(db.attachment!.addon.name)}`)
4343
if (command) {
4444
const output = await psqlService.execQuery(command)
4545
process.stdout.write(output)

packages/cli/src/commands/pg/pull.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class Pull extends Command {
5858
const source = await dbResolver.getDatabase(app, args.source)
5959
const target = utils.pg.DatabaseResolver.parsePostgresConnectionString(args.target)
6060

61-
ux.log(`Pulling ${color.cyan(source.attachment.addon.name)} to ${color.addon(args.target)}`)
61+
ux.log(`Pulling ${color.cyan(source.attachment!.addon.name)} to ${color.addon(args.target)}`)
6262
await this.pull(source, target, exclusions)
6363
ux.log('Pulling complete.')
6464
}

packages/cli/src/commands/pg/push.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class Push extends Command {
5555
const dbResolver = new utils.pg.DatabaseResolver(this.heroku)
5656
const target = await dbResolver.getDatabase(app, args.target)
5757

58-
ux.log(`Pushing ${color.cyan(args.source)} to ${color.addon(target.attachment.addon.name)}`)
58+
ux.log(`Pushing ${color.cyan(args.source)} to ${color.addon(target.attachment!.addon.name)}`)
5959
await this.push(source, target, exclusions)
6060
ux.log('Pushing complete.')
6161
}

packages/cli/src/lib/pg/psql.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {SpawnOptions} from 'child_process'
33
import debug from 'debug'
44
import * as fs from 'fs'
55
import * as path from 'node:path'
6-
import {ConnectionDetailsWithAttachment, utils} from '@heroku/heroku-cli-util'
6+
import {ConnectionDetails, utils} from '@heroku/heroku-cli-util'
77

8-
export async function fetchVersion(db: ConnectionDetailsWithAttachment) {
8+
export async function fetchVersion(db: ConnectionDetails) {
99
const psqlService = new utils.pg.PsqlService(db)
1010
const output = await psqlService.execQuery('SHOW server_version', ['-X', '-q'])
1111
return output.match(/[0-9]{1,}\.[0-9]{1,}/)?.[0]
@@ -58,18 +58,18 @@ export function psqlInteractiveOptions(prompt: string, dbEnv: NodeJS.ProcessEnv)
5858
}
5959
}
6060

61-
export async function execFile(db: ConnectionDetailsWithAttachment, file: string) {
61+
export async function execFile(db: ConnectionDetails, file: string) {
6262
const psqlService = new utils.pg.PsqlService(db)
6363
const configs = utils.pg.psql.getPsqlConfigs(db)
6464
const options = psqlFileOptions(file, configs.dbEnv)
6565

6666
return psqlService.runWithTunnel(configs.dbTunnelConfig, options)
6767
}
6868

69-
export async function interactive(db: ConnectionDetailsWithAttachment) {
69+
export async function interactive(db: ConnectionDetails) {
7070
const psqlService = new utils.pg.PsqlService(db)
71-
const attachmentName = db.attachment.name
72-
const prompt = `${db.attachment.app.name}::${attachmentName}%R%# `
71+
const attachmentName = db.attachment!.name
72+
const prompt = `${db.attachment!.app.name}::${attachmentName}%R%# `
7373
const configs = utils.pg.psql.getPsqlConfigs(db)
7474
configs.dbEnv.PGAPPNAME = 'psql interactive' // default was 'psql non-interactive`
7575
const options = psqlInteractiveOptions(prompt, configs.dbEnv)

packages/cli/test/unit/commands/pg/pull.unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import runCommand, {GenericCmd} from '../../../helpers/runCommand'
33
import {expect} from 'chai'
44
import * as proxyquire from 'proxyquire'
55
import heredoc from 'tsheredoc'
6-
import {ConnectionDetailsWithAttachment, utils} from '@heroku/heroku-cli-util'
6+
import {ConnectionDetails, utils} from '@heroku/heroku-cli-util'
77
import sinon = require('sinon')
88
import * as childProcess from 'node:child_process'
99

1010
describe('pg:pull', function () {
1111
const skipOnWindows = process.platform === 'win32' ? it.skip : it
1212
const dumpFlags = ['--verbose', '-F', 'c', '-Z', '0', '-N', '_heroku', '-U', 'jeff', '-h', 'herokai.com', '-p', '5432', 'mydb']
1313
const restoreFlags = ['--verbose', '-F', 'c', '--no-acl', '--no-owner', '-d', 'localdb']
14-
let db: ConnectionDetailsWithAttachment
14+
let db: ConnectionDetails
1515
let push_pull: unknown
1616
let Cmd: GenericCmd
1717
let createDbStub: sinon.SinonStub
@@ -39,7 +39,7 @@ describe('pg:pull', function () {
3939
config_vars: ['DATABASE_URL'],
4040
app: {name: 'myapp'},
4141
},
42-
} as ConnectionDetailsWithAttachment
42+
} as ConnectionDetails
4343
sshTunnelStub = sinon.stub().resolves()
4444
const mockUtils = {
4545
pg: {
@@ -53,7 +53,7 @@ describe('pg:pull', function () {
5353
execQuery = sinon.stub().resolves('')
5454
},
5555
psql: {
56-
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetailsWithAttachment) => {
56+
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetails) => {
5757
return utils.pg.psql.getPsqlConfigs(db)
5858
}),
5959
sshTunnel: sshTunnelStub,

packages/cli/test/unit/commands/pg/push.unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import runCommand, {GenericCmd} from '../../../helpers/runCommand'
33
import {expect} from 'chai'
44
import * as proxyquire from 'proxyquire'
55
import heredoc from 'tsheredoc'
6-
import {ConnectionDetailsWithAttachment, utils} from '@heroku/heroku-cli-util'
6+
import {ConnectionDetails, utils} from '@heroku/heroku-cli-util'
77
import sinon = require('sinon')
88
import * as childProcess from 'node:child_process'
99

1010
describe('pg:push', function () {
1111
const skipOnWindows = process.platform === 'win32' ? it.skip : it
12-
let db: ConnectionDetailsWithAttachment
12+
let db: ConnectionDetails
1313
let push_pull: unknown
1414
const emptyResponse = '00'
1515
let Cmd: GenericCmd
@@ -37,7 +37,7 @@ describe('pg:push', function () {
3737
config_vars: ['DATABASE_URL'],
3838
app: {name: 'myapp'},
3939
},
40-
} as ConnectionDetailsWithAttachment
40+
} as ConnectionDetails
4141
sshTunnelStub = sinon.stub().resolves()
4242
const mockUtils = {
4343
pg: {
@@ -51,7 +51,7 @@ describe('pg:push', function () {
5151
execQuery = sinon.stub().resolves(emptyResponse)
5252
},
5353
psql: {
54-
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetailsWithAttachment) => {
54+
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetails) => {
5555
return utils.pg.psql.getPsqlConfigs(db)
5656
}),
5757
sshTunnel: sshTunnelStub,

packages/cli/test/unit/lib/pg/psql.unit.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import * as fs from 'node:fs'
44
import * as path from 'node:path'
55
import * as proxyquire from 'proxyquire'
66
import {stderr} from 'stdout-stderr'
7-
import {ConnectionDetailsWithAttachment, utils} from '@heroku/heroku-cli-util'
7+
import {ConnectionDetails, utils} from '@heroku/heroku-cli-util'
88
import {unwrap} from '../../../helpers/utils/unwrap'
99
import sinon = require('sinon')
1010
import * as tmp from 'tmp'
1111
import type * as Pgsql from '../../../../src/lib/pg/psql'
1212

1313
describe('psql', function () {
14-
const db: ConnectionDetailsWithAttachment = {
15-
attachment: {} as ConnectionDetailsWithAttachment['attachment'],
14+
const db: ConnectionDetails = {
15+
attachment: {} as ConnectionDetails['attachment'],
1616
user: 'jeff',
1717
password: 'pass',
1818
database: 'mydb',
@@ -24,8 +24,8 @@ describe('psql', function () {
2424
url: '',
2525
}
2626

27-
const bastionDb: ConnectionDetailsWithAttachment = {
28-
attachment: {} as ConnectionDetailsWithAttachment['attachment'],
27+
const bastionDb: ConnectionDetails = {
28+
attachment: {} as ConnectionDetails['attachment'],
2929
user: 'jeff',
3030
password: 'pass',
3131
database: 'mydb',
@@ -68,15 +68,15 @@ describe('psql', function () {
6868
runWithTunnel = psqlServiceRunWithTunnelSpy
6969
},
7070
psql: {
71-
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetailsWithAttachment) => {
71+
getPsqlConfigs: sinon.stub().callsFake((db: ConnectionDetails) => {
7272
return utils.pg.psql.getPsqlConfigs(db)
7373
}),
7474
},
7575
},
7676
}
7777
psql = proxyquire('../../../../src/lib/pg/psql', {
7878
'@heroku/heroku-cli-util': {
79-
ConnectionDetailsWithAttachment: {} as ConnectionDetailsWithAttachment,
79+
ConnectionDetailsWithAttachment: {} as ConnectionDetails,
8080
utils: mockUtils,
8181
},
8282
})
@@ -175,7 +175,7 @@ describe('psql', function () {
175175
},
176176
name: 'DATABASE',
177177
},
178-
} as ConnectionDetailsWithAttachment
178+
} as ConnectionDetails
179179

180180
context('when HEROKU_PSQL_HISTORY is set', function () {
181181
let historyPath: string

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,17 +1801,17 @@ __metadata:
18011801
languageName: node
18021802
linkType: hard
18031803

1804-
"@heroku/heroku-cli-util@npm:^9.1.3":
1805-
version: 9.1.3
1806-
resolution: "@heroku/heroku-cli-util@npm:9.1.3"
1804+
"@heroku/heroku-cli-util@npm:^9.2.0":
1805+
version: 9.2.0
1806+
resolution: "@heroku/heroku-cli-util@npm:9.2.0"
18071807
dependencies:
18081808
"@heroku-cli/color": ^2.0.4
18091809
"@heroku-cli/command": ^11.8.0
18101810
"@heroku/http-call": ^5.5.0
18111811
"@oclif/core": ^2.16.0
18121812
debug: ^4.4.0
18131813
tunnel-ssh: 5.2.0
1814-
checksum: d23a3894f2e69cdc9552696e648afa44133f95b807658310562a2cad3e9a6581785fdceea60bb1efb51a7a1481c6ac243cb5aa249e01636c1693238bc7d8040f
1814+
checksum: 95fdc285d3d095bc8a04e6d0ae61c5260e5e5a5aa4e555505fdc134cc5b7f6f99825acfeaa4ff401fbb66aff7e88b4d1b60f5d0c1bf1c6e9f3e75a90b8acd16e
18151815
languageName: node
18161816
linkType: hard
18171817

@@ -10922,7 +10922,7 @@ __metadata:
1092210922
"@heroku-cli/schema": ^1.0.25
1092310923
"@heroku/buildpack-registry": ^1.0.1
1092410924
"@heroku/eventsource": ^1.0.7
10925-
"@heroku/heroku-cli-util": ^9.1.3
10925+
"@heroku/heroku-cli-util": ^9.2.0
1092610926
"@heroku/http-call": ^5.5.0
1092710927
"@heroku/mcp-server": 1.0.7-alpha.1
1092810928
"@heroku/plugin-ai": ^1.0.1

0 commit comments

Comments
 (0)