guardian / facia-scala-client

Low level client for the Facia JSON API
Other
2 stars 1 forks source link

Add ETag-caching (and AWS SDK v2) support #287

Open rtyley opened 1 year ago

rtyley commented 1 year ago

This change adds these improvements:

The ETag-caching library itself is also being used in DotCom PROD, introduced with https://github.com/guardian/frontend/pull/26338.

Usage

Example PR consuming this updated version of the FAPI client: https://github.com/guardian/ophan/pull/5506.

Updated FAPI artifact layout

To use FAPI with the new AWS SDK v2 support, users must now have a dependency on two FAPI artifacts:

Due to needing to support the matrix of:

...it's best not to try to produce an artifact that corresponds to every single possible combination! Consequently, this change provides artifacts that are specific to the different versions of AWS SDK (or at least, could do - if AWS SDK v1 was moved out of common code), and artifacts that are specific to the different versions of Play-JSON, and allow the user to combine them as needed. A similar approach was used with guardian/play-secret-rotation: https://github.com/guardian/play-secret-rotation/pull/8

In order for the different artifacts to have interfaces they can use to join together and become a single useful Facia client, there is a fapi-client-core artifact. Any code that doesn't depend on either the actual AWS SDK version, or the JSON classes, (which isn't much!) can live in there. In particular, we have:

This PR is still draft, but I wanted to put it on your radar @fredex42 !

Noisy logging associated with absent collection JSON

The etag-caching library has been updated with https://github.com/guardian/etag-caching/pull/56 to avoid excessive logging that would occur in the Facia client, due to it typically trying to access collections that aren't yet persisted: https://github.com/guardian/facia-scala-client/pull/32.

rtyley commented 1 year ago

As discussed at standup, I'm going to do a release of facia-scala-client as it currently is (v4.0.6), and get that in use, before introducing this new update.

gu-scala-library-release[bot] commented 3 months ago

@rtyley has published a preview version of this PR with release workflow run #22, based on commit 1b68eb57ce932cb2635343b915bcfb930b609ff8:

8.0.1-PREVIEW.add-etag-caching-support.2024-07-24T1411.1b68eb57

Want to make another preview release? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), specifying the add-etag-caching-support branch, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml --ref add-etag-caching-support
Want to make a full release after this PR is merged? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), leaving the branch as the default, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml
gu-scala-library-release[bot] commented 3 months ago

@rtyley has published a preview version of this PR with release workflow run #26, based on commit 41d95456b8d17803abc294c48b22c2cf96f11cd6:

8.0.2-PREVIEW.add-etag-caching-support.2024-07-25T0748.41d95456

Want to make another preview release? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), specifying the add-etag-caching-support branch, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml --ref add-etag-caching-support
Want to make a full release after this PR is merged? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), leaving the branch as the default, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml
gu-scala-library-release[bot] commented 15 hours ago

@rtyley has published a preview version of this PR with release workflow run #45, based on commit 23b11d9e959951e84a2c251a1af9c6150cb58895:

12.1.1-PREVIEW.add-etag-caching-support.2024-10-31T1659.23b11d9e

Want to make another preview release? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), specifying the add-etag-caching-support branch, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml --ref add-etag-caching-support
Want to make a full release after this PR is merged? Click 'Run workflow' in the [GitHub UI](https://github.com/guardian/facia-scala-client/actions/workflows/release.yml), leaving the branch as the default, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml