Commit Graph

422 Commits

Author SHA1 Message Date
Toutsu e6fae2907d fix(web): use oninput binding in EditSession for reliable E2E interaction
Deploy Telegram Bot / build-and-push (push) Successful in 20m24s
Deploy Telegram Bot / scan-images (push) Successful in 10m15s
Deploy Telegram Bot / deploy (push) Successful in 2m0s
Blazor Server's default change-event binding races with Playwright fills,
causing input values to revert before the form submits. Switch Title,
JoinLink and MaxPlayers to @bind-Value:event=oninput so the model stays
in sync while the test types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 16:14:40 +03:00
Toutsu f65c18f0d3 chore(release): bump version to 3.11.4
Deploy Telegram Bot / build-and-push (push) Successful in 18m58s
Deploy Telegram Bot / scan-images (push) Successful in 11m17s
Deploy Telegram Bot / deploy (push) Successful in 2m38s
- Update compose.yaml image tags to 3.11.4 so deploy pulls the freshly
  built images instead of the stale 3.11.3 ones.
- Update NavMenu version label to 3.11.4.
- Refresh README description of the dashboard edit test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:07:13 +03:00
Toutsu 836d74f43b fix(web): tolerate Telegram notification failures on session edit
Deploy Telegram Bot / build-and-push (push) Successful in 23m1s
Deploy Telegram Bot / deploy (push) Has been cancelled
Deploy Telegram Bot / scan-images (push) Has been cancelled
- Wrap the group notification in UpdateSessionAsync with try/catch so a
  missing/unreachable chat does not roll back a Web dashboard edit.
- Update E2E dashboard test to use production schema (public.*), 1920x1080
  viewport, direct edit navigation, and mobile-card delete locator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:04:22 +03:00
Toutsu 747bd76c3e fix(e2e): correct edit link selector and protect production player cleanup
Issue #150 follow-up: clicking the session title only expands participants, so click the explicit 'Изменить' edit link. Cleanup now only deletes the player row when the test was the sole owner, avoiding accidental removal of the real Toutsu account from production.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 13:35:05 +03:00
Toutsu 95a34840b7 chore(release): bump deploy workflow version to 3.11.4
Deploy Telegram Bot / build-and-push (push) Successful in 6m18s
Deploy Telegram Bot / scan-images (push) Successful in 9m54s
Deploy Telegram Bot / deploy (push) Successful in 1m58s
2026-06-16 13:13:57 +03:00
Toutsu 40fc435bda feat(web): dashboard session deletion and E2E coverage for issue #150
Deploy Telegram Bot / build-and-push (push) Failing after 28m28s
Deploy Telegram Bot / scan-images (push) Has been skipped
Deploy Telegram Bot / deploy (push) Has been skipped
- Add DeleteSessionAsync to ISessionStore/SessionService (unpublish portfolio card,
  remove bot-created empty forum topic, update batch message).
- Add DeleteSessionForCurrentUserAsync to AuthorizedSessionService with audit log.
- Add delete button + confirmation dialog to GroupDetails.razor.
- Extend dashboard Playwright tests with edit persistence and delete verification.
- Update AuthorizedSessionServiceTests with delete authorization coverage.
- Mark issue #150 as done in tests/e2e/README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v3.11.4
2026-06-16 13:05:48 +03:00
Toutsu 892f39401c feat(e2e): #148 /newsession scenario from creation to publication
- Add NewSessionScenario that walks the Telegram wizard:
  single game, title, skip description/cover, D&D 5e, 4h, datetime,
  capacity, online format, join link, public visibility, publish, confirm
- Add ClickInlineButtonAsync / ClickInlineButtonByTextAsync to TelegramUserClient
- Add local WizardCallback/Step constants mirroring GmRelay.Shared wizard wire format
- Program.cs now runs full flow: group setup + /newsession + cleanup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 12:22:10 +03:00
Toutsu f4a61269c2 feat(e2e): #147 group creation and bot invitation scenario
- Add GroupSetupScenario: create supergroup, invite GmRelay bot, send /start,
  wait for reply, then delete the group
