Skip to content

Commit 03d53a6

Browse files
authored
fix: update '@heroku/heroku-cli-util' dependency version (W-21546520) (#3595)
Update heroku-cli-util dependency and fix tests.
1 parent 87bfe82 commit 03d53a6

33 files changed

+29
-63
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@heroku-cli/notifications": "^1.2.6",
1111
"@heroku-cli/schema": "^1.0.25",
1212
"@heroku/buildpack-registry": "^1.0.1",
13-
"@heroku/heroku-cli-util": "^10.6.0",
13+
"@heroku/heroku-cli-util": "^10.6.1",
1414
"@heroku/http-call": "^5.5.1",
1515
"@heroku/mcp-server": "^1.2.0",
1616
"@heroku/socksv5": "^0.0.9",

src/commands/data/pg/destroy.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export default class DataPgDestroy extends BaseCommand {
3232
const addonResolver = new utils.AddonResolver(this.heroku)
3333
const addon = await addonResolver.resolve(databaseName, app, utils.pg.addonService())
3434

35-
if (!utils.pg.isPostgresAddon(addon)) {
36-
ux.error(`You can only use this command to delete Heroku Postgres databases. Run ${color.code(`heroku addons:destroy ${addon.name}`)} instead.`)
37-
}
38-
3935
// prevent deletion of add-on when context.app is set but the addon is
4036
// attached to a different app
4137
const addonApp = addon.app!.name!

test/unit/commands/data/pg/destroy.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ describe('data:pg:destroy', function () {
4545
}
4646
})
4747

48-
it('prevents destruction of add-ons other than Heroku Postgres', async function () {
48+
it('doesn\'t destroy non-Postgres addons', async function () {
4949
const resolveApi = nock('https://api.heroku.com')
5050
.post('/actions/addons/resolve')
5151
.reply(200, [nonPostgresAddon])
5252

5353
try {
54-
await runCommand(DataPgDestroy, [addon.name!, '--app=myapp', '--confirm=myapp'])
54+
await runCommand(DataPgDestroy, [nonPostgresAddon.name!, '--app=myapp', '--confirm=myapp'])
5555
} catch (error: unknown) {
5656
resolveApi.done()
5757
expect(ansis.strip((error as Error).message)).to.equal(
58-
'You can only use this command to delete Heroku Postgres databases. Run heroku addons:destroy redis-database instead.',
58+
'Couldn\'t find that addon.',
5959
)
6060
}
6161
})

test/unit/commands/pg/backups/capture.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('pg:backups:capture', function () {
3434
}
3535
api
3636
.post('/actions/addon-attachments/resolve', {
37-
addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql', app: 'myapp',
37+
addon_attachment: 'DATABASE_URL', app: 'myapp',
3838
})
3939
.reply(200, [{addon}])
4040
pgApi
@@ -76,7 +76,7 @@ describe('pg:backups:capture', function () {
7676
}
7777
api
7878
.post('/actions/addon-attachments/resolve', {
79-
addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql', app: 'myapp',
79+
addon_attachment: 'DATABASE_URL', app: 'myapp',
8080
})
8181
.reply(200, [{addon}])
8282
pgApi
@@ -122,7 +122,7 @@ describe('pg:backups:capture', function () {
122122
}
123123
api
124124
.post('/actions/addon-attachments/resolve', {
125-
addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql', app: 'myapp',
125+
addon_attachment: 'DATABASE_URL', app: 'myapp',
126126
})
127127
.reply(200, [{addon}])
128128
pgApi

test/unit/commands/pg/backups/restore.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('pg:backups:restore', function () {
2020
beforeEach(async function () {
2121
api = nock('https://api.heroku.com')
2222
api.post('/actions/addon-attachments/resolve', {
23-
addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql', app: 'myapp',
23+
addon_attachment: 'DATABASE_URL', app: 'myapp',
2424
}).reply(200, [{addon}])
2525
pg = nock('https://api.data.heroku.com')
2626
})

test/unit/commands/pg/backups/schedule.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('pg:backups:schedule', function () {
2929
api
3030
.post('/actions/addon-attachments/resolve', {
3131
addon_attachment: 'DATABASE_URL',
32-
addon_service: 'heroku-postgresql',
3332
app: 'myapp',
3433
})
3534
.reply(200, [
@@ -136,7 +135,6 @@ describe('pg:backups:schedule', function () {
136135
api
137136
.post('/actions/addon-attachments/resolve', {
138137
addon_attachment: 'DATABASE_URL',
139-
addon_service: 'heroku-postgresql',
140138
app: 'myapp',
141139
})
142140
.reply(200, [

test/unit/commands/pg/backups/unschedule.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ describe('pg:backups:unschedule', function () {
2424
.reply(200, [addon])
2525
.post('/actions/addon-attachments/resolve', {
2626
addon_attachment: 'DATABASE_URL',
27-
addon_service: 'heroku-postgresql',
2827
app: appName,
2928
})
3029
.reply(200, [attachment])
@@ -66,7 +65,6 @@ describe('pg:backups:unschedule error state', function () {
6665
.reply(200, [addon])
6766
.post('/actions/addon-attachments/resolve', {
6867
addon_attachment: 'DATABASE_URL',
69-
addon_service: 'heroku-postgresql',
7068
app: appName,
7169
})
7270
.reply(200, [attachment])

test/unit/commands/pg/connection-pooling/attach.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('pg:connection-pooling:attach', function () {
1717

1818
beforeEach(function () {
1919
api = nock('https://api.heroku.com')
20-
.post('/actions/addon-attachments/resolve', {addon_attachment: 'postgres-1', addon_service: 'heroku-postgresql', app: 'myapp'})
20+
.post('/actions/addon-attachments/resolve', {addon_attachment: 'postgres-1', app: 'myapp'})
2121
.reply(200, [resolvedAttachments['myapp::postgres-1']])
2222
.get('/addons/postgres-1')
2323
.reply(200, addon)

test/unit/commands/pg/copy.unit.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('pg:copy', function () {
5858
api.get('/addons/postgres-1')
5959
.reply(200, addon)
6060
api.post('/actions/addon-attachments/resolve', {
61-
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL', addon_service: 'heroku-postgresql',
61+
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL',
6262
})
6363
.reply(200, [attachment])
6464
api.get('/apps/myapp/config-vars')
@@ -108,11 +108,11 @@ describe('pg:copy', function () {
108108
api.get('/addons/postgres-2')
109109
.reply(200, otherAddon)
110110
api.post('/actions/addon-attachments/resolve', {
111-
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL', addon_service: 'heroku-postgresql',
111+
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL',
112112
})
113113
.reply(200, [attachment])
114114
api.post('/actions/addon-attachments/resolve', {
115-
app: 'myotherapp', addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql',
115+
app: 'myotherapp', addon_attachment: 'DATABASE_URL',
116116
})
117117
.reply(200, [otherAttachment])
118118
api.get('/apps/myapp/config-vars')
@@ -152,11 +152,11 @@ describe('pg:copy', function () {
152152
api.get('/addons/postgres-2')
153153
.reply(200, otherAddon)
154154
api.post('/actions/addon-attachments/resolve', {
155-
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL', addon_service: 'heroku-postgresql',
155+
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL',
156156
})
157157
.reply(200, [attachment])
158158
api.post('/actions/addon-attachments/resolve', {
159-
app: 'myapp', addon_attachment: 'ATTACHED_BLUE', addon_service: 'heroku-postgresql',
159+
app: 'myapp', addon_attachment: 'ATTACHED_BLUE',
160160
})
161161
.reply(200, [attachedBlueAttachment])
162162
api.get('/apps/myapp/config-vars')
@@ -192,11 +192,11 @@ describe('pg:copy', function () {
192192
api.get('/addons/postgres-2')
193193
.reply(200, otherAddon)
194194
api.post('/actions/addon-attachments/resolve', {
195-
app: 'mylowercaseapp', addon_attachment: 'lowercase_database_URL', addon_service: 'heroku-postgresql',
195+
app: 'mylowercaseapp', addon_attachment: 'lowercase_database_URL',
196196
})
197197
.reply(200, [lowercaseAttachment])
198198
api.post('/actions/addon-attachments/resolve', {
199-
app: 'myotherapp', addon_attachment: 'DATABASE_URL', addon_service: 'heroku-postgresql',
199+
app: 'myotherapp', addon_attachment: 'DATABASE_URL',
200200
})
201201
.reply(200, [otherAttachment])
202202
api.get('/apps/mylowercaseapp/config-vars')
@@ -231,7 +231,7 @@ describe('pg:copy', function () {
231231
api.get('/addons/postgres-1')
232232
.reply(200, addon)
233233
api.post('/actions/addon-attachments/resolve', {
234-
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL', addon_service: 'heroku-postgresql',
234+
app: 'myapp', addon_attachment: 'HEROKU_POSTGRESQL_RED_URL',
235235
})
236236
.reply(200, [attachment])
237237
api.get('/apps/myapp/config-vars')

0 commit comments

Comments
 (0)