Skip to content
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

Open
wants to merge 3 commits into
base: py3
Choose a base branch
from

Conversation

devyntk
Copy link
Contributor

@devyntk devyntk commented May 15, 2024

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:

  • District teams
  • Regional teams
  • Teams that were listed as backups, both in the backup field as well as a fake third pick
  • Events that have specialized alliance names

Screenshots (if appropriate):

image
image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change API specifications or require data migrations)

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.22%. Comparing base (24652da) to head (afff8d5).
Report is 170 commits behind head on py3.

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.
📢 Have feedback on the report? Share it here.

@@ -1,5 +1,6 @@
from typing import List, TypedDict

from backend.common.models.event_team_status import EventTeamStatusPlayoff
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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:
Copy link
Member

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.

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.

None yet

2 participants