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

Prevent spaces in names #5738

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented May 1, 2024

What this PR solves / how to test

Fixes #4229

Author has addressed the following

@penalosa penalosa requested a review from a team as a code owner May 1, 2024 17:47
@penalosa penalosa linked an issue May 1, 2024 that may be closed by this pull request
Copy link

changeset-bot bot commented May 1, 2024

🦋 Changeset detected

Latest commit: 25d04ad

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

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers 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

Copy link
Contributor

github-actions bot commented May 1, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-wrangler-5738

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5738/npm-package-wrangler-5738

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-wrangler-5738 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-create-cloudflare-5738 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-cloudflare-kv-asset-handler-5738
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-miniflare-5738
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-cloudflare-pages-shared-5738
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-cloudflare-vitest-pool-workers-5738
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-cloudflare-workers-editor-shared-5738
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10581574244/npm-package-cloudflare-workers-shared-5738

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.72.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240821.0
workerd 1.20240821.1 1.20240821.1
workerd --version 1.20240821.1 2024-08-21

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@petebacondarwin petebacondarwin marked this pull request as draft May 13, 2024 06:41
@penalosa penalosa marked this pull request as ready for review June 3, 2024 09:36
@penalosa penalosa closed this Jun 3, 2024
@penalosa penalosa reopened this Jun 3, 2024
@petebacondarwin petebacondarwin marked this pull request as draft June 5, 2024 11:34
@penalosa penalosa force-pushed the 4229-bug-websocket-connection-closed-before-connection-established branch from 4c19481 to cdb8e09 Compare July 19, 2024 10:14
@penalosa penalosa marked this pull request as ready for review August 27, 2024 14:04
@@ -236,7 +236,7 @@ export const isString: ValidatorFn = (diagnostics, field, value) => {
*/
export const isValidName: ValidatorFn = (diagnostics, field, value) => {
if (
(typeof value === "string" && /^$|^[a-z0-9_ ][a-z0-9-_ ]*$/.test(value)) ||
(typeof value === "string" && /^$|^[a-z0-9_][a-z0-9-_]*$/.test(value)) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Change looks good. Maybe a good time to add some unit tests here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've adapted the existing test to ensure it catches this case

@@ -1123,7 +1123,7 @@ describe("normalizeAndValidateConfig()", () => {
describe("name", () => {
it("should error on invalid `name` value with spaces", () => {
const expectedConfig: RawEnvironment = {
name: "NCC 1701 D",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously this was tripping the uppercase validation, and so the fact that the spaces validation didn't work was missed

@penalosa penalosa requested review from andyjessop and a team August 27, 2024 16:56
@penalosa penalosa merged commit c2460c4 into main Aug 27, 2024
21 checks passed
@penalosa penalosa deleted the 4229-bug-websocket-connection-closed-before-connection-established branch August 27, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🐛 BUG: websocket connection closed before connection established
2 participants