-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alliance details to team detail page #5937
base: py3
Are you sure you want to change the base?
Add alliance details to team detail page #5937
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## py3 #5937 +/- ##
===========================================
- Coverage 93.10% 71.22% -21.89%
===========================================
Files 658 8 -650
Lines 42145 344 -41801
Branches 60 60
===========================================
- Hits 39241 245 -38996
+ Misses 2896 91 -2805
Partials 8 8 ☔ View full report in Codecov by Sentry. |
@@ -1,5 +1,6 @@ | |||
from typing import List, TypedDict | |||
|
|||
from backend.common.models.event_team_status import EventTeamStatusPlayoff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this create a circular import error with src/backend/common/models/event_team_status.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are current failing because of this, but I don't want to invest too much time into refactoring this to avoid the circular import until the issue of whether this is the correct data structure (see other comment) is resolved more.
@@ -10,6 +11,7 @@ class _EventAllianceOptional(TypedDict, total=False): | |||
declines: List[TeamKey] | |||
name: str | |||
backup: EventAllianceBackup | |||
status: EventTeamStatusPlayoff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? I don't see where it is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change to make the python model match what's in the DB. Without it, the type check fails: https://github.com/the-blue-alliance/the-blue-alliance/actions/runs/9097667894/job/25006007976
This seems to be the "intended" material of the alliance data, as even the test data includes it (see https://github.com/the-blue-alliance/the-blue-alliance/blob/py3/src/backend/common/helpers/tests/data/2024test_alliances.json and other backend helper data), but I can't for the life of me figure out where the data is coming from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh i see. yeah this must've been overlooked originally somehow.
|
||
alliance = None | ||
alliance_pick = None | ||
if event.details and event.details.alliance_selections: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if this could get broken out into a helper function (e.g. in a new file like alliance_helper.py
) since there's some quite involved logic here that would be nice to unit test separately.
This PR provides details about Alliance Selection and that Alliance's progression.
Motivation and Context
I often find myself switching back and forth between event pages and alliance pages to determine an team's alliance, and find that the data should just be presented inline.
How Has This Been Tested?
There seem to be no automated tests for the team renderer, so no automated tests were done. Manual tests were done with:
Screenshots (if appropriate):
Types of changes