Skip to content

Commit

Permalink
Revert "new metadata binding type" (#2156)
Browse files Browse the repository at this point in the history
* Revert "new metadata binding type (#2096)"

This reverts commit e7a0cd5.

* Revert metabindings & polish deployments
metabindings is going to be revisited. Minor tweaks to deployments to
improve the information being given to the user.
  • Loading branch information
JacobMGEvans authored Nov 10, 2022
1 parent e7a0cd5 commit f931595
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 265 deletions.
19 changes: 0 additions & 19 deletions .changeset/rich-bears-press.md

This file was deleted.

3 changes: 1 addition & 2 deletions packages/wrangler/src/__tests__/api-devregistry.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { unstable_dev } from "../api";
import { fetch } from "undici";

jest.unmock("undici");
// jest.unmock("undici");

//TODO Fix Tests extremely flakey
/**
* a huge caveat to how testing multi-worker scripts works:
* you can't shutdown the first worker you spun up, or it'll kill the devRegistry
Expand Down
47 changes: 0 additions & 47 deletions packages/wrangler/src/__tests__/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ describe("normalizeAndValidateConfig()", () => {
dispatch_namespaces: [],
usage_model: undefined,
vars: {},
metadata_binding: undefined,
define: {},
wasm_modules: undefined,
data_blobs: undefined,
Expand Down Expand Up @@ -2490,7 +2489,6 @@ describe("normalizeAndValidateConfig()", () => {
minify: false,
node_compat: false,
first_party_worker: false,
metadata_binding: "METADATA_ENV",
logpush: false,
};
const rawConfig: RawConfig = {
Expand All @@ -2515,7 +2513,6 @@ describe("normalizeAndValidateConfig()", () => {
minify: true,
node_compat: true,
first_party_worker: true,
metadata_binding: "METADATA_RAW",
logpush: true,
env: {
ENV1: rawEnv,
Expand Down Expand Up @@ -2701,15 +2698,13 @@ describe("normalizeAndValidateConfig()", () => {
const kv_namespaces: RawConfig["kv_namespaces"] = [];
const r2_buckets: RawConfig["r2_buckets"] = [];
const unsafe: RawConfig["unsafe"] = { bindings: [] };
const metadata_binding: RawConfig["metadata_binding"] = "";
const rawConfig: RawConfig = {
define,
vars,
durable_objects,
kv_namespaces,
r2_buckets,
unsafe,
metadata_binding,
env: {
ENV1: {},
},
Expand Down Expand Up @@ -2739,9 +2734,6 @@ describe("normalizeAndValidateConfig()", () => {
- \\"vars\\" exists at the top level, but not on \\"env.ENV1\\".
This is not what you probably want, since \\"vars\\" is not inherited by environments.
Please add \\"vars\\" to \\"env.ENV1\\".
- \\"metadata_binding\\" exists at the top level, but not on \\"env.ENV1\\".
This is not what you probably want, since \\"metadata_binding\\" is not inherited by environments.
Please add \\"metadata_binding\\" to \\"env.ENV1\\".
- \\"define\\" exists at the top level, but not on \\"env.ENV1\\".
This is not what you probably want, since \\"define\\" is not inherited by environments.
Please add \\"define\\" to \\"env.ENV1\\".
Expand Down Expand Up @@ -3979,45 +3971,6 @@ describe("normalizeAndValidateConfig()", () => {
expect(result2.diagnostics.hasWarnings()).toBe(false);
});
});
describe("[metadata_binding]", () => {
it("should error if metadata_binding is a number", () => {
const { diagnostics } = normalizeAndValidateConfig(
{ env: { ENV1: { metadata_binding: 999 } } } as unknown as RawConfig,
undefined,
{ env: "ENV1" }
);

expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
"
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- \\"env.ENV1\\" environment configuration
- Expected \\"metadata_binding\\" to be of type string but got 999."
`);
});

it("should error if metadata_binding is null", () => {
const { diagnostics } = normalizeAndValidateConfig(
{ env: { ENV1: { metadata_binding: null } } } as unknown as RawConfig,
undefined,
{ env: "ENV1" }
);

expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
"
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- \\"env.ENV1\\" environment configuration
- Expected \\"metadata_binding\\" to be of type string but got null."
`);
});
});
});
});

Expand Down
4 changes: 0 additions & 4 deletions packages/wrangler/src/__tests__/deployments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ describe("deployments", () => {
Deployment ID: Intrepid-Class
Deployment number: NCC-74656
Created on: 2021-02-02T00:00:00.000000Z
Author: [email protected]
Source: Wrangler
Deployment ID: Galaxy-Class
Deployment number: 1701-E
Created on: 2021-01-01T00:00:00.000000Z
Author: [email protected]
Source: Wrangler
Expand All @@ -79,13 +77,11 @@ describe("deployments", () => {
Deployment ID: Intrepid-Class
Deployment number: NCC-74656
Created on: 2021-02-02T00:00:00.000000Z
Author: [email protected]
Source: Wrangler
Deployment ID: Galaxy-Class
Deployment number: 1701-E
Created on: 2021-01-01T00:00:00.000000Z
Author: [email protected]
Source: Wrangler
Expand Down
Loading

0 comments on commit f931595

Please sign in to comment.