Skip to content

Complete leave game retirement records#6

Open
amanzhola wants to merge 8 commits into
mainfrom
review_leave_game
Open

Complete leave game retirement records#6
amanzhola wants to merge 8 commits into
mainfrom
review_leave_game

Conversation

@amanzhola

Copy link
Copy Markdown
Owner

Implemented dog retirement by inactivity.

Added:

  • retired_players PostgreSQL table
  • leaderboard endpoint /api/v1/game/records
  • GAME_DB_URL support
  • dogRetirementTime config support
  • retirement records sorting
  • start/maxItems query parameters
  • maxItems validation
  • connection pool for PostgreSQL
  • token invalidation after retirement

Autotests: 52 passed.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Test Results

 1 files   -  5   1 suites   - 5   1m 14s ⏱️ +57s
52 tests  - 54  52 ✅  - 54  0 💤 ±0  0 ❌ ±0 
52 runs   - 77  52 ✅  - 77  0 💤 ±0  0 ❌ ±0 

Results for commit ad4c2fc. ± Comparison against base commit 5ec48af.

This pull request removes 106 and adds 52 tests. Note that renamed tests count towards both.
cpp-backend-tests-practicum.tests.test_s03_flamegraph ‑ test_graph
cpp-backend-tests-practicum.tests.test_s03_flamegraph ‑ test_perf_data
tests.test_s03_find_return ‑ test_map_invalid_verb[Map 1-DELETE]
tests.test_s03_find_return ‑ test_map_invalid_verb[Map 1-OPTIONS]
tests.test_s03_find_return ‑ test_map_invalid_verb[Map 1-PATCH]
tests.test_s03_find_return ‑ test_map_invalid_verb[Map 1-POST]
tests.test_s03_find_return ‑ test_map_invalid_verb[Map 1-PUT]
tests.test_s03_find_return ‑ test_map_invalid_verb[Town-DELETE]
tests.test_s03_find_return ‑ test_map_invalid_verb[Town-OPTIONS]
tests.test_s03_find_return ‑ test_map_invalid_verb[Town-PATCH]
…
tests.test_s04_leave_game ‑ test_a_few_records[map1]
tests.test_s04_leave_game ‑ test_a_few_records[map3]
tests.test_s04_leave_game ‑ test_a_few_records[town]
tests.test_s04_leave_game ‑ test_a_few_zero_records[map1]
tests.test_s04_leave_game ‑ test_a_few_zero_records[map3]
tests.test_s04_leave_game ‑ test_a_few_zero_records[town]
tests.test_s04_leave_game ‑ test_a_hundred_plus_records[map1]
tests.test_s04_leave_game ‑ test_a_hundred_plus_records[map3]
tests.test_s04_leave_game ‑ test_a_hundred_plus_records[town]
tests.test_s04_leave_game ‑ test_a_hundred_records[map1]
…

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не уверен что этот каталог нужен для финального задания спринта


for (const auto& object : collected_objects) {
if (object.type < loot_type_values.size()) {
score += loot_type_values.at(object.type);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Попробуйте использовать более целенаправленные алгоритмы - std::accumulate и аналоги вместо простого цикла с действием. Это улучшает читаемость и позволяет создавать более эффективный код. См. подробности CppCoreGuidelines ES.1


return response;

} catch (...) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Уменьшите использование catch (...). Лучше перехватывать ожидаемый тип исключений, наследник от std::exception. См. рекомендации Boost


return response;

} catch (...) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь тоже

@antlas1 antlas1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошая работа. Отметил небольшие замечания

- Use std::accumulate instead of manual score accumulation (CppCoreGuidelines ES.1)
- Replace catch(...) with catch(const std::exception&) according to Boost recommendations
- Keep README as helper documentation for navigating changes; it does not affect the solution code
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