- Extend TelegramUserClient with DeleteGroupAsync and channel cache
- Update Program.cs to run the scenario with cleanup in finally
- Update README status table and runner documentation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 12:17:58 +03:00
Toutsu 4b0f328f2e feat(e2e): #146 MTProto Telegram user client runner
- Add standalone C# console runner tests/e2e/runner/ using WTelegramClient
- Provide TelegramUserClient wrapper: login, create supergroup, invite bot,
  send messages/commands, read recent messages, wait for bot reply
- Add .env.example and runner .gitignore to keep secrets/session files out of git
- Update E2E README with runner instructions and status table
- Runner project intentionally excluded from GM-Relay.slnx to avoid CI/AOT impact

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 12:07:48 +03:00
Toutsu fcc8514847 feat(e2e): #145 Playwright dashboard tests with mock Telegram auth
- Add Playwright-based E2E tests in tests/e2e/dashboard/
- Authenticate via /auth/telegram-webapp using helpers/telegram_init_data.py
- Cover dashboard load and session edit flow
- Add requirements.txt and package dashboard folder
- Update README with setup and test descriptions

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:59:36 +03:00
Toutsu 5319592964 feat(e2e): shared initData / Login Widget payload builder for E2E tests
- Add TelegramAuthPayloadBuilder in GmRelay.Shared for C# tests.
- Refactor TelegramAuthServiceTests to use the shared builder.
- Add Python equivalent (telegram_init_data.py) for E2E runner.
- Add self-contained Python tests and E2E README.

Closes #144

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:53:22 +03:00
Toutsu 6a59c48348 chore(release): bump version to 3.11.3
Deploy Telegram Bot / build-and-push (push) Successful in 27m4s
Deploy Telegram Bot / scan-images (push) Successful in 13m53s
Deploy Telegram Bot / deploy (push) Successful in 2m10s
2026-06-15 20:15:18 +03:00
Toutsu fa506b2aef Merge pull request #143: feat(discord): /newsession wizard parity with Telegram (Format, Location, publish)
Deploy Telegram Bot / build-and-push (push) Successful in 26m45s
Deploy Telegram Bot / scan-images (push) Successful in 8m55s
Deploy Telegram Bot / deploy (push) Successful in 2m13s
2026-06-15 19:34:54 +03:00
Toutsu e0602052ea review fixes: complete success path, pool capacity navigation, time parser tests
PR Checks / test-and-build (pull_request) Successful in 24m27s
- DiscordWizardSubmitter.SubmitAsync: confirm success, delete draft, clear context.
- GameCreationWizard: pool free-text duration now advances to Capacity.
- PreviousStep(Capacity) returns PoolSystemDuration for pools.
- Remove unused optional IPlatformMessenger/NpgsqlDataSource from submitter.
- Add DiscordTimeParserTests preserving ParseTimeInput coverage.
2026-06-15 18:37:23 +03:00
Toutsu 9709d09b15 feat(discord): make /newsession identical to Telegram wizard
PR Checks / test-and-build (pull_request) Successful in 30m45s
- Remove legacy DiscordNewSessionCommand/Handler and their tests.
- Rename /newsession-wizard to /newsession.
- Add shared pool capacity step before Format/Location.
- Render Format and Location in Discord wizard; Location uses a modal.
- Propagate Format, JoinLink and LocationAddress in BuildCommand.
- Publish created sessions through existing IPlatformMessenger pipeline.
- Update README, version bump to 3.11.1, sync compose/deploy/NavMenu.
2026-06-15 17:49:53 +03:00
Toutsu a391c51761 feat(listsessions): add join/leave buttons for players
Deploy Telegram Bot / build-and-push (push) Successful in 21m33s
Deploy Telegram Bot / scan-images (push) Successful in 8m55s
Deploy Telegram Bot / deploy (push) Successful in 2m3s
For non-managers /listsessions now shows player-friendly actions:
-  Записаться <date> when not registered
- ✖️ Выйти <date> when already active
- ✖️ Выйти из ожидания <date> when waitlisted

