Public: anyone can read this; the crew can change it.
Hetzner places: read stock from server_types and cities from locations, since /datacenters answers 410 #16509
Check · Review · Land · Live done — Landed and live in production.
sold/hetzner-places → main 0 commits 1 thread · 1 unresolved
9 files
changed +75
−32
docs/features/cloud.md +1 −1
| @@ -23,7 +23,7 @@ Not done: the route only lists. Attaching, rotating and removing stay on the pag | ||
| 23 | 23 | |
| 24 | 24 | `GET /api/v1/places` lists where a forge can run: provider + datacenter + machine size, each with vCPU, memory, disk, included traffic, city and country, `costCents` (machine + the 10 GiB volume + a public address, US dollars a month), the vendor's own `price` and the rate that converted it, `readAt`, `orderable` and, when not, `why`. Filters: `plan`, `provider`, `country`. `defaults` names each plan's default place and says why; the rule is: the cheapest place in the United States that can be ordered now and meets the plan's minimum, among providers with an account that allows writes (a provider with no such place in the United States falls back to its cheapest place anywhere); `PUT /api/v1/places/pin` (admin) pins one instead. |
| 25 | 25 | |
| 26 | - Prices come from the provider's API (Hetzner `/pricing`, `/server_types`, `/datacenters`; DigitalOcean `/sizes`, `/regions`) and are kept as the provider answered, so the dollars are derived at read time. A failed read keeps the last good one. Typed in by hand, and said so: DigitalOcean's block storage price (its API has none) and its regions' countries. | |
| 26 | - Prices come from the provider's API (Hetzner `/pricing`, `/server_types`, which carries each size's stock and price for every location, and `/locations` for the city and country; DigitalOcean `/sizes`, `/regions`) and are kept as the provider answered, so the dollars are derived at read time. A failed read keeps the last good one. Typed in by hand, and said so: DigitalOcean's block storage price (its API has none) and its regions' countries. | |
| 27 | 27 | - Every amount a person sees is dollars. A vendor billing in euro is converted at the European Central Bank's daily reference rate (`src/cloud/rates.ts`, no key), kept with its date; if the fetch fails the last good rate stands and the answer carries `rate.ageDays`. All conversion is `toUsd` in `src/cloud/prices.ts`; money that guards spending rounds `up`. |
| 28 | 28 | - A refresh runs when a forge administrator reads the catalog with a write-scoped token and a read is over six hours old; a read-only token gets the kept catalog and starts no vendor call, since every vendor call is audited. One refresh runs at a time, every concurrent read waits on it, and a provider is tried again no sooner than five minutes after its last try, whether or not it answered. A vendor's answer is read to at most 2 MB. No timer yet. |
| 29 | 29 | - `PUT /api/v1/places/pin` takes `{plan, place}` (an empty place clears the pin) and answers the validated plan and place; a place id over 200 characters is a `422`. A member is refused (`403` by the admin gate), and a pin is announced as `cloud.place_pinned`, which an admin's web session hears live. |
docs/features/deploy-to-hetzner.md +2 −2
| @@ -22,7 +22,7 @@ A pinned forge can run in your own Hetzner Cloud project the way it runs on Digi | ||
| 22 | 22 | |
| 23 | 23 | ## When the place is not orderable |
| 24 | 24 | |
| 25 | A place the catalog says is sold out, unknown, or another provider's stops the deploy **before it makes anything** and says so ("hetzner:nbg1:cx23 cannot be ordered now: sold out at this datacenter right now"). A replace of a running forge whose recorded place has since sold out is refused the same way, with the running server untouched. Nothing is billed; pick another place or try again later. | |
| 25 | A place the catalog says is sold out, unknown, or another provider's stops the deploy **before it makes anything** and says so ("hetzner:nbg1:cx23 cannot be ordered now: sold out at this location right now"). A replace of a running forge whose recorded place has since sold out is refused the same way, with the running server untouched. Nothing is billed; pick another place or try again later. | |
| 26 | 26 | |
| 27 | 27 | ## The audit |
| 28 | 28 | |
| @@ -30,4 +30,4 @@ Cloud accounts → Audit lists a Hetzner volume attached to no server, and a pow | ||
| 30 | 30 | |
| 31 | 31 | ## Not checked here |
| 32 | 32 | |
| 33 | The `/server_types` price shape and `/datacenters` `server_types.available` that the Places catalog reads were written from the Hetzner API reference as recalled; this sandbox cannot reach docs.hetzner.cloud, so a first real deploy is the check. A shape that differs leaves the place unlisted, and a deploy to it is refused rather than ordering a guess. | |
| 33 | The Places catalog reads `/server_types` (each size's `locations[].available` stock and `prices` per location), `/locations` (city and country) and `/pricing` (volume and address). Hetzner removed `/datacenters` on 2026-06-02, so it is not called. Hetzner's server create takes `location`, which the driver sends. A shape that differs leaves the place unlisted, and a deploy to it is refused rather than ordering a guess. |
src/cloud/places.ts +16 −12
| @@ -60,12 +60,13 @@ const unorderable = (p: Omit<Place, "orderable" | "why">, why: string): Place => | ||
| 60 | 60 | const ARM_WHY = "an ARM size; the forge runs on x86 machines only"; |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | * Hetzner: server types, per-location stock, and the account's pricing. Hetzner bills the account | |
| 63 | * Hetzner: server types (each carries its stock and price per location), the locations, and the | |
| 64 | * account's pricing for the volume and address. Hetzner bills the account | |
| 64 | 65 | * in `pricing.currency`; anything but USD is converted at `rate` and kept beside the dollars. A |
| 65 | 66 | * type with no price for a location is not a place there. |
| 66 | 67 | */ |
| 67 | 68 | export function hetznerPlaces( |
| 68 | body: { server_types: unknown; datacenters: unknown; pricing: unknown }, | |
| 69 | body: { server_types: unknown; locations: unknown; pricing: unknown }, | |
| 69 | 70 | rate: Rate | undefined, |
| 70 | 71 | readAt: string, |
| 71 | 72 | ): Place[] { |
| @@ -73,20 +74,17 @@ export function hetznerPlaces( | ||
| 73 | 74 | const currency = str(pricing.currency, 3).toUpperCase() || "EUR"; |
| 74 | 75 | const gb = num(pricing.volume?.price_per_gb_month?.gross); |
| 75 | 76 | const ipv4 = (loc: string) => num(arr(pricing.primary_ips).find((x) => x?.type === "ipv4")?.prices?.find((q: any) => q?.location === loc)?.price_monthly?.gross); |
| 76 | const stocked = new Map<string, Set<number>>(); | |
| 77 | const where = new Map<string, { city: string; country: string }>(); | |
| 78 | for (const d of arr(body.datacenters)) { | |
| 79 | const name = str(d?.location?.name); | |
| 77 | // A location is a place only when /locations names it; a deprecated one is listed, not orderable. | |
| 78 | const where = new Map<string, { city: string; country: string; retired: boolean }>(); | |
| 79 | for (const l of arr(body.locations)) { | |
| 80 | const name = str(l?.name); | |
| 80 | 81 | if (!SLUG.test(name)) continue; |
| 81 | where.set(name, { city: str(d.location.city), country: str(d.location.country, 2).toUpperCase() }); | |
| 82 | const set = stocked.get(name) ?? new Set<number>(); | |
| 83 | for (const id of arr(d?.server_types?.available)) set.add(Number(id)); | |
| 84 | stocked.set(name, set); | |
| 82 | where.set(name, { city: str(l.city), country: str(l.country, 2).toUpperCase(), retired: l.deprecation != null }); | |
| 85 | 83 | } |
| 86 | 84 | const out: Place[] = []; |
| 87 | 85 | for (const t of arr(body.server_types)) { |
| 88 | 86 | const size = str(t?.name); |
| 89 | if (!SLUG.test(size) || t.deprecated) continue; | |
| 87 | if (!SLUG.test(size)) continue; | |
| 90 | 88 | // The machine boots an x86 image and an x86 build of Bun: an ARM size is listed, and says why not. |
| 91 | 89 | const arm = t.architecture !== "x86"; |
| 92 | 90 | for (const pr of arr(t.prices)) { |
| @@ -94,6 +92,7 @@ export function hetznerPlaces( | ||
| 94 | 92 | const here = where.get(loc); |
| 95 | 93 | const machine = num(pr?.price_monthly?.gross); |
| 96 | 94 | if (!here || !Number.isFinite(machine)) continue; |
| 95 | const stock = arr(t.locations).find((x) => x?.name === loc); | |
| 97 | 96 | const parts = machine + (Number.isFinite(gb) ? gb * VOLUME_GIB : NaN) + ipv4(loc); |
| 98 | 97 | const base = { |
| 99 | 98 | id: `hetzner:${loc}:${size}`, provider: "hetzner", datacenter: loc, city: here.city, country: here.country, size, |
| @@ -111,7 +110,12 @@ export function hetznerPlaces( | ||
| 111 | 110 | continue; |
| 112 | 111 | } |
| 113 | 112 | const place = { ...base, costCents: price.usdCents, price }; |
| 114 | out.push(arm ? unorderable(place, ARM_WHY) : stocked.get(loc)?.has(Number(t.id)) ? { ...place, orderable: true, why: "" } : unorderable(place, "sold out at this datacenter right now")); | |
| 113 | out.push( | |
| 114 | arm ? unorderable(place, ARM_WHY) | |
| 115 | : t.deprecation != null || stock?.deprecation != null || here.retired ? unorderable(place, "Hetzner is retiring this size or location") | |
| 116 | : stock && stock.available !== false ? { ...place, orderable: true, why: "" } | |
| 117 | : unorderable(place, "sold out at this location right now"), | |
| 118 | ); | |
| 115 | 119 | } |
| 116 | 120 | } |
| 117 | 121 | return out; |
src/cloud/places_read.ts +2 −2
| @@ -31,7 +31,7 @@ const table = (db: Database) => { | ||
| 31 | 31 | const API: Readonly<Record<string, { base: string; paths: Readonly<Record<string, string>> }>> = { |
| 32 | 32 | hetzner: { |
| 33 | 33 | base: "https://api.hetzner.cloud/v1", |
| 34 | paths: { server_types: "/server_types?per_page=50", datacenters: "/datacenters?per_page=50", pricing: "/pricing" }, | |
| 34 | paths: { server_types: "/server_types?per_page=50", locations: "/locations?per_page=50", pricing: "/pricing" }, | |
| 35 | 35 | }, |
| 36 | 36 | digitalocean: { |
| 37 | 37 | base: "https://api.digitalocean.com/v2", |
| @@ -56,7 +56,7 @@ export async function readPlaces(db: Database, provider: string, f: Fetch, token | ||
| 56 | 56 | body[key] = JSON.parse(new TextDecoder().decode(bytes)); |
| 57 | 57 | } |
| 58 | 58 | const flat = provider === "hetzner" |
| 59 | ? { server_types: (body.server_types as any)?.server_types, datacenters: (body.datacenters as any)?.datacenters, pricing: body.pricing } | |
| 59 | ? { server_types: (body.server_types as any)?.server_types, locations: (body.locations as any)?.locations, pricing: body.pricing } | |
| 60 | 60 | : { sizes: (body.sizes as any)?.sizes, regions: (body.regions as any)?.regions }; |
| 61 | 61 | const text = JSON.stringify(flat); |
| 62 | 62 | if (text.length > MAX_BODY) return false; |
test/helpers/places-fixture.ts +13 −9
| @@ -5,14 +5,18 @@ import { refreshRate } from "../../src/cloud/rates.ts"; | ||
| 5 | 5 | /** What Hetzner and DigitalOcean answer, as much as places read (#16203). */ |
| 6 | 6 | export const hetzner = { |
| 7 | 7 | server_types: [ |
| 8 | { id: 1, name: "cpx21", cores: 3, memory: 4, disk: 80, architecture: "x86", prices: [ | |
| 9 | { location: "ash", price_monthly: { gross: "10.00" }, included_traffic: 2 ** 40 }, | |
| 10 | { location: "nbg1", price_monthly: { gross: "5.00" }, included_traffic: 2 ** 43 }] }, | |
| 11 | { id: 2, name: "cpx11", cores: 2, memory: 2, disk: 40, architecture: "x86", prices: [{ location: "ash", price_monthly: { gross: "4.00" } }] }, | |
| 8 | { id: 1, name: "cpx21", cores: 3, memory: 4, disk: 80, architecture: "x86", deprecation: null, | |
| 9 | locations: [{ id: 3, name: "ash", available: true, recommended: false, deprecation: null }, { id: 2, name: "nbg1", available: true, recommended: false, deprecation: null }], | |
| 10 | prices: [ | |
| 11 | { location: "ash", price_monthly: { gross: "10.00" }, included_traffic: 2 ** 40 }, | |
| 12 | { location: "nbg1", price_monthly: { gross: "5.00" }, included_traffic: 2 ** 43 }] }, | |
| 13 | { id: 2, name: "cpx11", cores: 2, memory: 2, disk: 40, architecture: "x86", deprecation: null, | |
| 14 | locations: [{ id: 3, name: "ash", available: false, recommended: false, deprecation: null }], | |
| 15 | prices: [{ location: "ash", price_monthly: { gross: "4.00" } }] }, | |
| 12 | 16 | ], |
| 13 | datacenters: [ | |
| 14 | { location: { name: "ash", city: "Ashburn, VA", country: "us" }, server_types: { available: [1] } }, | |
| 15 | { location: { name: "nbg1", city: "Nuremberg", country: "DE" }, server_types: { available: [1] } }, | |
| 17 | locations: [ | |
| 18 | { id: 3, name: "ash", city: "Ashburn, VA", country: "us" }, | |
| 19 | { id: 2, name: "nbg1", city: "Nuremberg", country: "DE" }, | |
| 16 | 20 | ], |
| 17 | 21 | pricing: { pricing: { currency: "EUR", volume: { price_per_gb_month: { gross: "0.05" } }, primary_ips: [{ type: "ipv4", prices: [{ location: "ash", price_monthly: { gross: "0.50" } }, { location: "nbg1", price_monthly: { gross: "0.50" } }] }] } }, |
| 18 | 22 | }; |
| @@ -38,14 +42,14 @@ export async function seedHetzner(db: Database, available: number[] = [1, 2, 5, | ||
| 38 | 42 | { id: 2, name: "cx23", cores: 2, memory: 4, disk: 40, architecture: "x86", prices: eur("5.99") }, |
| 39 | 43 | { id: 5, name: "cx33", cores: 4, memory: 8, disk: 80, architecture: "x86", prices: eur("8.99") }, |
| 40 | 44 | { id: 7, name: "cax21", cores: 4, memory: 8, disk: 80, architecture: "arm", prices: eur("6.49") }, |
| 41 | ]; | |
| 45 | ].map((t) => ({ ...t, deprecation: null, locations: [{ id: 2, name: "nbg1", available: available.includes(t.id), recommended: false, deprecation: null }] })); | |
| 42 | 46 | await readPlaces( |
| 43 | 47 | db, |
| 44 | 48 | "hetzner", |
| 45 | 49 | async (url) => { |
| 46 | 50 | const u = String(url); |
| 47 | 51 | if (u.includes("/server_types")) return json({ server_types: types }); |
| 48 | if (u.includes("/datacenters")) return json({ datacenters: [{ location: { name: "nbg1", city: "Nuremberg", country: "DE" }, server_types: { available } }] }); | |
| 52 | if (u.includes("/locations")) return json({ locations: [{ id: 2, name: "nbg1", city: "Nuremberg", country: "DE" }] }); | |
| 49 | 53 | return json({ pricing: { currency: "EUR", volume: { price_per_gb_month: { gross: "0.0572" } }, primary_ips: [{ type: "ipv4", prices: [{ location: "nbg1", price_monthly: { gross: "0.50" } }] }] } }); |
| 50 | 54 | }, |
| 51 | 55 | "t", |
test/pinned-hetzner.test.ts +1 −1
| @@ -133,7 +133,7 @@ describe("hetzner target", () => { | ||
| 133 | 133 | await seedHetzner(app.db, [1, 5]); |
| 134 | 134 | const r = await deployPinned(app, admin(), input({ name: "none" })); |
| 135 | 135 | expect(r).toMatchObject({ ok: false }); |
| 136 | expect(String((r as any).error)).toContain("hetzner:nbg1:cx23 cannot be ordered now: sold out at this datacenter right now"); | |
| 136 | expect(String((r as any).error)).toContain("hetzner:nbg1:cx23 cannot be ordered now: sold out at this location right now"); | |
| 137 | 137 | expect(calls).toEqual([]); |
| 138 | 138 | await seedHetzner(app.db); |
| 139 | 139 | }); |
test/places-api.test.ts +3 −3
| @@ -30,12 +30,12 @@ net.fetch = async (url) => { | ||
| 30 | 30 | ecbCalls++; |
| 31 | 31 | return new Response(ECB); |
| 32 | 32 | } |
| 33 | if (!u.includes("api.hetzner.cloud/v1/") || u.includes("/locations")) return new Response("{}"); | |
| 33 | if (!u.includes("api.hetzner.cloud/v1/")) return new Response("{}"); | |
| 34 | 34 | hetznerCalls++; |
| 35 | 35 | await slow; |
| 36 | 36 | if (hetznerDown) return new Response("down", { status: 500 }); |
| 37 | 37 | const j = (v: unknown) => new Response(JSON.stringify(v)); |
| 38 | return u.includes("server_types") ? j({ server_types: hetzner.server_types }) : u.includes("datacenters") ? j({ datacenters: hetzner.datacenters }) : j(hetzner.pricing); | |
| 38 | return u.includes("server_types") ? j({ server_types: hetzner.server_types }) : u.includes("/locations") ? j({ locations: hetzner.locations }) : j(hetzner.pricing); | |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | 41 | describe("places over HTTP", () => { |
| @@ -95,7 +95,7 @@ describe("places over HTTP", () => { | ||
| 95 | 95 | await new Promise((r) => setImmediate(r)); |
| 96 | 96 | release(); |
| 97 | 97 | const bodies = await Promise.all((await Promise.all(reads)).map((r) => r.json() as Promise<any>)); |
| 98 | expect(hetznerCalls).toBe(3); // one refresh: server_types, datacenters, pricing — once | |
| 98 | expect(hetznerCalls).toBe(3); // one refresh: server_types, locations, pricing — once | |
| 99 | 99 | expect(ecbCalls).toBe(1); |
| 100 | 100 | expect(bodies.every((b) => b.items.length > 0)).toBe(true); |
| 101 | 101 | expect(isStale(app)).toBe(false); |
test/places.test.ts +36 −1
| @@ -80,6 +80,41 @@ describe("places from the providers' answers", () => { | ||
| 80 | 80 | }); |
| 81 | 81 | }); |
| 82 | 82 | |
| 83 | describe("the catalog of 2026-11 (no /datacenters)", () => { | |
| 84 | const cx23 = { | |
| 85 | id: 2, name: "cx23", architecture: "x86", cores: 2, memory: 4, disk: 40, category: "cost_optimized", deprecation: null, | |
| 86 | locations: [{ id: 2, name: "nbg1", available: false, recommended: false, deprecation: null }], | |
| 87 | prices: [{ location: "nbg1", price_monthly: { gross: "6.4900" } }], | |
| 88 | }; | |
| 89 | const cpx22 = { ...cx23, id: 3, name: "cpx22", prices: [{ location: "nbg1", price_monthly: { gross: "7.0000" } }, { location: "ash", price_monthly: { gross: "9.0000" } }], | |
| 90 | locations: [{ id: 2, name: "nbg1", available: true, recommended: false, deprecation: null }, { id: 3, name: "ash", available: true, recommended: false, deprecation: { announced: "x", unavailable_after: "y" } }] }; | |
| 91 | const body = { server_types: [cx23, cpx22], locations: hetzner.locations, pricing: hetzner.pricing }; | |
| 92 | test("stock, price and city come from server_types and locations; a deprecation is not orderable", () => { | |
| 93 | const h = hetznerPlaces(body, EUR, "x"); | |
| 94 | expect(h.find((p) => p.id === "hetzner:nbg1:cx23")).toMatchObject({ orderable: false, city: "Nuremberg" }); | |
| 95 | expect(h.find((p) => p.id === "hetzner:nbg1:cx23")!.why).toContain("sold out at this location"); | |
| 96 | expect(h.find((p) => p.id === "hetzner:nbg1:cpx22")!.orderable).toBe(true); | |
| 97 | expect(h.find((p) => p.id === "hetzner:ash:cpx22")).toMatchObject({ orderable: false, country: "US" }); | |
| 98 | }); | |
| 99 | test("an old kept body with datacenters and no locations lists nothing and does not throw", () => { | |
| 100 | const old = { server_types: [cx23], datacenters: [{ location: { name: "nbg1" }, server_types: { available: [2] } }], pricing: hetzner.pricing }; | |
| 101 | expect(hetznerPlaces(old as any, EUR, "x")).toEqual([]); | |
| 102 | }); | |
| 103 | test("the read needs only server_types, locations and pricing; /datacenters answering 410 changes nothing", async () => { | |
| 104 | const db = new Database(":memory:"); | |
| 105 | const asked: string[] = []; | |
| 106 | const f = async (u: string) => { | |
| 107 | asked.push(u); | |
| 108 | if (u.includes("/datacenters")) return new Response('{"error":{"code":"deprecated_api_endpoint"}}', { status: 410 }); | |
| 109 | return reply(u.includes("server_types") ? { server_types: [cx23, cpx22] } : u.includes("/locations") ? { locations: hetzner.locations } : hetzner.pricing); | |
| 110 | }; | |
| 111 | expect(await readPlaces(db, "hetzner", f as any, "t")).toBe(true); | |
| 112 | expect(asked.some((u) => u.includes("datacenters"))).toBe(false); | |
| 113 | const eu = keptPlaces(db, EUR).filter((p) => p.orderable && p.country !== "US").sort((a, b) => a.costCents - b.costCents)[0]; | |
| 114 | expect(eu?.id).toBe("hetzner:nbg1:cpx22"); | |
| 115 | }); | |
| 116 | }); | |
| 117 | ||
| 83 | 118 | describe("the default rule", () => { |
| 84 | 119 | const all: Place[] = [...hetznerPlaces(hetzner, EUR, "x"), ...digitaloceanPlaces(ocean, "x")]; |
| 85 | 120 | const both = new Set(["hetzner", "digitalocean"]); |
| @@ -104,7 +139,7 @@ describe("the default rule", () => { | ||
| 104 | 139 | describe("a stale provider keeps its last read", () => { |
| 105 | 140 | test("a failing provider changes nothing, and a moved rate re-does the dollars", async () => { |
| 106 | 141 | const db = new Database(":memory:"); |
| 107 | const ok = async (u: string) => reply(u.includes("server_types") ? { server_types: hetzner.server_types } : u.includes("datacenters") ? { datacenters: hetzner.datacenters } : hetzner.pricing); | |
| 142 | const ok = async (u: string) => reply(u.includes("server_types") ? { server_types: hetzner.server_types } : u.includes("/locations") ? { locations: hetzner.locations } : hetzner.pricing); | |
| 108 | 143 | expect(await readPlaces(db, "hetzner", ok as any, "t", new Date("2026-11-24T00:00:00Z"))).toBe(true); |
| 109 | 144 | expect(await readPlaces(db, "hetzner", async () => new Response("no", { status: 500 }), "t")).toBe(false); |
| 110 | 145 | const before = keptPlaces(db, EUR).find((p) => p.id === "hetzner:ash:cpx21")!; |
test/tui-places.test.ts +1 −1
| @@ -35,7 +35,7 @@ beforeAll(async () => { | ||
| 35 | 35 | alice = await make("alice", true); |
| 36 | 36 | bob = await make("bob", false); |
| 37 | 37 | const j = (v: unknown) => new Response(JSON.stringify(v)); |
| 38 | const ok: Fetch = async (u) => j(u.includes("server_types") ? { server_types: hetzner.server_types } : u.includes("datacenters") ? { datacenters: hetzner.datacenters } : hetzner.pricing); | |
| 38 | const ok: Fetch = async (u) => j(u.includes("server_types") ? { server_types: hetzner.server_types } : u.includes("/locations") ? { locations: hetzner.locations } : hetzner.pricing); | |
| 39 | 39 | await readPlaces(forge.db, "hetzner", ok, "t"); |
| 40 | 40 | forge.db.run("CREATE TABLE IF NOT EXISTS fx_rate (currency TEXT PRIMARY KEY, usd_per REAL NOT NULL, date TEXT NOT NULL, fetched_at TEXT NOT NULL)"); |
| 41 | 41 | forge.db.run("INSERT INTO fx_rate VALUES ('EUR', 1.08, '2026-11-24', '2026-11-24T00:00:00Z')"); |
new above
offline
Add a test for
t.deprecation != null(type-level) and forstockundefined; only the per-location deprecation is exercised today.