feat: runtime manager

This commit is contained in:
Ilia Denisov
2026-04-28 20:39:18 +02:00
committed by GitHub
parent e0a99b346b
commit a7cee15115
289 changed files with 45660 additions and 2207 deletions
+26 -2
View File
@@ -35,6 +35,9 @@ var expectedNotificationTypeCatalog = []string{
"lobby.race_name.registration_eligible",
"lobby.race_name.registered",
"lobby.race_name.registration_denied",
"runtime.image_pull_failed",
"runtime.container_start_failed",
"runtime.start_config_invalid",
}
var expectedNotificationCatalog = map[string]notificationCatalogExpectation{
@@ -128,6 +131,24 @@ var expectedNotificationCatalog = map[string]notificationCatalogExpectation{
payloadSchema: "LobbyRaceNameRegistrationDeniedPayload",
requiredFields: []string{"game_id", "game_name", "race_name", "reason"},
},
"runtime.image_pull_failed": {
producer: "runtime_manager",
audienceKind: "admin_email",
payloadSchema: "RuntimeImagePullFailedPayload",
requiredFields: []string{"game_id", "image_ref", "error_code", "error_message", "attempted_at_ms"},
},
"runtime.container_start_failed": {
producer: "runtime_manager",
audienceKind: "admin_email",
payloadSchema: "RuntimeContainerStartFailedPayload",
requiredFields: []string{"game_id", "image_ref", "error_code", "error_message", "attempted_at_ms"},
},
"runtime.start_config_invalid": {
producer: "runtime_manager",
audienceKind: "admin_email",
payloadSchema: "RuntimeStartConfigInvalidPayload",
requiredFields: []string{"game_id", "image_ref", "error_code", "error_message", "attempted_at_ms"},
},
}
const expectedNotificationCatalogTable = `| ` + "`notification_type`" + ` | Producer | Audience | Channels | Required ` + "`payload_json`" + ` fields |
@@ -146,7 +167,10 @@ const expectedNotificationCatalogTable = `| ` + "`notification_type`" + ` | Prod
| ` + "`lobby.invite.expired`" + ` | ` + "`Game Lobby`" + ` (` + "`game_lobby`" + `) | private-game owner (` + "`audience_kind=user`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`game_name`" + `, ` + "`invitee_user_id`" + `, ` + "`invitee_name`" + ` |
| ` + "`lobby.race_name.registration_eligible`" + ` | ` + "`Game Lobby`" + ` (` + "`game_lobby`" + `) | capable member (` + "`audience_kind=user`" + `) | ` + "`push+email`" + ` | ` + "`game_id`" + `, ` + "`game_name`" + `, ` + "`race_name`" + `, ` + "`eligible_until_ms`" + ` |
| ` + "`lobby.race_name.registered`" + ` | ` + "`Game Lobby`" + ` (` + "`game_lobby`" + `) | registering user (` + "`audience_kind=user`" + `) | ` + "`push+email`" + ` | ` + "`race_name`" + ` |
| ` + "`lobby.race_name.registration_denied`" + ` | ` + "`Game Lobby`" + ` (` + "`game_lobby`" + `) | incapable member (` + "`audience_kind=user`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`game_name`" + `, ` + "`race_name`" + `, ` + "`reason`" + ` |`
| ` + "`lobby.race_name.registration_denied`" + ` | ` + "`Game Lobby`" + ` (` + "`game_lobby`" + `) | incapable member (` + "`audience_kind=user`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`game_name`" + `, ` + "`race_name`" + `, ` + "`reason`" + ` |
| ` + "`runtime.image_pull_failed`" + ` | ` + "`Runtime Manager`" + ` (` + "`runtime_manager`" + `) | configured admin email list (` + "`audience_kind=admin_email`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`image_ref`" + `, ` + "`error_code`" + `, ` + "`error_message`" + `, ` + "`attempted_at_ms`" + ` |
| ` + "`runtime.container_start_failed`" + ` | ` + "`Runtime Manager`" + ` (` + "`runtime_manager`" + `) | configured admin email list (` + "`audience_kind=admin_email`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`image_ref`" + `, ` + "`error_code`" + `, ` + "`error_message`" + `, ` + "`attempted_at_ms`" + ` |
| ` + "`runtime.start_config_invalid`" + ` | ` + "`Runtime Manager`" + ` (` + "`runtime_manager`" + `) | configured admin email list (` + "`audience_kind=admin_email`" + `) | ` + "`email`" + ` | ` + "`game_id`" + `, ` + "`image_ref`" + `, ` + "`error_code`" + `, ` + "`error_message`" + `, ` + "`attempted_at_ms`" + ` |`
var expectedSharedDocumentationSnippets = []string{
"`lobby.application.submitted` keeps one stable `notification_type` and one stable `payload_json` shape",
@@ -234,7 +258,7 @@ func TestIntentAsyncAPISpecFreezesEnvelopeSchema(t *testing.T) {
producer := getMapValue(t, properties, "producer")
require.Equal(t, "string", getStringValue(t, producer, "type"))
require.Equal(t, []string{"geoprofile", "game_master", "game_lobby"}, getStringSlice(t, producer, "enum"))
require.Equal(t, []string{"geoprofile", "game_master", "game_lobby", "runtime_manager"}, getStringSlice(t, producer, "enum"))
occurredAt := getMapValue(t, properties, "occurred_at_ms")
require.Equal(t, "string", getStringValue(t, occurredAt, "type"))