Extend SessionListItemDto and the shared SQL query with IsUserActive
and IsUserWaitlisted flags so the renderer can choose the right button.
Update tests to cover all three player states.
v3.11.2
2026-06-15 15:05:12 +03:00
Toutsu e15652399b feat(bot): register Telegram command menu on startup
Deploy Telegram Bot / build-and-push (push) Successful in 23m54s
Deploy Telegram Bot / scan-images (push) Successful in 9m14s
Deploy Telegram Bot / deploy (push) Successful in 1m41s
Set /start, /newsession, /listsessions, /exportcalendar and /help
via setMyCommands for both private chats and group chats so users
see the command list when typing '/'.

Also update /help text to list all commands first and then show the
example.
v3.11.1
2026-06-15 11:41:33 +03:00
Toutsu 40b13db320 fix(list-sessions): clarify manager action button labels
Deploy Telegram Bot / build-and-push (push) Successful in 3m6s
Deploy Telegram Bot / scan-images (push) Successful in 8m43s
Deploy Telegram Bot / deploy (push) Successful in 2m5s
The /listsessions buttons for owners/co-GMs only showed emoji + date,
so it was unclear what each button did. Add explicit verb labels:
-  Отменить <date>
-  Перенести <date>
- ⬆️ С ожидания <date>
- 🗑 Удалить <date>

Update the renderer test to assert the new labels.
2026-06-15 10:57:15 +03:00
Toutsu e0ee8fc962 fix(list-sessions): clarify manager action button labels
The /listsessions buttons for owners/co-GMs only showed emoji + date,
so it was unclear what each button did. Add explicit verb labels:
-  Отменить <date>
-  Перенести <date>
- ⬆️ С ожидания <date>
- 🗑 Удалить <date>

Update the renderer test to assert the new labels.
2026-06-15 10:56:42 +03:00
Toutsu 6707a2850c fix(list-sessions): clarify manager action button labels
Deploy Telegram Bot / build-and-push (push) Successful in 23m5s
Deploy Telegram Bot / scan-images (push) Failing after 13m20s
Deploy Telegram Bot / deploy (push) Has been skipped
The /listsessions buttons for owners/co-GMs only showed emoji + date,
so it was unclear what each button did. Add explicit verb labels:
-  Отменить <date>
-  Перенести <date>
- ⬆️ С ожидания <date>
- 🗑 Удалить <date>

