SweepDueScheduledChanges takes a func() string that answers the mode of the
API key the Stripe SDK holds, and asks it once per due row, before the row
is claimed, where it read the SDK's global key before. The billing
activities hold the function, WorkerConfig.StripeKeyMode carries it, and
cmd/start.go sets it to the Stripe integration's SDKKeyMode. The worker is
built before the Stripe integration's Startup sets the key, so the mode is
read when a sweep runs, not when the worker is built. A nil function is not
refused at construction; only a sweep that finds a due row needs it. The
forbidigo exception for sweep.go is deleted; the reconcile the sweep calls
still reads the key itself.
No output changes. The activity keeps its name, signature and result type
(SweepScheduledChangesOutput keeps its one untagged field, Fired); the
activity and workflow function lists, every workflow body and the payload
types are equal at the parent and at this commit. The names and results of
internal/fulfillment, internal/workflows/..., cmd/... and internal/stripetest
are equal at the parent and at this commit after a database reset on each
side: 296 tests and subtests, no failure. The sweep goldens are unchanged. The lint
snapshot differs from the parent's by no added or removed finding. No gocognit
pin moves.
Breaks: 4 records. The read is caught by TestSweepSkipsWithoutClaimingTheRow
on the old side and on the new side; the hand-off from the sweep to the row
is caught on the new side; the forbidigo check now refuses a read of the SDK
key in sweep.go.
Unprobed: the billing activity's hand-off of its function,
WorkerConfig.StripeKeyMode and its assignment in cmd/start.go, because no test
builds the billing activities or the worker, and a test of the activity would
sweep every due row of the shared test database; and that a nil function
fails a sweep that finds a due row, because the composition root always sets
it.