From 9931545f967c19bf59a8ca817426f6773a5ae043 Mon Sep 17 00:00:00 2001 From: "vercel[bot]" <35613825+vercel[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 16:34:01 +0000 Subject: [PATCH 1/2] fix(cli): suggest a channel on the team's board when a plan has no room for a named one --- .changeset/too-many-boards-channel.md | 5 +++++ packages/board/src/cli/main.ts | 20 ++++++++++++++++++-- packages/board/test/cli-embedded.test.ts | 22 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .changeset/too-many-boards-channel.md diff --git a/.changeset/too-many-boards-channel.md b/.changeset/too-many-boards-channel.md new file mode 100644 index 000000000..a9ca23f71 --- /dev/null +++ b/.changeset/too-many-boards-channel.md @@ -0,0 +1,5 @@ +--- +'@vercel/board': patch +--- + +When a team's plan has no room for a named board (`too_many_boards`), the CLI now also suggests making a channel for it on the team's board, with the `channels create` command. diff --git a/packages/board/src/cli/main.ts b/packages/board/src/cli/main.ts index 174035a2e..d38aaed9d 100644 --- a/packages/board/src/cli/main.ts +++ b/packages/board/src/cli/main.ts @@ -1015,9 +1015,15 @@ function failureOf(error: unknown): Failure { { instruction: "Or the team's own board, which it posts to and changes the grants of", argv: [...rerunWithout(['--name']).filter((arg) => arg !== '--ensure'), '--name', 'General'] }, ] : flags.name !== undefined - ? [{ instruction: "Use the team's board instead", argv: rerunWithout(['--name']).filter((arg) => arg !== '--ensure') }] + ? [ + { instruction: "Use the team's board instead", argv: rerunWithout(['--name']).filter((arg) => arg !== '--ensure') }, + { instruction: "Or give it a channel of its own on the team's board", argv: channelFor(flags.name) }, + ] : process.env.BOARD_NAME - ? [{ instruction: "Use the team's board instead: unset BOARD_NAME, then run", argv: rerunWithout([]).filter((arg) => arg !== '--ensure') }] + ? [ + { instruction: "Use the team's board instead: unset BOARD_NAME, then run", argv: rerunWithout([]).filter((arg) => arg !== '--ensure') }, + { instruction: "Or give it a channel of its own on the team's board: unset BOARD_NAME, then run", argv: channelFor(process.env.BOARD_NAME) }, + ] : [], ) if (code === 'private_boards_unavailable') @@ -1083,6 +1089,16 @@ function failureOf(error: unknown): Failure { } /** The options that say which board this run is on, and as whom, as typed: what a way out to another command keeps. */ +/** A channel on the team's own board, in place of the board a plan has no room for. */ +const channelFor = (name: string): string[] => [ + ...cli(), + 'channels', + 'create', + name, + ...((flags.scope ?? flags.team) !== undefined ? ['--scope', (flags.scope ?? flags.team)!] : []), + ...(flags.as ? ['--as', flags.as] : []), +] + const onThisBoard = (): string[] => [ ...(flags.url !== undefined ? ['--url', flags.url] : []), ...((flags.scope ?? flags.team) !== undefined ? ['--scope', (flags.scope ?? flags.team)!] : []), diff --git a/packages/board/test/cli-embedded.test.ts b/packages/board/test/cli-embedded.test.ts index 9dff1e258..36e0d312d 100644 --- a/packages/board/test/cli-embedded.test.ts +++ b/packages/board/test/cli-embedded.test.ts @@ -1053,6 +1053,28 @@ describe('the embedded CLI', () => { } }) + it("offers a channel on the team's board when the plan has no room for a named one", async () => { + const home = await isolated() + vi.stubEnv('VERCEL_AUTH_TOKEN', 'user:u_jb') + vi.stubEnv('VERCEL_ORG_ID', 'team_test') + const api = fakeMessageboard({ oneBoard: true }) + const fetching = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input, init) => api.fetch(input, init)) + const run = (...args: string[]) => capture(() => main(args, { name: 'board', commands: local })) + const cwd = process.cwd() + process.chdir(home) + try { + const said = await run('post', 'general', 'hi', '--scope', 'test', '--name', 'scratch', '--ensure') + expect(said).toMatchObject({ code: 1, stdout: '' }) + expect(said.stderr).toContain('The team has all the boards it can.') + expect(said.stderr).toContain(' vb post general hi --scope test\n') + expect(said.stderr).toContain(' vb channels create scratch --scope test\n') + } finally { + fetching.mockRestore() + process.chdir(cwd) + await rm(home, { recursive: true, force: true }) + } + }) + it('tells a project it has no access to a board, and who fixes that', async () => { const home = await isolated() vi.stubEnv('VERCEL_AUTH_TOKEN', 'project:prj_pong:preview') From 47e802cd658f3ecf04a962cd685f5881091363d5 Mon Sep 17 00:00:00 2001 From: "vercel[bot]" <35613825+vercel[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 16:40:39 +0000 Subject: [PATCH 2/2] fix(cli): suggest a valid channel path for any board name --- packages/board/src/cli/main.ts | 8 +++++++- packages/board/test/cli-embedded.test.ts | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/board/src/cli/main.ts b/packages/board/src/cli/main.ts index d38aaed9d..000334cdb 100644 --- a/packages/board/src/cli/main.ts +++ b/packages/board/src/cli/main.ts @@ -1094,7 +1094,13 @@ const channelFor = (name: string): string[] => [ ...cli(), 'channels', 'create', - name, + // A board's name can be `My Board`; a channel's path is lowercase segments, such as `my-board`. + name + .normalize('NFKD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .replace(/[^a-z0-9_-]+/g, '-') + .replace(/^[^a-z0-9]+|-+$/g, '') || '', ...((flags.scope ?? flags.team) !== undefined ? ['--scope', (flags.scope ?? flags.team)!] : []), ...(flags.as ? ['--as', flags.as] : []), ] diff --git a/packages/board/test/cli-embedded.test.ts b/packages/board/test/cli-embedded.test.ts index 36e0d312d..f93332e4f 100644 --- a/packages/board/test/cli-embedded.test.ts +++ b/packages/board/test/cli-embedded.test.ts @@ -1068,6 +1068,8 @@ describe('the embedded CLI', () => { expect(said.stderr).toContain('The team has all the boards it can.') expect(said.stderr).toContain(' vb post general hi --scope test\n') expect(said.stderr).toContain(' vb channels create scratch --scope test\n') + // A board's name can hold what a channel's path can't. + expect((await run('post', 'general', 'hi', '--scope', 'test', '--name', 'My Board', '--ensure')).stderr).toContain(' vb channels create my-board --scope test\n') } finally { fetching.mockRestore() process.chdir(cwd)