Skip to content

[wrangler] adding queue notification consumer type - #15381

Closed
jkoe-cf wants to merge 7 commits into
mainfrom
jkoe/queue-notification-consumer
Closed

jkoe-cf wants to merge 7 commits into
mainfrom
jkoe/queue-notification-consumer

Conversation

@jkoe-cf

@jkoe-cf jkoe-cf commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes MQ-1430

Adds a new notification consumer type for queues


A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b395d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/deploy-helpers Minor
@cloudflare/remote-bindings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

PR #15381 adds Queue notification consumer CLI commands and display support.

  1. High queue-consumers.ts:319: removal fails when another consumer precedes the notification consumer. An inline suggestion was posted.

github run

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/autoconfig@15381

@cloudflare/build-output-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/build-output-utils@15381

@cloudflare/codemods

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/codemods@15381

@cloudflare/config

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/config@15381

@cloudflare/containers-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/containers-shared@15381

create-cloudflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/create-cloudflare@15381

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/deploy-helpers@15381

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/kv-asset-handler@15381

miniflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/miniflare@15381

@cloudflare/pages-functions

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-functions@15381

@cloudflare/pages-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-shared@15381

@cloudflare/runtime-types

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/runtime-types@15381

@cloudflare/test-server

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/test-server@15381

@cloudflare/unenv-preset

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/unenv-preset@15381

@cloudflare/vite-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vite-plugin@15381

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vitest-plugin@15381

@cloudflare/workers-auth

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-auth@15381

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-editor-shared@15381

@cloudflare/workers-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-utils@15381

wrangler

npm i https://pkg.pr.new/cloudflare/workers-sdk/wrangler@15381

commit: 3b395d5

@jkoe-cf jkoe-cf changed the title adding queue notification consumer type [wrangler] adding queue notification consumer type Sep 14, 2026
@jkoe-cf
jkoe-cf force-pushed the jkoe/queue-notification-consumer branch from 52da7cd to 20c70b4 Compare September 16, 2026 23:55
@jkoe-cf
jkoe-cf marked this pull request as ready for review September 16, 2026 23:55
@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team September 16, 2026 23:55
@workers-devprod

workers-devprod commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 2 potential issues.

Devin Review

Comment on lines +7 to +13
export const queuesConsumerNotificationAddCommand = createCommand({
metadata: {
description: "Add a Queue Notification Consumer",
owner: "Product: Queues",
status: "stable",
},
behaviour: { supportTemporary: true },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Notification rollout skips validation flag

The new commands launch as stable without an experimental flag. Wrangler guidance requires new stable-command features to begin behind such a flag.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@jkoe-cf
jkoe-cf force-pushed the jkoe/queue-notification-consumer branch from 20c70b4 to d9f3fb1 Compare September 17, 2026 00:02
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
@jkoe-cf
jkoe-cf force-pushed the jkoe/queue-notification-consumer branch from d9f3fb1 to f6e680a Compare September 17, 2026 00:16
@jkoe-cf
jkoe-cf marked this pull request as draft September 17, 2026 00:29
@jkoe-cf
jkoe-cf marked this pull request as ready for review September 18, 2026 21:20
@cjol cjol self-assigned this Sep 21, 2026

@cjol cjol left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy for this to merge when you're ready. Just one minor nit, and Devin's comment which I've messaged you separately about (for posterity, if Queue notification consumers are still in beta as a product, I'd expect a different status in queuesConsumerNotificationAddCommand)

edit: Also some lint failures in CI to solve please!

webhooks: toEntries(webhook),
},
dead_letter_queue: args.deadLetterQueue,
} as PostTypedConsumerBody;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: satisfies PostTypedConsumerBody would let the type-checker protect you from mistakes in this object

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@jkoe-cf
jkoe-cf marked this pull request as draft September 24, 2026 21:29
@NuroDev
NuroDev removed their request for review October 16, 2026 10:31
@NuroDev
NuroDev requested a review from cjol October 16, 2026 10:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 7 new potential issues.

Devin Review

Comment on lines +345 to +346
const queue = await getQueue(complianceConfig, accountId, queueName);
const consumer = queue.consumers.find((c) => c.type === "notification");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Empty queue names target another queue

An empty queue name makes deleteNotificationConsumer target the account’s first returned queue and delete its notification consumer, if present. getQueue selects the first result without a name filter. Notification add and list also target that queue.

Learn more

The CLI accepts a quoted empty string for a required string positional. The queue lookup adds a name filter only for a truthy name, then returns the first queue in the response. The removal helper uses that queue’s ID for deletion. Notification add and notification list reach the same lookup through their client helpers.

Example: A deployment script runs wrangler queues consumer notification remove "$QUEUE_NAME" with an unset variable. If the first listed queue is billing-events and it has a notification consumer, Wrangler deletes that consumer instead of rejecting the empty name.

Recommended fix: Reject an empty queue name in getQueue before calling listQueues. Keep unnamed calls to listQueues working for account-wide listing. Add a CLI regression test that passes an explicit empty positional and asserts that Wrangler makes no queue API calls.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

metadata: {
description: "Configure Queue Notification Consumers",
owner: "Product: Queues",
status: "stable",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Beta feature advertised as stable

The changeset calls notification consumers beta, but queuesConsumerNotificationNamespace and all three commands declare stable. The command registry therefore omits beta labels from help.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

queueName: string
): Promise<void> {
const queue = await getQueue(complianceConfig, accountId, queueName);
const consumer = queue.consumers.find((c) => c.type === "notification");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Removal depends on consumer uniqueness

deleteNotificationConsumer selects the first match, while the notification list returns every match. Verify that the API permits at most one notification consumer per queue.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.


Add Queue notification consumer commands

Wrangler can now add, list, and remove Queue notification consumers configured with email, PagerDuty, or webhook destinations. The supporting deploy helpers expose notification consumer settings and deletion behavior. Queue notification consumers are currently in beta.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Missing notification command examples

The changeset introduces three commands without the usage examples requested by Wrangler’s changeset guidance.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +340 to +344
export async function deleteNotificationConsumer(
complianceConfig: ComplianceConfig,
accountId: string,
queueName: string
): Promise<void> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Undocumented notification removal contract

deleteNotificationConsumer and its Wrangler wrapper lack the required export JSDoc. Document the queue scope and the error for a missing notification consumer.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

import { listConsumers } from "../../../../client";
import type { Consumer } from "../../../../client";

export function mapNotificationConsumerForDisplay(consumer: Consumer) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Undocumented notification table mapper

mapNotificationConsumerForDisplay lacks the required export JSDoc. Document its notification-only input and how it displays missing destinations.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +25 to +29
pagerduty: {
type: "string",
array: true,
description: "PagerDuty integration keys for notifications",
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 PagerDuty keys in session output

When session output is enabled, --pagerduty writes raw integration keys into the session file. redactEventCode only masks event codes. Anyone who reads the file can use those keys to submit PagerDuty events.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@NuroDev

NuroDev commented Nov 26, 2026

Copy link
Copy Markdown
Member

@jkoe-cf is this PR still relevant and being worked on?
If so, can we make this PR ready for review and resolve the final outstanding comments.

@jkoe-cf

jkoe-cf commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Nope no longer needed, will close

@jkoe-cf jkoe-cf closed this Nov 26, 2026
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants