denoland / denoland/deploy_feedback

[Bug]: Promoting a deployment to production doesn't enable queues

Open
#894 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Problem description

This might be the intended behavior – but, as a newcomer to the platform, I found this confusing:

I'm not sure if "preview deployments" that have been "promoted to production" are meant to be different from or the same as "production deployments", but it appears to me that the "queues" feature is only available if a deployment is deployed as a production deployment (ie with the `--prod` flag), as opposed to being deployed without the `--prod` flag and then "promoted" via the Deno Deploy web UI.

```
Queues are not supported for preview deployments. Enqueued messages will be dropped.
```

### Steps to reproduce

# 1. Create a simple script, e.g.:

Taken from [here](https://docs.deno.com/deploy/kv/tutorials/webhook_processor/)

```TypeScript
const kv = await Deno.openKv();

kv.listenQueue(async (message) => {
console.log("LISTENER GOT MESSAGE:", message);
await kv.set(["queue", Date.now()], message);
});

Deno.serve(async (req: Request) => {
if (req.method === "POST") {
const payload = await req.json();
console.log("Received webhook with payload:", payload);
await kv.enqueue(payload);
return new Response("", { status: 200 })
} else {
const iter = kv.list({ prefix: ["queue"] });
const stuff = [];
for await (const res of iter) stuff.push({
timestamp: res.key[1],
payload: res.value,
});
return new Response(JSON.stringify(stuff, null, 2));
}
});
```

# 2. Deploy without the `--prod` flag

`$ deployctl deploy`

# 3. Promote the deployment to production from the web UI

From https://dash.deno.com/projects/project-name, click the three dots next to a deployment and then `Promote to production`. In the logs, one will continue to see the message

```
Queues are not supported for preview deployments. Enqueued messages will be dropped.
```

And the queue feature will not be enabled.

### Expected behavior

I expected (perhaps erroneously) for the 'queues' feature to be enabled after a deployment was promoted a to production.

### Environment

```
% deno --version
deno 2.4.2 (stable, release, aarch64-apple-darwin)
v8 13.7.152.14-rusty
typescript 5.8.3

% deployctl --version
deployctl 1.13.1
```

### Possible solution

The queues feature appears to work as expected if a deployment is deployed initially as a production deployment (ie with the `--prod` flag). If that's intended behavior, maybe a little note could be appended to the "queues are not supported" message.

### Additional context

Apologies if this is on me. I'm liking the platform in general!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.