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

Change data source for organisations_for_world_location method #1204

Merged
merged 3 commits into from
Jul 31, 2023

Conversation

brucebolt
Copy link
Member

@brucebolt brucebolt commented Jul 27, 2023

This ends reliance on the Whitehall API by changing the data source to use Search API and Content Store.

The output is in an identical format, but is no longer paginated.

Trello card

@brucebolt brucebolt force-pushed the update-world-organisation-method branch 5 times, most recently from b2608f2 to 3116981 Compare July 31, 2023 08:52
@brucebolt brucebolt marked this pull request as ready for review July 31, 2023 08:54
@brucebolt brucebolt force-pushed the update-world-organisation-method branch 3 times, most recently from cefe38e to 982b370 Compare July 31, 2023 11:12
Copy link
Contributor

@jkempster34 jkempster34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Out of curiosity, did you test to see how much longer the request takes now that we need to fetch multiple content items.

I'm also wondering if it's worth highlighting in the commit messages that we had to make multiple requests because thats the only sensible option at this time?

@brucebolt
Copy link
Member Author

Out of curiosity, did you test to see how much longer the request takes now that we need to fetch multiple content items.

It takes around 3-4 times longer to make these requests. However I noticed the only application to use this method (Smart Answers) caches the response anyway, so the number of requests should be very minimal.

I'm also wondering if it's worth highlighting in the commit messages that we had to make multiple requests because thats the only sensible option at this time?

Nice idea. I'll add that in.

This ends reliance on the Whitehall API by changing the data source to
use Search API and Content Store.

The output is in an identical format, but is no longer paginated.

Also increasing the test coverage by ensuring we are correctly
transforming the data. Previously we only checked that the title was
correct.

We are having to make multiple requests to Content Store (one per
organisation found in Search API) as there is no current way of
retreiving this data in bulk. We believe very few organisations have
more than a handful of organisations, so the number of requests will be
limited.
We are no longer using the Whitehall API, so can remove the pact tests.

The equivalent change has been made in Whitehall: alphagov/whitehall#8029
@brucebolt brucebolt force-pushed the update-world-organisation-method branch from 982b370 to 2ccad30 Compare July 31, 2023 13:47
@brucebolt brucebolt merged commit 3e5616d into main Jul 31, 2023
@brucebolt brucebolt deleted the update-world-organisation-method branch July 31, 2023 14:19
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