Add helper for job metadata updates#1269
Conversation
brandur
left a comment
There was a problem hiding this comment.
Cool! Seems useful. I like the touch that we reject use of the river:* namespace.
|
Thanks. I dropped the unrelated CLI and worker.go changes, scoped the test-only job args into the test case, and normalized the error message casing. |
|
One note on the remaining red check: the retriggered run moved the failure from build_and_test (1.26, 15) to build_and_test (1.26, 14), and both failures happened during Docker pull for postgres:15 in container setup rather than during test execution, so this looks like CI flakiness rather than a code regression.\n\nLatest run: https://github.com/riverqueue/river/actions/runs/26804256615 |
|
@peter941221 Was just thinking about this a bit more today, and could you rename It's a bit more of a mouthful, but since this is a top-level package function, using a It's also consistent with how things are named on |
|
Renamed the helper to MetadataSet in d8e114f so the top-level metadata helpers stay grouped under Metadata*. |
|
@peter941221 Great, thanks! Okay, this is looking good. Can you add a CHANGELOG entry? Put it under the "added' section. |
|
Added the CHANGELOG entry under Unreleased -> Added in c0e0902. |
|
The red check was another windows-latest postgres bootstrap failure in action-setup-postgres before checkout or CLI execution. I pushed a no-op commit to retrigger CI on a fresh runner. |
|
Thanks! Yeah, we definitely have a couple GItHub Actions-related flakes going on. |
SetMetadata(ctx, key, value)helper for writing metadata updates onto the existing work-context merge path.river:-prefixed keys so user code can't collide with River-reserved metadata keys.HookWorkEndintegration paths.Closes #1218.
Verification:
go test ./... -run "TestSetMetadata|Test_Client_Common/(WithWorkerSettingMetadata|WithWorkEndHookSettingMetadata)" -count=1make test