FIRST-Tech-Challenge / scorekeeper

FIRST Tech Challenge Live Scorekeeper Software
87 stars 21 forks source link

[FTC-Events API] Advancement from LT -> State CMP does not match what is configured in FTC Scoring #687

Open timtim17 opened 8 months ago

timtim17 commented 8 months ago

Describe the bug In FTC Scoring, we have league tournaments in our region that are configured to advance to the state championship. Using the API, we can see the number of teams advancing from the state championship to FIRST Championship.

❯  curl --user [...] https://ftc-api.firstinspires.org/v2.0/2023/advancement/USWACMP
{"advancesTo":"FTCCMP1","slots":4,"advancement":null}%

However, for advancement from the previous layer, league tournaments to states, the API returns "0", despite the events being configured with advancement in FTC Scoring.

❯  curl --user [...] https://ftc-api.firstinspires.org/v2.0/2023/advancement/USWAFELT1
{"advancesTo":"USWACMP","slots":0,"advancement":null}%
❯  curl --user [...] https://ftc-api.firstinspires.org/v2.0/2023/advancement/USWACMP/source
[..., {"advancedFrom":"USWAFELT1","advancedFromRegion":null,"slots":0,"advancement":null}, ...]%
FTC Scoring screenshot

To Reproduce Steps to reproduce the behavior:

  1. Have one level of regional play advance to another, with # of teams configured in FTC Scoring (i.e. USWAFELT1 -> USWACMP)
  2. Send an authenticated request to the FTC API advancement endpoints
  3. Observe "slots" is equal to 0 despite having a non-zero value in FTC Scoring

Expected behavior The API should return the number of advancement slots as configured in FTC Scoring.

Device (please complete the following information):

Additional context Possible additional nuance: Is there a usecase where advancement is configured in FTC Scoring, but is not meant to be known by the public yet? As in, having it accessible in the API would "leak" the number of advancement slots to the next level?

tvbarnette999 commented 8 months ago

The advancement API & FTC Events UI currently does not show the advancement allocations for intra-regional advancement until the advancing event is published. This is to prevent a "leak" as you mention, as the FTC-Scoring UI does not yet allow the manual publishing of the advancement value itself. Once that has been implemented, the API will show it as you expect. Sorry for the confusion - we forgot to put a note about this behavior in the API docs.