Repository navigation
feat(invitations): carry chapter_id and workshop_date in invitation job log lines - #2988
Merged
Merged
Conversation
mroderick
force-pushed
the
invitation-log-context
branch
from
October 7, 2026 09:14
39a349c to
e04fadb
Compare
mroderick
added a commit
to mroderick/codebar-planner
that referenced
this pull request
Oct 7, 2026
Review fix for PR codebar#2988. The specs only asserted that the mailer methods accept the log_context argument; nothing exercised the YAML serialize/deserialize round-trip through Delayed::Job that the canonical job log lines depend on. Test env delivers inline (Delayed::Worker.delay_jobs = false), so that path was never exercised. The new shared example flips delay_jobs on for the duration of the example (restored in ensure), sends through the real deliver_later path, and asserts the deserialized fourth mailer argument equals the log_context hash.
mroderick
force-pushed
the
invitation-log-context
branch
from
October 7, 2026 09:24
e04fadb to
0cc7da6
Compare
…ob log lines Workshop invitation emails are sent as individual ActionMailer jobs, and the canonical job log lines (enqueue, perform_start, perform) only carried Workshop, Member and WorkshopInvitation gids. Nothing tied the emails to the workshop chapter, so log-based tooling could not attribute invitation volume to chapters without a second data source. The batch code already holds the workshop record, so the chapter id and the workshop date (UTC) ride along as an optional trailing log_context argument on WorkshopInvitationMailer and VirtualWorkshopInvitationMailer invite_student/invite_coach. They end up serialized in the job arguments, which the job log lines already emit. No additional database queries: the values are plain attributes on the workshop record the caller has loaded. A shared example pins the serialize/deserialize round-trip of log_context through delayed_job. Other callers are unaffected; the parameter defaults to empty.
mroderick
force-pushed
the
invitation-log-context
branch
from
October 7, 2026 09:29
0cc7da6 to
f401945
Compare
mroderick
marked this pull request as ready for review
October 7, 2026 09:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workshop invitation emails (invite_student and invite_coach) are sent as individual
ActionMailer::MailDeliveryJobjobs. The canonical job log lines (enqueue, perform_start, perform) carry the serialized job arguments, which today contain only Workshop, Member and WorkshopInvitation gids. Nothing connects an invitation email to its chapter, so log-based tooling cannot attribute invitation volume to chapters without a second data source.This adds an optional trailing
log_contextargument toWorkshopInvitationMailerandVirtualWorkshopInvitationMailer#invite_student/#invite_coach. The batch code inInvitationManagerpasses{ chapter_id, workshop_date }(UTC date). Both values are plain attributes on the workshop record the caller already holds, so this introduces no additional database queries. The hash is serialized as part of the job arguments and therefore appears in every canonical log line for the job.Other callers are unaffected; the parameter defaults to empty.
Details
invitation_log_contextinInvitationManager#privatebuilds the hash with safe navigation for workshops without a dateReview notes
invite_student/invite_coachget context.attending, reminders and waiting-list lines stay as they are. Say so if those should be covered too.