Skip to content

Commit

Permalink
Merge branch 'main' into zw/update-fig-pr-automation
Browse files Browse the repository at this point in the history
  • Loading branch information
zwhitfield3 committed Mar 8, 2024
2 parents 996ffc8 + efec095 commit c84267e
Show file tree
Hide file tree
Showing 42 changed files with 353 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**This project is for the Heroku CLI only and issues are reviewed as we are able. If you need more immediate assistence or help with anything not specific to the CLI itself, please use https://help.heroku.com.**
**This project is for the Heroku CLI only and issues are reviewed as we are able. If you need more immediate assistance or help with anything not specific to the CLI itself, please use https://help.heroku.com.**

Do you want to request a *feature* or report a *bug*?
-----------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/empty-stampy-buckets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ on:
workflow_dispatch

jobs:
copy-to-stable:
empty-stampy-buckets:
runs-on: ubuntu-latest
environment: Stampy
steps:
- uses: actions/checkout@v3
- name: Empty Stampy signed and unsigned buckets
env:
STAMPY_ARN: ${{ secrets.STAMPY_ARN }}
Expand All @@ -21,4 +22,4 @@ jobs:
export AWS_ACCESS_KEY_ID=$(echo "${TEMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
export AWS_SECRET_ACCESS_KEY=$(echo "${TEMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
export AWS_SESSION_TOKEN=$(echo "${TEMP_ROLE}" | jq -r '.Credentials.SessionToken')
node scripts/stampy/empty-stampy-buckets.js
node ./scripts/stampy/empty-stampy-buckets.js
2 changes: 1 addition & 1 deletion docs/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ USAGE
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
-t, --truncate truncates queries to 40 charaters
-t, --truncate truncates queries to 40 characters
DESCRIPTION
display queries with active locks
Expand Down
2 changes: 1 addition & 1 deletion docs/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ DESCRIPTION
Space CIDRs: 10.0.128.0/20, 10.0.144.0/20
Unavailable CIDRs: 10.1.0.0/16
You will use the information provied by this command to establish a peering connection request from your AWS VPC to
You will use the information provided by this command to establish a peering connection request from your AWS VPC to
your private space.
To start the peering process, go into your AWS console for the VPC you would like peered with your Private Space,
Expand Down
4 changes: 2 additions & 2 deletions packages/addons-v5/test/unit/lib/resolve.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ describe('resolve', () => {
.then(() => appAttachment.done())
})

it('falls back to searching by addon and addon_service when ambigious', () => {
it('falls back to searching by addon and addon_service when ambiguous', () => {
let api = nock('https://api.heroku.com:443')
.post('/actions/addon-attachments/resolve', {app: 'myapp', addon_attachment: 'myattachment-3', addon_service: 'slowdb'}).reply(200, [
{app: {name: 'myapp'}, name: 'some-random-name-1'},
Expand All @@ -354,7 +354,7 @@ describe('resolve', () => {
.then(() => appAttachment.done())
})

it('throws original error when ambigious and searching by addon and addon_service is ambigious', () => {
it('throws original error when ambiguous and searching by addon and addon_service is ambiguous', () => {
let api = nock('https://api.heroku.com:443')
.post('/actions/addon-attachments/resolve', {app: 'myapp', addon_attachment: 'myattachment-3', addon_service: 'slowdb'}).reply(200, [
{app: {name: 'myapp'}, name: 'some-random-name-1'},
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-v5/src/commands/apps/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function run(context, heroku) {
let app = context.args.app || context.app
if (!app) throw new Error('No app specified.\nUSAGE: heroku apps:destroy APPNAME')

context.app = app // make sure context.app is always set for herkou-cli-util
context.app = app // make sure context.app is always set for heroku-cli-util

await heroku.get(`/apps/${app}`)
await cli.confirmApp(app, context.flags.confirm, `WARNING: This will delete ${cli.color.app(app)} including all add-ons.`)
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-v5/src/commands/apps/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function run(context, heroku) {
let app = context.args.app || context.app
if (!app) throw new Error('No app specified.\nUSAGE: heroku info my-app')

context.app = app // make sure context.app is always set for herkou-cli-util
context.app = app // make sure context.app is always set for heroku-cli-util

let info = await getInfo(app)
let addons = info.addons.map(a => a.plan.name).sort()
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-v5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Show the status of the most recent test run

`heroku ci:run`

Run this from within your repo directory to trigger a test agains the current branch and commit.
Run this from within your repo directory to trigger a test against the current branch and commit.

`heroku ci:rerun NUMBER`

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/autocomplete/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export default class Doctor extends AutocompleteBase {
const shellProfilePath = path.join(process.env.HOME || '', shell === 'zsh' ? '.zshrc' : '.bashrc')
const shellProfile = fs.readFileSync(shellProfilePath)
const regex = /AC_\w+_SETUP_PATH/
const shimVlaue = regex.exec(shellProfile.toString()) ? 'present' : 'missing'
data.push({name: `~/${shell === 'zsh' ? '.zshrc' : '.bashrc'} shimmed`, value: shimVlaue})
const shimValue = regex.exec(shellProfile.toString()) ? 'present' : 'missing'
data.push({name: `~/${shell === 'zsh' ? '.zshrc' : '.bashrc'} shimmed`, value: shimValue})

// check shell shim
const shellCompletion = path.join(this.autocompleteCacheDir, `${shell}_setup`)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/autocomplete/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class Options extends AutocompleteBase {
// Klass: (class) Command class
// completion: (object) object with data/methods to build/retrive options from cache
// curPosition*: the current argv position the shell is trying to complete
// options: (string) white-space seperated list of values for the shell to use for completion
// options: (string) white-space separated list of values for the shell to use for completion

async run() {
this.errorIfWindows()
Expand Down Expand Up @@ -192,7 +192,7 @@ export default class Options extends AutocompleteBase {
}
}

// --app=my-app is consided a flag & not a flag value
// --app=my-app is considered a flag & not a flag value
// the shell's autocomplete handles partial value matching

// add parsedFlag
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/pipelines/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import getRepo from '../../lib/pipelines/setup/get-repo'
import {nameAndRepo} from '../../lib/pipelines/setup/validate'

export default class Connect extends Command {
static description = 'connect a github repo to an existing pipeline'
static description = 'connect a GitHub repo to an existing pipeline'

static examples = [
'$ heroku pipelines:connect my-pipeline -r githuborg/reponame',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/pipelines/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function diff(targetApp: AppInfo, downstreamApp: AppInfo, githubToken: str
return ux.log(`\n${color.app(targetApp.name)} is up to date with ${color.app(downstreamApp.name)}`)
}

// Do the actual Github diff
// Do the actual GitHub diff
try {
const path = `${targetApp.repo}/compare/${downstreamApp.hash}...${targetApp.hash}`
const headers: { authorization: string; 'user-agent'?: string} = {authorization: 'token ' + githubToken}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/ci/interfaces/kolkrabbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export interface HerokuPlatformApiOrganization {
[k: string]: any;
}
/**
* Pipeline repositories link a pipeline to a Github repository.
* Pipeline repositories link a pipeline to a GitHub repository.
*/
export interface KolkrabbiApiPipelineRepositories {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/config/quote.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const shell = require('shell-quote')

// slightly modifed form of shell-quote to default to using single-quotes over backslashes
// slightly modified form of shell-quote to default to using single-quotes over backslashes
export function quote(s: string): string {
// eslint-disable-next-line no-useless-escape
if (/["\s#!$&'()*,:;<=>?@\[\\\]^`{|}]/.test(s)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/run/dyno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export default class Dyno extends Duplex {
sshProc.stderr.on('data', data => {
lastErr = data

// supress host key and permission denied messages
// suppress host key and permission denied messages
if (this._isDebug() || (data.includes("Warning: Permanently added '[127.0.0.1]") && data.includes('Permission denied (publickey).'))) {
process.stderr.write(data)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/acceptance/commands-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default `\u001B[1m Command Summary
pg:wait blocks until database is available
pipelines list pipelines you have access to
pipelines:add add this app to a pipeline
pipelines:connect connect a github repo to an existing pipeline
pipelines:connect connect a GitHub repo to an existing pipeline
pipelines:create create a new pipeline
pipelines:destroy destroy a pipeline
pipelines:diff compares the latest release of this app to its downstream app(s)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/integration/logs.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('logs', () => {
.command(['logs', '--app=heroku-cli-ci-smoke-test-app'])
.it('shows the logs', ctx => {
// This is asserting that logs are returned by checking for the presence of the first two
// digits of the year in the timetstamp
// digits of the year in the timestamp
expect(ctx.stdout.startsWith('20')).to.be.true
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CacheBuildFlagsTest = {
id: 'autocomplete:create',
flags:
{app: {name: 'app', type: 'option', description: 'app to use'},
visable: {name: 'visable', type: 'boolean', description: 'visable flag'},
visible: {name: 'visible', type: 'boolean', description: 'visible flag'},
hidden: {name: 'hidden', type: 'boolean', description: 'hidden flag', hidden: true},
},
args: [],
Expand Down Expand Up @@ -60,7 +60,7 @@ runtest('Create', () => {
})

it('#genCmdPublicFlags', () => {
expect(cmd.genCmdPublicFlags(CacheBuildFlagsTest)).to.eq('--app --visable')
expect(cmd.genCmdPublicFlags(CacheBuildFlagsTest)).to.eq('--app --visible')
expect(cmd.genCmdPublicFlags(CacheBuildFlagsTest)).to.not.match(/--hidden/)
expect(cmd.genCmdPublicFlags(Create)).to.eq('')
})
Expand Down Expand Up @@ -168,7 +168,7 @@ _all_commands_list=(
expect(cmd.genZshCmdFlagsSetter(CacheBuildFlagsTest)).to.eq(`_set_autocomplete_create_flags () {
_flags=(
"--app=-[(autocomplete) app to use]: :_compadd_flag_options"
"--visable[(switch) visable flag]"
"--visible[(switch) visible flag]"
)
}
`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Run git push heroku main to create a new release using this buildpack.
.stdout()
.stderr()
.command(['buildpacks:set', 'https://github.com/bar/bar', '-a', 'example'])
.it('# overwrites in the the first when no i is passed', ctx => {
.it('# overwrites in the first when no i is passed', ctx => {
expect(ctx.stdout).to.equal(
`Buildpack set. Next release on example will use:
1. https://github.com/bar/bar
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/unit/commands/local/run.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('local:run', () => {
.it('can handle multiple argument passed to foreman after the `--` argument separator')
})

describe('when the environemnt flag is given', function () {
describe('when the environment flag is given', function () {
test
.stub(foreman, 'fork', function () {
// eslint-disable-next-line prefer-rest-params
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/test/unit/commands/pipelines/add.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('pipelines:add', () => {
.stderr()
.stdout()
// this `stub` overrides the prompt function on
// the inqurier package to simulate what would be
// the inquirer package to simulate what would be
// returned from answering if "development" was
// selected by the user
.stub(inquirer, 'prompt', function () {
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('pipelines:add', () => {
.stderr()
.stdout()
// this `stub` overrides the prompt function,
// similuating that the user picked the identical
// simulating that the user picked the identical
// pipeline value with id: '0987' for the pipeline
// question
.stub(inquirer, 'prompt', function () {
Expand All @@ -95,7 +95,7 @@ describe('pipelines:add', () => {

// by returning to a query for pipeline names with
// multiple results we trigger a choice from the
// user to disambigute between the choices
// user to disambiguate between the choices
const pipelinesWithIdenticalNames = [
firstIdenticallyNamedPipeline,
secondIdenticallyNamedPipeline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('pipelines:connect', () => {
})
})

describe('with an account connected to Github experiencing request failures', () => {
describe('with an account connected to GitHub experiencing request failures', () => {
test
.nock('https://kolkrabbi.heroku.com', kolkrabbi => {
const kolkrabbiAccount = {
Expand All @@ -79,6 +79,6 @@ describe('pipelines:connect', () => {
.catch(error => {
expect(error.message).to.contain('Could not access the my-org/my-repo repo')
})
.it('shows an error if github request fails')
.it('shows an error if GitHub request fails')
})
})
2 changes: 1 addition & 1 deletion packages/container-registry-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.2",
"depcheck": "^1.4.3",
"depcheck": "^1.4.7",
"lolex": "^3.1.0",
"mocha": "^8.0.0",
"mockdate": "^2.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => api.done())
.then(() => registry.done())
Expand Down Expand Up @@ -237,7 +237,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => api.done())
.then(() => registry.done())
Expand Down Expand Up @@ -269,7 +269,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stderr).to.contain('Error: release command failed'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => expect(cli.exit.calledWith(1)).to.equal(true))
Expand Down Expand Up @@ -307,7 +307,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stderr).to.contain('Error: release command failed'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => expect(process.exit.calledWith(1)).to.equal(true))
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => api.done())
.then(() => registry.done())
Expand Down Expand Up @@ -371,7 +371,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => api.done())
.then(() => registry.done())
Expand Down Expand Up @@ -403,7 +403,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stderr).to.contain('Error: release command failed'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => expect(cli.exit.calledWith(1)).to.equal(true))
Expand Down Expand Up @@ -441,7 +441,7 @@ describe('container release', () => {

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(stdMocks.flush().stdout.join('')).to.equal('Release Output Content'))
.then(() => expect(cli.stderr).to.contain('Runnning release command...'))
.then(() => expect(cli.stderr).to.contain('Running release command...'))
.then(() => expect(cli.stderr).to.contain('Error: release command failed'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => expect(process.exit.calledWith(1)).to.equal(true))
Expand Down Expand Up @@ -471,7 +471,7 @@ describe('container release', () => {
.reply(200, {schemaVersion: 2, config: {digest: 'image_id'}})

return cmd.run({app: 'testapp', args: ['web'], flags: {}})
.then(() => expect(cli.stderr, 'not to contain', 'Runnning release command...'))
.then(() => expect(cli.stderr, 'not to contain', 'Running release command...'))
.then(() => expect(cli.stdout, 'to be empty'))
.then(() => api.done())
.then(() => registry.done())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('Sanbashi', () => {
it('has an error', async () => {
Sinon.stub(Sanbashi, 'cmd')
.withArgs('docker', ['version', '-f', '{{.Client.Version}}'], {output: true})
.resolves('an error occured')
.resolves('an error occurred')

let version = await Sanbashi.version()
expect(version).to.deep.equal([0, 0])
Expand Down
4 changes: 2 additions & 2 deletions packages/pg-v5/commands/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ async function run(context, heroku) {
return util.presentCredentialAttachments(app, credAttachments, credentials, cred)
}

credentials = await heroku.get(`/postgres/v0/databases/${addon.name}/credentials`,
credentials = await heroku.get(`/postgres/v0/databases/${addon.id}/credentials`,
{host: host(addon)})
let isDefaultCredential = cred => cred.name !== 'default'
credentials = sortBy(credentials, isDefaultCredential, 'name')
attachments = await heroku.get(`/addons/${addon.name}/addon-attachments`)
attachments = await heroku.get(`/addons/${addon.id}/addon-attachments`)

cli.warn(`${cli.color.cmd('pg:credentials')} has recently changed. Please use ${cli.color.cmd('pg:credentials:url')} for the previous output.`)
cli.table(credentials, {
Expand Down
Loading

0 comments on commit c84267e

Please sign in to comment.