Skip to content

feat(worker/tasks): ✨ Handle MEMBER_ADD and MEMBER_REMOVE webhooks - #139

Merged
Nudelsuppe42 merged 1 commit into
mainfrom
worker/member-events
Aug 29, 2026
Merged

feat(worker/tasks): ✨ Handle MEMBER_ADD and MEMBER_REMOVE webhooks#139
Nudelsuppe42 merged 1 commit into
mainfrom
worker/member-events

Conversation

@kyanvde

Copy link
Copy Markdown
Contributor

Teaches the BuildTeam webhook task the two member events the roadmap already lists.

AuditLogBuildTeamType only knew the application and claim types, so a MEMBER_ADD or MEMBER_REMOVE job was logged as an unknown type and dropped. api-v2's member routes (#138) dispatch both once they land, so this has to be in place first — it is deliberately a separate PR against main, because apps/worker does not exist on the long-lived api/v2 branch.

The payload is projected, not passed through.transformData's default branch forwards whatever it is handed — its own comment says it strips nothing — and the natural payload for a member event is a user row, which carries ssoId: the Keycloak account behind the person. A build team has no business receiving that, so the member case selects id, username, discordId, minecraft, avatar and buildTeamId explicitly, matching what the application case already forwards about a user.

No behaviour changes for any existing event type; the diff is one enum extended and one switch case added.

Testing

yarn ws worker build passes. apps/worker/test/index.test.ts is a manual trigger script rather than a suite, so there was nothing to extend; the task itself is unchanged apart from the new case.

🤖 Generated with Claude Code

The roadmap lists both as BuildTeam webhook events, but the task only knew
the application and claim types, so a member event was logged as unknown
and dropped. api-v2 dispatches them once its member routes land.
The payload is projected rather than passed through: the default branch
forwards whatever it is given, and a user row carries the ssoId of the
Keycloak account behind the person, which is not a BuildTeam's business.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kyanvde added a commit that referenced this pull request Aug 28, 2026
The worker learns both event types in #139, so adding
and removing a member now reaches the team's own webhook as well as
Discord and the website revalidation.
The payload is listed field by field rather than spread: a member is
selected with ssoId on it, which is the Keycloak account behind the
person and has no business leaving this service, and a test now holds
that line.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-project-automationgithub-project-automationBot moved this from Backlog to In Progress in @BuildTheEarth/web TrackerAug 29, 2026
@Nudelsuppe42
Nudelsuppe42 merged commit 6578765 into mainAug 29, 2026
4 checks passed
@Nudelsuppe42
Nudelsuppe42 deleted the worker/member-events branch August 29, 2026 09:00
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in @BuildTheEarth/web TrackerAug 29, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@kyanvde@Nudelsuppe42