Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove Oracle Database JDBC driver from the Keycloak distribution#22598

Merged
vmuzikar merged 2 commits intokeycloak:release/22.0from
mabartos:oracleRemoval22
Aug 25, 2023
Merged

Remove Oracle Database JDBC driver from the Keycloak distribution#22598
vmuzikar merged 2 commits intokeycloak:release/22.0from
mabartos:oracleRemoval22

Conversation

@mabartos
Copy link
Contributor

@mabartos mabartos commented Aug 22, 2023

Extended version for completion of requirements for 22.x release

Closes #22452

Requirements for 22.x backport:

  • The driver would remain in upstream included by default as it's a breaking change to do in a micro.
  • Introduce -DskipProprietary property to remove the driver. This would be used only by RHBK 22 pipelines. (Only the product profile is introduced; IMHO better approach)
  • Docs and testsuite would need to be adapted to reflect the different behaviour (driver included vs removed) between Keycloak and RHBK.

The -DskipProprietary property is present in the codebase, and moreover, it's possible to ignore the proprietary Oracle JDBC driver by specifying profile -Pproduct. It'll provide us better manageability around product builds as it will not be necessary to include all provided flags which distinguish the build approaches.

EDIT: Only the product profile is introduced.

The -Pproduct profile will need to be provided for other parts of Keycloak anyway.

I'm not sure about the docs changes whether they should be first added to the main in a separate PR and then backported to 22 and used here. To be more specific, there will be a necessity for providing such a functionality even in later Keycloak releases.

@vmuzikar @mhajas WDYT?

@mabartos mabartos requested review from a team as code owners August 22, 2023 08:54
@mabartos mabartos requested a review from a team August 22, 2023 08:54
@mabartos mabartos requested review from mhajas and vmuzikar August 22, 2023 08:55
Copy link
Contributor Author

@mabartos mabartos Aug 22, 2023

Choose a reason for hiding this comment

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

Installing the Oracle JDBC driver only when it's related to RHBK.

@mabartos mabartos added this to the 22.0.2 milestone Aug 22, 2023
@mabartos mabartos added the priority/important Must be worked on very soon label Aug 22, 2023
@mabartos mabartos force-pushed the oracleRemoval22 branch 2 times, most recently from ed9f39c to 5ac4b5b Compare August 22, 2023 10:12
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works as expected. The Oracle JDBC driver is included in the /providers dir only when the product profile is activated.

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't do anything really as we test DB support with GitHub Actions which doesn't use the product profile. Also not sure we should always install the Oracle Driver, but rather only install it when we are testing Oracle.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not for GHA but for QE pipelines.

Copy link
Contributor

@mhajas mhajas left a comment

Choose a reason for hiding this comment

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

Thank you @mabartos! From my point of view LGTM. However, I would wait for a review from @vmuzikar as he was involved in more discussions around this.

@mabartos mabartos self-assigned this Aug 22, 2023
Copy link
Contributor

@stianst stianst left a comment

Choose a reason for hiding this comment

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

Instead of adding another way of marking sections as community/product it should use the same approach as in documentation already. That is also already supported by the product documentation build, so these suggested changes works with downstream doc builds without any changes needed there.

I'm not too keen on including DockerFile examples in the documentation as they are hard and error prone to test and use. Would be better to add examples to keycloak-quickstarts and link to those, but I think we can also live without an actual DockerFile example perhaps.

Final comment is on how we can automate testing. The included profile in the testsuite doesn't really achieve anything as we are testing DB support in community only using GitHub Actions, so our testing will be done with the Oracle driver included in the dist, rather than added to providers directory. I think we'd have to introduce another job in ci.yml that re-builds the distribution without Oracle driver, then adds it to providers, and runs testing for Oracle. That'd be for release/22.0 branch, for main when we remove Oracle driver fully we wouldn't need this additional job, but rather just install the Oracle driver into providers, but think we should only do that in the oracle matrix for legacy-store-integration-tests rather than having it always included as what will happen here.

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't do anything really as we test DB support with GitHub Actions which doesn't use the product profile. Also not sure we should always install the Oracle Driver, but rather only install it when we are testing Oracle.

@mabartos mabartos marked this pull request as draft August 23, 2023 09:34
@mabartos
Copy link
Contributor Author

@stianst Thanks for the review

Instead of adding another way of marking sections as community/product it should use the same approach as in documentation already. That is also already supported by the product documentation build, so these suggested changes works with downstream doc builds without any changes needed there.

Yep, better.

@mabartos
Copy link
Contributor Author

The included profile in the testsuite doesn't really achieve anything as we are testing DB support in community only using GitHub Actions, so our testing will be done with the Oracle driver included in the dist, rather than added to providers directory. I think we'd have to introduce another job in ci.yml that re-builds the distribution without Oracle driver, then adds it to providers, and runs testing for Oracle.

I'm not very familiar with the chosen approach to testing the product. We will not be able to avoid changing certain parts of Keycloak for the product (f.e. GELF support), so also the testing will be slightly different. I've kinda counted on providing the product profile even for the test execution when the product is tested, so we could asses the behavior of the testsuite.

However, in this case, it'd be fine not to use the product profile in the testsuite for these artifacts, but rather the profile that is turned on only when OracleDB is tested.

Introducing the new CI job might make sense to simulate the product behavior; Oracle JDBC driver not included.

@vmuzikar
Copy link
Contributor

Introducing the new CI job might make sense to simulate the product behavior

I'd argue we have internal CI pipelines for this.

Extended version for completion of requirements for 22.x release

Closes keycloak#22452

Co-authored-by: Martin Bartoš <[email protected]>
Co-authored-by: Stian Thorgersen <[email protected]>
@mabartos
Copy link
Contributor Author

mabartos commented Aug 24, 2023

The approach for community/product docs works as expected. I agree to handle the Dockerfiles in follow-up tasks. Moreover, as we still have the QE pipelines that will be used for the product, I'd say this approach might be sufficient; @vmuzikar good argument.

@stianst @mhajas Are you ok with the current approach?

@vmuzikar Could you please squash the commits through GH, or should I do it manually?

@mabartos mabartos marked this pull request as ready for review August 24, 2023 11:26
@vmuzikar vmuzikar requested review from mhajas and stianst August 24, 2023 12:30
Copy link
Contributor

@mhajas mhajas left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @mabartos! I added just one nitpick comment about using ifdef instead of ifeval as we do in other places. I am approving though as I can confirm it works as expected even with ifdef so. I am leaving it up to you whether you want to leave this as is or change it.

@mabartos
Copy link
Contributor Author

@mhajas Done

Copy link
Contributor

@mhajas mhajas left a comment

Choose a reason for hiding this comment

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

thanks @mabartos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ask admins to install the Oracle Database driver separately

5 participants