guardian / frontend

The Guardian DotCom.
https://theguardian.com
Other
5.83k stars 555 forks source link

Cricket scorecard: Add full name when two bowlers have the same surname #27442

Open ioannakok opened 4 weeks ago

ioannakok commented 4 weeks ago

Please reply to this thread when fixed: https://groups.google.com/a/guardian.co.uk/g/dotcom.platform/c/47eLqEyj6LM

When there are two players with the same surname bowling for a team, ww want to be able to tell which one of them dismissed which batter on the wickets.

See example below with two Fernandos of the Sri Lanka team.

Game: https://www.theguardian.com/sport/cricket/match/2024-08-23/england-cricket-team

Useful tool to see what data we're receiving from PA API: https://frontend.gutools.co.uk/troubleshoot/cricket

ioannakok commented 1 day ago

Here's where we've got to so far: https://github.com/guardian/frontend/pull/27464. There is a bug in this code and full name does not show as we would expect. Speak with @rtyley if you have any questions.

To test locally:

  1. We're going to use this game for testing https://www.theguardian.com/sport/cricket/match/2024-09-06/england-cricket-team because Sri Lanka has two bowlers with the same surname, Fernando.

  2. Override frontend configuration as per instructions.

  3. You need to override pa.cricket.api.key= locally. You can find the value in parameter store. Use the one for prod.

  4. Run sport app

  5. Hit localhost:9000. You need to do this first for the agents to kick off

  6. WAIT. It takes some time for the data you need to be pulled from PA to the agents.

  7. Search the logs locally. Once you see the following log message, you're ready to test: Image

  8. Go to localhost:9000/sport/cricket/match/2024-09-06/england-cricket-team

  9. If you want to download the real data from PA for this match in XML, you can do it using the cricket troubleshooter. The id of the match we're interested is 39145392-3f2e-8022-35f3-eac0b0654610