Skip to content

Fix missing get_hacker_info import causing new routers to fail#327

Merged
Big-Lolo merged 2 commits intointegrationfrom
copilot/fix-routers-not-showing
Oct 21, 2025
Merged

Fix missing get_hacker_info import causing new routers to fail#327
Big-Lolo merged 2 commits intointegrationfrom
copilot/fix-routers-not-showing

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Problem

Two newly added router endpoints were failing at runtime with NameError:

  • GET /{event_id}/pendinggruped (get_pending_hackers_gruped)
  • GET /{event_id}/hackers_participants_gruped_list (get_hackers_participants_gruped_list)

While the routers were properly defined in router_v1.py and registered with FastAPI, they would crash when called because the underlying service methods referenced get_hacker_info() which was not imported.

Root Cause

The service methods in src/impl/Event/service.py use the helper function get_hacker_info() from src/utils/service_utils.py:

  • get_hackers_participants_list() - line 582
  • get_hackers_participants_gruped_list() - lines 624, 634

However, the import statement at line 27 was missing this function:

# Before
from src.utils.service_utils import check_image, set_existing_data, subtract_lists

Solution

Added get_hacker_info to the import list:

# After
from src.utils.service_utils import (
    check_image,
    set_existing_data,
    subtract_lists,
    get_hacker_info,
)

Testing

Verified that:

  • ✅ The module imports successfully without errors
  • get_hacker_info is now available in the service namespace
  • ✅ All three affected service methods are accessible
  • ✅ Both routers are properly registered with FastAPI
  • ✅ The function is callable and ready for runtime use

The routers will now work correctly when called via the API.

Fixes #311

Original prompt

This section details on the original issue you should resolve

<issue_title>Routers not showing</issue_title>
<issue_description>New routers added on last Pull Request are not showing.
get_pending_hackers_gruped
get_hackers_participants_gruped_list</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #326


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Big-Lolo <95545807+Big-Lolo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix routers not showing after last PR Fix missing get_hacker_info import causing new routers to fail Oct 21, 2025
Copilot AI requested a review from Big-Lolo October 21, 2025 14:46
@Big-Lolo Big-Lolo marked this pull request as ready for review October 21, 2025 14:52
@Big-Lolo Big-Lolo merged commit 13f5722 into integration Oct 21, 2025
3 of 5 checks passed
@Big-Lolo
Copy link
Member

@copilot in https://domain/docs#/ is not showing services added

@Big-Lolo Big-Lolo deleted the copilot/fix-routers-not-showing branch October 21, 2025 15:02
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