-
Notifications
You must be signed in to change notification settings - Fork 1
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
Prevent runtime incompatibility with 'early-semver' content-api-scala-client
#305
Prevent runtime incompatibility with 'early-semver' content-api-scala-client
#305
Conversation
content-api-scala-client
d3dbe31
to
dc2a96b
Compare
@@ -185,6 +185,7 @@ object TestModel { | |||
tags: Seq[StubTag], | |||
elements: Option[Seq[StubElement]] | |||
) extends Content { | |||
val channels: Option[Seq[ContentChannel]] = None // alternatively, create StubContentChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to cope with the channels model changes introduced in guardian/content-api-models#211, which was released with content-api-models
v17.6.0 in April 2023.
As none of the tests in facia-scala-client
seem to care about the value of channels
, its easiest to just make this value None
rather than create a StubContentChannel
- but if in the future tests do eventually need this value, we can make one.
project/dependencies.scala
Outdated
@@ -1,7 +1,7 @@ | |||
import sbt._ | |||
|
|||
object Dependencies { | |||
val capiVersion = "19.2.3" | |||
val capiVersion = "20.0.2-PREVIEW.update-to-latest-version-of-content-api-models-scala.2024-01-25T1416.253f60e5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the preview of guardian/content-api-scala-client#405
@rtyley has published a preview version of this PR with release workflow run #7, based on commit dc2a96b: 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, specifying the prevent-runtime-incompatibility-with-early-semver-content-api-scala-client branch, or use the GitHub CLI 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, leaving the branch as the default, or use the GitHub CLI command: gh workflow run release.yml |
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. guardian/content-api-scala-client#405
dc2a96b
to
fd2cdc6
Compare
@@ -1,7 +1,7 @@ | |||
import sbt._ | |||
|
|||
object Dependencies { | |||
val capiVersion = "19.2.3" | |||
val capiVersion = "20.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIth guardian/content-api-scala-client#405, content-api-scala-client
v20.0.2 is the first release of the library that depends upon a version of content-api-models
(v18.0.1) where both of them use, and adhere to, 'early-semver'.
@rtyley has published a preview version of this PR with release workflow run #8, based on commit fd2cdc6: 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, specifying the prevent-runtime-incompatibility-with-early-semver-content-api-scala-client branch, or use the GitHub CLI 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, leaving the branch as the default, or use the GitHub CLI command: gh workflow run release.yml |
9767f9d
to
fd2cdc6
Compare
This was taken care of in #306, so we can close this PR! |
closed, as already taken care of in #306 !
Now that both
content-api-models
andcontent-api-scala-client
are both using 'early-semver' and adhering to it (thanks togha-scala-library-release-workflow
andsbt-version-policy
) this should mean that it is no longer possible for a single project that depends oncontent-api-scala-client
,content-api-models
andfacia-scala-client
to have incompatible versions of those artifacts.This should prevent horrible runtime compatibility errors like #301, which occurred with the rollout of the innocent-looking changes in
facia-scala-client
v4.0.6.sbt
messaging when incompatibility is introducedAs 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: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 version20.0.x
(thex
there is because we can tolerate PATCH level version differences).