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

🐛 BUG: Pub/Sub .epilogue only outputs on top-level --help #1370

Closed
elithrar opened this issue Jun 29, 2022 · 1 comment · Fixed by #1401 or #1336
Closed

🐛 BUG: Pub/Sub .epilogue only outputs on top-level --help #1370

elithrar opened this issue Jun 29, 2022 · 1 comment · Fixed by #1401 or #1336
Assignees
Labels
bug Something that isn't working

Comments

@elithrar
Copy link
Contributor

elithrar commented Jun 29, 2022

What version of Wrangler are you using?

[email protected]

What operating system are you using?

macOS

Describe the Bug

Problem: When using wrangler pubsub <subcommand>, the .epilogue() with a beta warning does not show. Instead, it does show when you use --help on second or third -level subcommands, and is invoked multiple times (once for each command in the group).

Expectation: The .epilogue(pubSubBetaWarning) is invoked once on every command under the pubsub command group

It's likely I've used .epilogue() incorrectly.

e.g.

Invoked on top-level --help multiple times

~/repos/wrangler2 (main) ✔
➜  npx wrangler@beta pubsub namespaces --help
wrangler pubsub namespaces

Manage your Pub/Sub Namespaces

Commands:
  wrangler pubsub namespaces create <name>    Create a new Pub/Sub Namespace
  wrangler pubsub namespaces list             List your existing Pub/Sub Namespaces
  wrangler pubsub namespaces delete <name>    Delete a Pub/Sub Namespace
  wrangler pubsub namespaces describe <name>  Describe a Pub/Sub Namespace

Flags:
  -c, --config   Path to .toml configuration file  [string]
  -h, --help     Show help  [boolean]
  -v, --version  Show version number  [boolean]

👷🏽 'wrangler pubsub ...' commands are currently in private beta. If your account isn't authorized, commands will fail. Visit the Pub/Sub docs for more info: https://developers.cloudflare.com/pub-sub/
👷🏽 'wrangler pubsub ...' commands are currently in private beta. If your account isn't authorized, commands will fail. Visit the Pub/Sub docs for more info: https://developers.cloudflare.com/pub-sub/
👷🏽 'wrangler pubsub ...' commands are currently in private beta. If your account isn't authorized, commands will fail. Visit the Pub/Sub docs for more info: https://developers.cloudflare.com/pub-sub/
👷🏽 'wrangler pubsub ...' commands are currently in private beta. If your account isn't authorized, commands will fail. Visit the Pub/Sub docs for more info: https://developers.cloudflare.com/pub-sub/

Not invoked at all on a second-level or third-level command

~/repos/wrangler2 (main) ✔
➜  npx wrangler@beta pubsub namespaces list --help
wrangler pubsub namespaces list

List your existing Pub/Sub Namespaces

Flags:
  -c, --config   Path to .toml configuration file  [string]
  -h, --help     Show help  [boolean]
  -v, --version  Show version number  [boolean]

Also not invoked

~/repos/wrangler2 (main) ✔
➜  npx wrangler@beta pubsub brokers describe broker --namespace=namespace
{
  id: '4c63fa30ee13414ba95be5b56d896fea',
  name: 'broker',
  description: '',
  auth_type: 'TOKEN',
  created_on: '2022-05-17T23:19:24.356324Z',
  modified_on: '2022-05-17T23:19:24.356324Z',
  on_publish: { url: 'https://pubsub-to-r2.silverlock.workers.dev' },
  endpoint: 'mqtts://broker.namespace.cloudflarepubsub.com:8883'
}
@elithrar elithrar added the bug Something that isn't working label Jun 29, 2022
@elithrar elithrar changed the title 🐛 BUG: Pub/Sub .epilogue only outputs on --help 🐛 BUG: Pub/Sub .epilogue only outputs on top-level --help Jun 29, 2022
@threepointone threepointone moved this to Untriaged in workers-sdk Jul 1, 2022
@threepointone threepointone moved this from Untriaged to Selected for development in workers-sdk Jul 1, 2022
@threepointone
Copy link
Contributor

Having a look at this today

@threepointone threepointone self-assigned this Jul 4, 2022
threepointone added a commit that referenced this issue Jul 4, 2022
This fix makes sure the pubsub beta warnings are logged consistently, once per help menu, through the hierarchy of its command tree.

This fix makes sure the pubsub beta warnings are logged consistently, once per help menu, through the hierarchy of its command tree.

Fixes #1370
threepointone added a commit that referenced this issue Jul 4, 2022
This fix makes sure the pubsub beta warnings are logged consistently, once per help menu, through the hierarchy of its command tree.

This fix makes sure the pubsub beta warnings are logged consistently, once per help menu, through the hierarchy of its command tree.

Fixes #1370
Repository owner moved this from Selected for development to Done in workers-sdk Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
2 participants