Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Change to require either app or pipeline #2907

Merged
merged 2 commits into from
Jul 2, 2024
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
2 changes: 1 addition & 1 deletion packages/cli/src/commands/ci/config/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
static flags = {
app: flags.app(),
remote: flags.remote(),
pipeline: flags.pipeline({required: true}),
pipeline: flags.pipeline({exactlyOne: ['pipeline', 'app']}),
}

static strict = false
Expand All @@ -52,7 +52,7 @@
ux.action.stop()

ux.styledObject(
Object.keys(vars).reduce((memo: Record<string, string>, key: string) => {

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, ubuntu-latest)

`Array#reduce()` is not allowed

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, ubuntu-latest)

Prefer `Object.fromEntries()` over `Array#reduce()`

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, macos-latest)

`Array#reduce()` is not allowed

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, macos-latest)

Prefer `Object.fromEntries()` over `Array#reduce()`

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, windows-latest)

`Array#reduce()` is not allowed

Check warning on line 55 in packages/cli/src/commands/ci/config/set.ts

View workflow job for this annotation

GitHub Actions / test (16.x, windows-latest)

Prefer `Object.fromEntries()` over `Array#reduce()`
memo[color.green(key)] = vars[key]
return memo
}, {}),
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/test/unit/commands/ci/config/set.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ describe('heroku ci:config:set', function () {
expect(error.message).to.equal('Usage: heroku ci:config:set KEY1 [KEY2 ...]\nMust specify KEY to set.')
})
.it('errors with example of valid args')

test
.stderr()
.command(['ci:config:set', '--', `${key}=${value}`])
.catch(error => {
expect(error.message).to.include('Exactly one of the following must be provided: --app, --pipeline')
})
.it('errors with explanation of required flags')
})
Loading