Skip to content

Commit

Permalink
fix: link to the issue chooser in GitHub (#1171)
Browse files Browse the repository at this point in the history
Previously, when an error occurs, wrangler says:

> If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.

Now, it links through to the issue template chooser which is more helpful.

Fixes [#1169](#1169)
  • Loading branch information
petebacondarwin authored Jun 2, 2022
1 parent 52c0bf0 commit de4e3c2
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 45 deletions.
13 changes: 13 additions & 0 deletions .changeset/fast-mangos-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"wrangler": patch
---

fix: link to the issue chooser in GitHub

Previously, when an error occurs, wrangler says:

> If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.
Now, it links through to the issue template chooser which is more helpful.

Fixes [#1169](https://github.com/cloudflare/wrangler2/issues/1169)
4 changes: 2 additions & 2 deletions packages/wrangler/src/__tests__/dev.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("wrangler dev", () => {

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler dev path/to/script\`) or the \`main\` config field.
Expand Down Expand Up @@ -467,7 +467,7 @@ describe("wrangler dev", () => {
expect(std.out).toMatchInlineSnapshot(`
"Running custom build: node -e \\"console.log('custom build');\\"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] The expected output file at \\"index.js\\" was not found after running custom build: node -e \\"console.log('custom build');\\".
Expand Down
16 changes: 8 additions & 8 deletions packages/wrangler/src/__tests__/kv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ describe("wrangler", () => {

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\".
Expand All @@ -685,7 +685,7 @@ describe("wrangler", () => {
);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] someBinding has both a namespace ID and a preview ID. Specify \\"--preview\\" or \\"--preview false\\" to avoid writing data to the wrong namespace.
Expand Down Expand Up @@ -856,7 +856,7 @@ describe("wrangler", () => {
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
});
});
Expand Down Expand Up @@ -1044,7 +1044,7 @@ describe("wrangler", () => {
);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\".
Expand Down Expand Up @@ -1226,7 +1226,7 @@ describe("wrangler", () => {
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.warn).toMatchInlineSnapshot(`""`);
});
Expand Down Expand Up @@ -1288,7 +1288,7 @@ describe("wrangler", () => {

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.warn).toMatchInlineSnapshot(`
"▲ [WARNING] Unexpected key-value properties in \\"keys.json\\".
Expand Down Expand Up @@ -1429,7 +1429,7 @@ describe("wrangler", () => {
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.warn).toMatchInlineSnapshot(`""`);
});
Expand All @@ -1454,7 +1454,7 @@ describe("wrangler", () => {
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.warn).toMatchInlineSnapshot(`""`);
});
Expand Down
34 changes: 17 additions & 17 deletions packages/wrangler/src/__tests__/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("pages", () => {
expect(std.out).toMatchInlineSnapshot(`
"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
});

Expand All @@ -89,7 +89,7 @@ describe("pages", () => {
expect(std.out).toMatchInlineSnapshot(`
"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
});
});
Expand Down Expand Up @@ -374,10 +374,10 @@ describe("pages", () => {
const body = init.body as FormData;
const manifest = JSON.parse(body.get("manifest") as string);
expect(manifest).toMatchInlineSnapshot(`
Object {
"/logo.png": "2082190357cfd3617ccfe04f340c6247",
}
`);
Object {
"/logo.png": "2082190357cfd3617ccfe04f340c6247",
}
`);
});

return {
Expand Down Expand Up @@ -445,10 +445,10 @@ describe("pages", () => {
const body = init.body as FormData;
const manifest = JSON.parse(body.get("manifest") as string);
expect(manifest).toMatchInlineSnapshot(`
Object {
"/logo.txt": "1a98fb08af91aca4a7df1764a2c4ddb0",
}
`);
Object {
"/logo.txt": "1a98fb08af91aca4a7df1764a2c4ddb0",
}
`);
});

return {
Expand Down Expand Up @@ -533,13 +533,13 @@ describe("pages", () => {
const body = init.body as FormData;
const manifest = JSON.parse(body.get("manifest") as string);
expect(manifest).toMatchInlineSnapshot(`
Object {
"/logo.html": "d96fef225537c9f5e44a3cb27fd0b492",
"/logo.js": "6be321bef99e758250dac034474ddbb8",
"/logo.png": "2082190357cfd3617ccfe04f340c6247",
"/logo.txt": "1a98fb08af91aca4a7df1764a2c4ddb0",
}
`);
Object {
"/logo.html": "d96fef225537c9f5e44a3cb27fd0b492",
"/logo.js": "6be321bef99e758250dac034474ddbb8",
"/logo.png": "2082190357cfd3617ccfe04f340c6247",
"/logo.txt": "1a98fb08af91aca4a7df1764a2c4ddb0",
}
`);
});

return {
Expand Down
24 changes: 12 additions & 12 deletions packages/wrangler/src/__tests__/publish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ addEventListener('fetch', event => {});`

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Processing wrangler.toml configuration:
Expand Down Expand Up @@ -1279,7 +1279,7 @@ addEventListener('fetch', event => {});`

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`main\` config field.
Expand Down Expand Up @@ -1990,7 +1990,7 @@ addEventListener('fetch', event => {});`
"Reading assets/large-file.txt...
Uploading as assets/large-file.0ea0637a45.txt...
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] File assets/too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits
Expand Down Expand Up @@ -2030,7 +2030,7 @@ addEventListener('fetch', event => {});`
expect(std.out).toMatchInlineSnapshot(`
"Reading assets/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.txt...
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] The asset path key \\"assets/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.3da0d0cd12.txt\\" exceeds the maximum key size limit of 512. See https://developers.cloudflare.com/workers/platform/limits#kv-limits\\",
Expand Down Expand Up @@ -2741,7 +2741,7 @@ addEventListener('fetch', event => {});`
expect(std.out).toMatchInlineSnapshot(`
"Running custom build: node -e \\"console.log('custom build');\\"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] The expected output file at \\"index.js\\" was not found after running custom build: node -e \\"console.log('custom build');\\".
Expand Down Expand Up @@ -2780,7 +2780,7 @@ addEventListener('fetch', event => {});`
expect(std.out).toMatchInlineSnapshot(`
"Running custom build: node -e \\"console.log('custom build');\\"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] The expected output file at \\".\\" was not found after running custom build: node -e \\"console.log('custom build');\\".
Expand Down Expand Up @@ -3589,7 +3589,7 @@ addEventListener('fetch', event => {});`
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Processing wrangler.toml configuration:
Expand Down Expand Up @@ -3688,7 +3688,7 @@ addEventListener('fetch', event => {});`
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Processing wrangler.toml configuration:
Expand Down Expand Up @@ -3822,7 +3822,7 @@ addEventListener('fetch', event => {});`
`);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Processing wrangler.toml configuration:
Expand Down Expand Up @@ -3896,7 +3896,7 @@ addEventListener('fetch', event => {});`
);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code
Expand Down Expand Up @@ -4033,7 +4033,7 @@ addEventListener('fetch', event => {});`
);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml
Expand Down Expand Up @@ -4142,7 +4142,7 @@ addEventListener('fetch', event => {});`
);
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml
Expand Down
8 changes: 4 additions & 4 deletions packages/wrangler/src/__tests__/secret.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe("wrangler secret", () => {
}
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Missing script name
Expand Down Expand Up @@ -204,7 +204,7 @@ describe("wrangler secret", () => {

expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.warn).toMatchInlineSnapshot(`""`);
});
Expand Down Expand Up @@ -372,7 +372,7 @@ describe("wrangler secret", () => {
}
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Missing script name
Expand Down Expand Up @@ -468,7 +468,7 @@ describe("wrangler secret", () => {
}
expect(std.out).toMatchInlineSnapshot(`
"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.[0m"
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m"
`);
expect(std.err).toMatchInlineSnapshot(`
"X [ERROR] Missing script name
Expand Down
Loading

0 comments on commit de4e3c2

Please sign in to comment.