Skip to content

Commit

Permalink
Merge branch 'prerelease/9.0.0-alpha' into jw/refactor-addons-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwilaby authored Feb 21, 2024
2 parents 310b1a4 + b1b68ad commit 150d5bc
Show file tree
Hide file tree
Showing 78 changed files with 1,077 additions and 645 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ jobs:
with:
node-version: 16.x
- run: yarn --immutable --network-timeout 1000000
- run: yarn global add snyk
- run: snyk test --all-projects --fail-on=all
- run: snyk monitor --all-projects --org=hit
- run: yarn dlx -p snyk test --all-projects --fail-on=all
- run: yarn dlx -p snyk monitor --all-projects --org=hit
2 changes: 1 addition & 1 deletion packages/addons-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"chai-as-promised": "^7.1.1",
"heroku-client": "^3.0.7",
"lolex": "^3.1.0",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"nock": "9.0.13",
"nyc": "^15.1.0",
"oclif": "3.11.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/addons-v5/test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--recursive
--check-leaks
--require ./test/init.js
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/apps-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"lolex": "^3.1.0",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"mockdate": "^2.0.2",
"netrc-parser": "^3.1.6",
"nock": "^10.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-v5/test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--require ./test/helpers.js
--reporter list
--recursive
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/certs-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"lolex": "^3.1.0",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"nock": "^10.0.6",
"nyc": "^15.1.0",
"oclif": "3.11.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/certs-v5/test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--require ./test/helpers.js
--reporter list
--recursive
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"globby": "^10.0.2",
"lodash": "^4.17.11",
"lolex": "^3.1.0",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"nock": "^13.5.1",
"nyc": "^15.1.0",
"oclif": "3.11.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/acceptance/smoke.acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('@acceptance smoke tests', () => {
})

it('heroku run', async () => {
const {stdout} = await run(['run', '--exit-code', appFlag, 'echo', 'it works!'].join(' '))
const {stdout} = await run(['run', '--size=private-s', '--exit-code', appFlag, 'echo', 'it works!'].join(' '))
expect(stdout).to.contain('it works!')
})

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
--watch-extensions ts
--recursive
--reporter spec
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/container-registry-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cross-env": "^7.0.2",
"depcheck": "^1.4.3",
"lolex": "^3.1.0",
"mocha": "^5.0.4",
"mocha": "^6.0.0",
"mockdate": "^2.0.2",
"nock": "^10.0.6",
"nyc": "^15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/container-registry-v5/test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--require ./test/helpers.js
--reporter list
--recursive
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/oauth-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.2",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"mocha-junit-reporter": "1.18.0",
"nock": "10.0.6",
"nyc": "^15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth-v5/test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--require ./test/init.js
--recursive
--timeout 60000
--timeout 180000
--exit
--bail
2 changes: 1 addition & 1 deletion packages/orgs-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@oclif/plugin-legacy": "^1.3.0",
"chai": "^4.2.0",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"nock": "^10.0.6",
"nyc": "^15.1.0",
"oclif": "3.11.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/orgs-v5/test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--require ./test/helpers.js
--recursive
--timeout 60000
--timeout 180000
--exit
--bail
4 changes: 2 additions & 2 deletions packages/pg-v5/commands/credentials/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ async function run(context, heroku) {
throw new Error('cannot pass both --all and --name')
}

