Skip to content

Add SHELL_CREATED event with user and shell edges#2258

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-shell-created-event
Draft

Add SHELL_CREATED event with user and shell edges#2258
Copilot wants to merge 2 commits intomainfrom
copilot/add-shell-created-event

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

New SHELL_CREATED event kind with edges to the creating user and the created shell, following the existing event hook pattern.

Schema (tavern/internal/ent/schema/)

  • event.go: Added SHELL_CREATED enum value, shell and user reverse edges
  • shell.go: Added forward events edge
  • user.go: Added forward events edge

Hook (tavern/internal/ent/hook_events.go)

  • HookDeriveShellEvents(): On ShellMutation create, emits SHELL_CREATED event with shell + owner edges
  • HookDeriveNotifications(): Broadcasts SHELL_CREATED notifications to all users (same pattern as HOST_ACCESS_NEW)

Registration

  • tavern/config.go: client.Shell.Use(ent.HookDeriveShellEvents())

Frontend

  • Updated enums.ts, interfacesQuery.ts, notification GQL query, and NotificationBell.tsx to render SHELL_CREATED events

Tests

  • TestHookDeriveShellEvents: Verifies event creation with correct kind, shell/user edges, and notification generation

All generated code regenerated via go generate ./tavern/....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants