guardian / facia-scala-client

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

Prevent runtime incompatibility with 'early-semver' `content-api-scala-client` #305

Closed rtyley closed 8 months ago

rtyley commented 9 months ago

closed, as already taken care of in https://github.com/guardian/facia-scala-client/pull/306 !

Now that both content-api-models and content-api-scala-client are both using 'early-semver' and adhering to it (thanks to gha-scala-library-release-workflow and sbt-version-policy) this should mean that it is no longer possible for a single project that depends on content-api-scala-client, content-api-models and facia-scala-client to have incompatible versions of those artifacts.

This should prevent horrible runtime compatibility errors like https://github.com/guardian/facia-scala-client/issues/301, which occurred with the rollout of the innocent-looking changes in facia-scala-client v4.0.6.

sbt messaging when incompatibility is introduced

As ana example, this is the "suspected to be binary incompatible" compile time error you'll get in facia-tool if you try to upgrade the FAPI client library to 5.0.0, without also upgrading the version of the CAPI client to match:

[error] (update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error] 
[error]     * com.gu:content-api-client_2.13:20.0.2 (early-semver) is selected over 19.2.1
[error]         +- com.gu:fapi-client-play28_2.13:5.0.0               (depends on 20.0.2)
[error]         +- com.gu:content-api-client-default_2.13:19.2.1      (depends on 19.2.1)

Just upgrading the CAPI client version to the ultimately-selected version (20.0.2) will fix the problem here.

In general, you want to upgrade any related library to be compiled against the selected library version - so in the example above, any library we're using in facia-tool that depends on the CAPI client, needs to have been compiled against CAPI client version 20.0.x (the x there is because we can tolerate PATCH level version differences).

github-actions[bot] commented 9 months ago

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

5.0.0-PREVIEW.prevent-runtime-incompatibility-with-early-semver-content-api-scala-client.2024-01-25T1557.dc2a96be

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 prevent-runtime-incompatibility-with-early-semver-content-api-scala-client branch, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml --ref prevent-runtime-incompatibility-with-early-semver-content-api-scala-client
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
github-actions[bot] commented 9 months ago

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

5.0.0-PREVIEW.prevent-runtime-incompatibility-with-early-semver-content-api-scala-client.2024-01-25T1802.fd2cdc6a

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 prevent-runtime-incompatibility-with-early-semver-content-api-scala-client branch, or use the [GitHub CLI](https://cli.github.com/) command: gh workflow run release.yml --ref prevent-runtime-incompatibility-with-early-semver-content-api-scala-client
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
rtyley commented 8 months ago

This was taken care of in https://github.com/guardian/facia-scala-client/pull/306, so we can close this PR!