if (util.essentialNumPlan(db) || (util.legacyEssentialPlan(db) && cred !== 'default')) {
throw new Error("You can't rotate credentials on Essential-tier databases.")
if (util.legacyEssentialPlan(db) && cred !== 'default') {
throw new Error('Legacy Essential-tier databases do not support named credentials.')
}

if (all && flags.force) {
Expand Down
4 changes: 2 additions & 2 deletions packages/pg-v5/commands/credentials/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ async function run(context, heroku) {

let db = await fetcher.addon(app, args.database)
let cred = flags.name || 'default'
if (util.essentialNumPlan(db) || (util.legacyEssentialPlan(db) && cred !== 'default')) {
throw new Error("You can't view credentials on Essential-tier databases.")
if (util.legacyEssentialPlan(db) && cred !== 'default') {
throw new Error('Legacy Essential-tier databases do not support named credentials.')
}

let credInfo = await heroku.get(`/postgres/v0/databases/${db.name}/credentials/${encodeURIComponent(cred)}`,
Expand Down
8 changes: 1 addition & 7 deletions packages/pg-v5/lib/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ const util = require('./util')

module.exports = function (addon) {
let host = process.env.HEROKU_DATA_HOST || process.env.HEROKU_POSTGRESQL_HOST
let essentialHost = process.env.HEROKU_POSTGRESQL_ESSENTIAL_HOST

if (addon && util.legacyEssentialPlan(addon)) {
if (essentialHost) return `https://${essentialHost}`
return 'https://postgres-starter-api.heroku.com'
}

if (host) return `https://${host}`
return 'https://postgres-api.heroku.com'
return 'https://api.data.heroku.com'
}
2 changes: 1 addition & 1 deletion packages/pg-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.2",
"heroku-client": "^3.0.7",
"mocha": "^5.1.1",
"mocha": "^6.0.0",
"nock": "^10.0.6",
"nyc": "^15.1.0",
"oclif": "3.11.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-v5/test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--recursive
--require ./test/init.js
--timeout 60000
--timeout 180000
--exit
--bail
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const shouldCancel = function (cmdRun) {
let pg

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/apps/myapp/transfers/100-001/actions/cancel').reply(200, {})
cli.mockConsole()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const shouldCapture = function (cmdRun) {
addon_attachment: 'DATABASE_URL',
addon_service: 'heroku-postgresql',
}).reply(200, [{addon}])
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/databases/1/backups').reply(200, {
num: 5,
from_name: 'DATABASE',
Expand Down Expand Up @@ -74,7 +74,7 @@ Stop a running backup with heroku pg:backups:cancel.
addon_service: 'heroku-postgresql',
}).reply(200, [{addon}])

pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/databases/1/backups').reply(200, {
num: 5,
from_name: 'DATABASE',
Expand Down Expand Up @@ -116,7 +116,7 @@ Backing up DATABASE to b005...
addon_service: 'heroku-postgresql',
}).reply(200, [{addon}])

pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/databases/1/backups').reply(200, {
num: 5,
from_name: 'DATABASE',
Expand Down Expand Up @@ -161,7 +161,7 @@ Backing up DATABASE to b005...
addon_service: 'heroku-postgresql',
}).reply(200, [{addon}])

pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/postgres/v0/databases/1/snapshots').reply(200, {})

cli.mockConsole()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const shouldDelete = function (cmdRun) {
let pg

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.delete('/client/v11/apps/myapp/transfers/3').reply(200, {
url: 'https://dburl',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe('pg:backups:download', () => {
let pg

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/apps/myapp/transfers/3/actions/public-url').reply(200, {
url: 'https://postgres-api.heroku.com/db',
url: 'https://api.data.heroku.com/db',
})
pg.get('/db').reply(200, {})
cli.mockConsole()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('pg:backups', () => {
let transfers

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.get('/client/v11/apps/myapp/transfers').reply(200, transfers)
cli.mockConsole()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const shouldInfo = function (cmdRun) {
let pg

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const shouldRestore = function () {
addon_service: 'heroku-postgresql',
}).reply(200, [{addon}])

pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const shouldSchedule = function (cmdRun) {
name: 'DATABASE',
},
])
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/databases/1/transfer-schedules', {
hour: '06', timezone: 'America/New_York', schedule_name: 'DATABASE_URL',
}).reply(201)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const shouldSchedules = function (cmdRun) {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const shouldUnschedule = function (cmdRun) {
addon_attachment: 'DATABASE_URL',
addon_service: 'heroku-postgresql',
}).reply(200, [attachment])
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.get('/client/v11/databases/1/transfer-schedules').twice().reply(200, [{name: 'DATABASE_URL', uuid: '100-001'}])
pg.delete('/client/v11/databases/1/transfer-schedules/100-001').reply(200)
cli.mockConsole()
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('pg:backups:unschedule error state', () => {
addon_attachment: 'DATABASE_URL',
addon_service: 'heroku-postgresql',
}).reply(200, [attachment])
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.get('/client/v11/databases/1/transfer-schedules').twice().reply(200, [{name: 'DATABASE_URL', uuid: '100-001'}, {name: 'DATABASE_URL2', uuid: '100-002'}])
cli.mockConsole()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-v5/test/unit/commands/backups/url.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const shouldUrl = function (cmdRun) {
let pg

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
pg.post('/client/v11/apps/myapp/transfers/3/actions/public-url').reply(200, {
url: 'https://dburl',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('pg:connection-polling:attach', () => {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
api.get('/addons/postgres-1').reply(200, addon)
api.get('/apps/myapp/releases').reply(200, [{version: 0}])

Expand Down
2 changes: 1 addition & 1 deletion packages/pg-v5/test/unit/commands/copy.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('pg:copy', () => {
let api

beforeEach(() => {
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
api = nock('https://api.heroku.com')
cli.mockConsole()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-v5/test/unit/commands/credentials.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('pg:credentials', () => {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('pg:credentials:create', () => {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('pg:credentials:destroy', () => {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('pg:credentials:repair-default', () => {

beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
pg = nock('https://api.data.heroku.com')
cli.mockConsole()
})

Expand Down
Loading

0 comments on commit 150d5bc

Please sign in to comment.