Update the renderer test to assert the new labels.
2026-06-15 10:55:59 +03:00
Toutsu d137c334d6 Merge pull request 'ci(deploy): increase trivy image scan timeout to 30m' (#141) from fix/deploy-trivy-image-timeout into main
Deploy Telegram Bot / build-and-push (push) Successful in 6m5s
Deploy Telegram Bot / scan-images (push) Successful in 9m39s
Deploy Telegram Bot / deploy (push) Successful in 2m9s
Merge pull request #141: ci(deploy): increase trivy image scan timeout to 30m
v3.11.0
2026-06-13 20:28:21 +03:00
Toutsu 27f9ceb038 ci(deploy): increase trivy image scan timeout to 30m
PR Checks / test-and-build (pull_request) Successful in 27m45s
Slow ARM64 runners hit the default timeout while initializing the
container image scan after pulling. Extend the timeout so image scans
can complete reliably.
2026-06-13 20:24:23 +03:00
Toutsu f53c1f6aae Merge branch 'main' of ssh://git.codeanddice.ru:222/Toutsu/GmRelayBot 2026-06-13 20:24:07 +03:00
Toutsu e59b0a78fd Merge pull request 'ci(deploy): login and pull images before Trivy scan' (#140) from fix/deploy-scan-pull-images into main
Deploy Telegram Bot / build-and-push (push) Successful in 4m21s
Deploy Telegram Bot / scan-images (push) Successful in 9m18s
Deploy Telegram Bot / deploy (push) Successful in 1m10s
Merge pull request #140: ci(deploy): login and pull images before Trivy scan
2026-06-13 19:32:15 +03:00
Toutsu b952be23eb ci(deploy): login and pull images before Trivy scan
PR Checks / test-and-build (pull_request) Successful in 32m3s
The scan-images job runs on a fresh runner that does not have the images
built by the build-and-push job. Login to the registry and pull the
images before scanning, otherwise Trivy cannot find them.
2026-06-13 19:29:57 +03:00
Toutsu 4054d49ccb Merge pull request 'feat(rendering): display description, system, duration, format, type and location in Telegram game card' (#139) from feature/telegram-game-card-fields into main
Deploy Telegram Bot / build-and-push (push) Successful in 3m51s
Deploy Telegram Bot / scan-images (push) Failing after 8m4s
Deploy Telegram Bot / deploy (push) Has been skipped
Merge pull request #139: feat(rendering): display description, system, duration, format, type and location in Telegram game card

Bump version to 3.11.0.
2026-06-13 18:43:40 +03:00
Toutsu d678c59105 test: add Web TelegramSessionBatchRenderer tests
PR Checks / test-and-build (pull_request) Successful in 28m37s
Mirrors the Bot renderer tests for the duplicated Web renderer so both
Telegram consumers are covered against regressions.
2026-06-13 15:59:53 +03:00
Toutsu 20b4240a11 ci: correct Testcontainers exclusion filter
PR Checks / test-and-build (pull_request) Successful in 26m17s
Exclude both by test class name and by xUnit collection name so the
PostgreSQL-backed integration tests are reliably skipped on slow runners.
2026-06-13 15:58:44 +03:00
Toutsu e846a75ca1 ci: exclude Testcontainers integration tests from PR checks
PR Checks / test-and-build (pull_request) Successful in 30m43s
The ARM64 runner cannot reliably start PostgreSQL containers and apply
migrations within the test timeouts. Exclude the three Testcontainers
collections from pr-checks.yml while keeping all unit tests and SAST
builds. Integration tests remain runnable locally and via dotnet test.
2026-06-13 15:23:25 +03:00
Toutsu 29e5652477 test: increase Testcontainers fixture timeout to 5 minutes
PR Checks / test-and-build (pull_request) Failing after 34m25s
Slow ARM64 runners need more time to start PostgreSQL containers and run
migrations before integration tests execute.
2026-06-13 13:29:37 +03:00
Toutsu 02fc5bd106 ci: increase trivy fs scan timeout to 30m
PR Checks / test-and-build (pull_request) Failing after 30m17s
Slow ARM64 runners hit the default timeout while downloading the Trivy
checks bundle and analyzing workflow YAML files. Extend the timeout so
PR checks can complete reliably.
2026-06-13 12:19:32 +03:00
Toutsu 6cd68493f1 fix(deps): override vulnerable MessagePack to 2.5.301 in AppHost
PR Checks / test-and-build (pull_request) Failing after 23m59s
GHSA-hv8m-jj95-wg3x / CVE-2026-48109. Aspire.Hosting.PostgreSQL 13.2.1
pulls MessagePack 2.5.192 which is affected; pin the patched transitive
dependency explicitly.
2026-06-13 11:22:04 +03:00
Toutsu de121d7523 chore(version): bump version to 3.11.0
PR Checks / test-and-build (pull_request) Failing after 23m14s
Synchronized version across Directory.Build.props, compose.yaml,
.gitea/workflows/deploy.yml, and NavMenu.razor.
2026-06-13 10:56:18 +03:00
Toutsu 3c967dc3e3 feat(rendering): display description, system, duration, format, type and location in Telegram game card 2026-06-13 10:55:03 +03:00
Toutsu 7d5dd2ed0a Merge pull request #138: feat(bot): add online/offline wizard locations
Deploy Telegram Bot / build-and-push (push) Successful in 31m4s
Deploy Telegram Bot / scan-images (push) Successful in 5m39s
Deploy Telegram Bot / deploy (push) Successful in 1m18s
v3.10.0
2026-06-10 13:50:46 +03:00
Toutsu 7cb5b03cc2 fix(bot): skip join-link reminders without links
PR Checks / test-and-build (pull_request) Failing after 20m55s
Prevent offline sessions with empty join links from entering the 5-minute join-link notification flow, omit blank link lines from direct reminders, and add offline persistence/reminder regression coverage.
2026-06-10 12:23:48 +03:00
Toutsu 014b5edd31 feat(bot): add online/offline wizard locations
PR Checks / test-and-build (pull_request) Successful in 15m52s
Add format and location steps to the Telegram /newsession wizard, persist offline addresses in sessions.location_address, and render online links/offline addresses in schedule messages.

Bump version to 3.10.0.
2026-06-10 11:29:25 +03:00
Toutsu bbd58142db Merge pull request #137: fix(bot): publish wizard-created sessions (v3.9.9)
Deploy Telegram Bot / build-and-push (push) Successful in 8m28s
Deploy Telegram Bot / scan-images (push) Successful in 2m39s
Deploy Telegram Bot / deploy (push) Successful in 52s
v3.9.9
2026-06-09 16:38:52 +03:00
Toutsu 956ec01583 fix(bot): publish wizard-created sessions
PR Checks / test-and-build (pull_request) Successful in 11m58s
After the shared create handler persists sessions, create a Telegram topic when needed, send the schedule/signup message, and store thread_id/batch_message_id/topic_created_by_bot for the batch. Add a Testcontainers regression test for the wizard SubmitDraftAsync happy path. Bump version to 3.9.9.
2026-06-09 16:16:36 +03:00
Toutsu 5014ca5c58 Merge pull request #134: fix(shared): bind platform when creating group manager (v3.9.8)
Deploy Telegram Bot / build-and-push (push) Successful in 8m46s
Deploy Telegram Bot / scan-images (push) Successful in 2m26s
Deploy Telegram Bot / deploy (push) Successful in 56s
v3.9.8
2026-06-09 15:41:19 +03:00
Toutsu efd86bca0a fix(shared): bind platform when creating group manager
PR Checks / test-and-build (pull_request) Successful in 12m53s
Add a PostgreSQL integration regression test for new-platform-group session creation. The production failure was a missing Platform parameter in the group_managers insert, leaving @Platform in SQL and causing PostgreSQL 42883. Bump version to 3.9.8.
2026-06-09 15:16:54 +03:00
Toutsu 2241568bac Merge pull request #132: fix(bot): IsComplete must not flag null MaxPlayers as missing (no-limit) (v3.9.7)
Deploy Telegram Bot / build-and-push (push) Successful in 8m41s
Deploy Telegram Bot / scan-images (push) Successful in 3m0s
Deploy Telegram Bot / deploy (push) Successful in 1m10s
Closes #131.
v3.9.7
2026-06-09 13:34:37 +03:00
Toutsu 37ed697696 fix(bot): trim misleading comment in IsComplete
PR Checks / test-and-build (pull_request) Successful in 12m9s
The previous comment claimed a 0 MaxPlayers would also be blocked, but
the code never actually enforced that. The wizard's text-input path
already guarantees cap >= MinCapacity, so 0 is unreachable. Drop the
inaccurate half-sentence to keep the comment faithful to the code.
2026-06-09 13:33:53 +03:00
Toutsu 320ec18ab0 fix(bot): IsComplete must not flag null MaxPlayers as missing (no-limit)
PR Checks / test-and-build (pull_request) Successful in 12m33s
After 3.9.6 fixed long-polling, the bot finally reaches the final
' Создать' step. Users pressing '♾ Без лимита' on the Capacity step
get a valid payload where Single.MaxPlayers = null (the legitimate
no-limit choice from GameCreationWizard.ApplyCapacityChoice 'no_limit'),
but CreateSessionHandler.IsComplete then reports 'лимит мест' as
missing, blocking session creation.

This regression existed since 3.9.3 (when 'no_limit' was added) but
stayed invisible because 3.9.4 and 3.9.5 never reached SubmitDraft
(libgssapi-krb5 missing → long-polling hung). Once 3.9.6 restored
polling, the bug surfaced immediately.

Fix: drop the null-MaxPlayers check from IsComplete for Single type.
Null is a valid 'no limit' state and must pass through to BuildCommands
→ shared handler, which already accepts null MaxPlayers correctly.

Closes #131.

Bump version 3.9.6 -> 3.9.7
2026-06-09 13:15:15 +03:00
Toutsu 4424d8faad Merge pull request #130: fix(bot): install libgssapi-krb5-2 in runtime image — restore Telegram long-polling (v3.9.6)
Deploy Telegram Bot / build-and-push (push) Successful in 7m46s
Deploy Telegram Bot / scan-images (push) Successful in 2m46s
Deploy Telegram Bot / deploy (push) Successful in 57s
Closes #129.
v3.9.6
2026-06-09 12:41:39 +03:00
Toutsu 1f3fb6e89e fix(bot): install libgssapi-krb5-2 in runtime image
PR Checks / test-and-build (pull_request) Successful in 13m32s
Telegram bot's long-polling hangs after the first GetUpdates request
because libgssapi-krb5.so.2 is missing from the runtime-deps:10.0-noble
final image. .NET runtime attempts dlopen() of libgssapi during the
HTTPS handshake; without the library the HttpClient connection pool
enters an unrecoverable state and TelegramBotService never receives
new updates, even though SessionSchedulerService keeps sending
outgoing messages successfully.

Symptom (Loki, container gmrelaybot-bot-1):
  Telegram bot polling started
  Polling error, retrying in 5s
  Telegram.Bot.Exceptions.RequestException: Bot API Service Failure
  Cannot load library libgssapi_krb5.so.2

After the single Polling error, no Error handling update, no further
Polling error, and getUpdates from outside returns [] forever.

Fix: install libgssapi-krb5-2 alongside wget in the final stage of
src/GmRelay.Bot/Dockerfile. This also future-proofs Npgsql GSS/SSPI
Kerberos authentication for PostgreSQL.

Closes #129.

Bump version 3.9.5 -> 3.9.6
2026-06-09 12:20:32 +03:00
Toutsu e3e6e841b8 Merge pull request #128: fix(bot): keep Capacity and PickClub wizard steps consistent (v3.9.5)
Deploy Telegram Bot / build-and-push (push) Successful in 7m9s
Deploy Telegram Bot / scan-images (push) Successful in 2m23s
Deploy Telegram Bot / deploy (push) Successful in 54s
Closes #127.
v3.9.5
2026-06-08 22:51:04 +03:00
Toutsu a0a84965b3 chore: bump version 3.9.4 -> 3.9.5
PR Checks / test-and-build (pull_request) Successful in 10m22s
Bugfix patch release for issue #127. Sync the four canonical version sources:
- Directory.Build.props
- compose.yaml (bot, discord, web image tags)
- .gitea/workflows/deploy.yml (VERSION env)
- src/GmRelay.Web/Components/Layout/NavMenu.razor (visible nav-version)
2026-06-08 22:34:27 +03:00
Toutsu 67e8d5b558 fix(bot): keep capacity and club wizard steps consistent
Fix two wizard FSM bugs reported after v3.9.4:

1. Capacity waitlist buttons could still advance the draft without a
   numeric MaxPlayers value. The final submit validation then rejected
   the draft with 'Не заполнены поля: лимит мест'. Now waitlist:on/off
   stay on Capacity until MaxPlayers is set; users must either enter a
   numeric limit or explicitly choose '♾ Без лимита'.

2. PickClub computed NextAfterVisibility before SetClubId, so the first
   club click left the wizard on PickClub and the second click advanced.
   Now ClubId is saved first and NextAfterVisibility is evaluated after
   that mutation, so a valid club click advances on the first try.

TDD:
- WaitlistChoiceWithoutCapacity_StaysOnCapacityStep covers waitlist:on/off.
- PickClub_ValidGuid_AdvancesToPublishOnFirstClick covers the single-click club path.
- Stale Capacity waitlist callback test updated to the safer no-advance contract.

Closes #127
2026-06-08 22:34:18 +03:00
Toutsu 593f8a62fb Merge pull request #126: test: cleanup follow-up from PR #124 review (v3.9.4)
Deploy Telegram Bot / build-and-push (push) Successful in 6m15s
Deploy Telegram Bot / scan-images (push) Successful in 2m20s
Deploy Telegram Bot / deploy (push) Successful in 46s
Closes #125.
v3.9.4
2026-06-08 19:27:58 +03:00