Skip to content

Conversation

@tonytw1
Copy link
Contributor

@tonytw1 tonytw1 commented Sep 2, 2025

What does this change?

Cropper uses GridClient for it's RPC to Media API.

Moving this call to GridClient helps to enclosure all the service to service URL and HTTP client concerns in one place.
This makes life slightly easier for anyone thinking about changing the layout of the service URLs.

This call was probably the only service to service call circa 2021. GridClient seems to be how more recent service to service calls are done.

Get SourceImage requests additional fields via media-api query parameters so add queryStringParameters parameter to makeGetRequestAsync.

Extract the media api uri to image id validation to a function for testing and make it validate image URIs rather than blanket Media API.

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

@tonytw1 tonytw1 force-pushed the eelpie/cropper-uses-gridclient-for-image-details branch from 61f8002 to 1e4c97e Compare September 2, 2025 07:44
@tonytw1 tonytw1 marked this pull request as ready for review September 2, 2025 17:23
@tonytw1 tonytw1 requested a review from a team as a code owner September 2, 2025 17:23
@tonytw1 tonytw1 force-pushed the eelpie/cropper-uses-gridclient-for-image-details branch from 1e4c97e to 9c3a5ca Compare September 2, 2025 17:24
@tonytw1 tonytw1 force-pushed the eelpie/cropper-uses-gridclient-for-image-details branch from 9c3a5ca to 970fc60 Compare September 27, 2025 16:43
@@ -0,0 +1,16 @@
package controllers

trait MediaApiUrls {
Copy link
Member

Choose a reason for hiding this comment

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

definitely nitpicking here, but I think I'd have a mild preference for helpers like this without any dependencies to be in an object rather than a trait

Suggested change
trait MediaApiUrls {
object MediaApiUrls {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This looks better.
Import MediaApiUrls._ and lose the with MediaApiUrls

Amended and rebased.

Copy link
Member

@andrew-nowak andrew-nowak left a comment

Choose a reason for hiding this comment

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

lgtm, let me know if you disagree with my nitpick and I can merge as is

… API.

Moving this call to GridClient helps to enclosure all the service to service URL and HTTP client concerns in one place.

This call was probably the only service to service call circa 2021. GridClient seems to be how more recent service to service calls are done.

Get SourceImage requests additional fields via media-api query parameters so add queryStringParameters parameter to makeGetRequestAsync.

Extract the media api uri to image id validation to a function for testing and make it validate image URIs rather than blanket Media API.
@tonytw1 tonytw1 force-pushed the eelpie/cropper-uses-gridclient-for-image-details branch from 970fc60 to 1f45970 Compare November 14, 2025 18:10
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