dasniko / testcontainers-keycloak

A Testcontainer implementation for Keycloak IAM & SSO.
Apache License 2.0
341 stars 53 forks source link

Please rev the major version instead of the minor version for new major versions of keycloak #81

Closed jmax01 closed 1 year ago

jmax01 commented 2 years ago

Description

Please rev the major version instead of the minor version for new major versions of keycloak.

Teams that rely on automated dependency management tools (dependabot, etc) most often set these tools to update by minor version since the majority of projects follow Semver versioning schemes.

The current versioning scheme is incompatible with Semver leading teams to perform workarounds for testcontainers-keycloak.

Motivation

No response

Details

No response

dasniko commented 2 years ago

You can mitigate version conflicts with setting an explicit Keycloak image when creating the container, e.g. new KeycloakContainer("quay.io/keycloak/keycloak:18.0.0"); This way, the testcontainer doesn't use the most recent default image, like specified in the code.

Additionally, when using the keycloak-admin-client dependency, you can exclude the default one and add the desired version to your dependency list.

jmax01 commented 2 years ago

That only works if the commands/flags in KeycloakContainer stay the same between versions.

To me it seems safer and more user friendly to keep MAJOR and MINOR versions incrementing with keycloak's.

markbanierink commented 1 year ago

Maybe getKeycloakVersion() can be made public instead of protected, so we can at least easily check if the provided version is the desired one?

dasniko commented 1 year ago

I decided against aligning the testcontainers-keycloak extension with Keycloak versioning. I'd would clash if we need a patch/minor update of this lib and shortly after this, Keycloak would publish a patch or minor release.

But FWIW, I made the method getKeycloakDefaultVersion() public, as mentioned by @markbanierink