Skip to content

Conversation

@peepeepopapapeepeepo
Copy link

What are the relevant tickets?

N/A

Description (What does it do?)

Fixes Keycloak SCIM extension build system and resolves SCIM provisioning failures by upgrading build dependencies and OpenRewrite configuration.

Key Changes:

  • Upgraded Gradle: 4.4.1 → 8.5 for modern dependency compatibility
  • Updated Java target: 8 → 21 to match Keycloak container runtime
  • Fixed shadow plugin: 4.0.4 → 8.1.1 for Gradle 8+ compatibility
  • Modernized OpenRewrite: 6.24.0 → 7.18.0 with comprehensive recipes

Problem Solved:
The original build used outdated OpenRewrite versions with aggressive code transformations that broke SCIM provisioning functionality. Users were successfully created in IAM Identity Center (HTTP 201) but the SCIM SDK threw InvalidResponseFromScimEndpointException due to problematic code transformations.

Result:

  • ✅ SCIM provisioning now works correctly
  • ✅ Modern build system with Java 21
  • ✅ Comprehensive code quality improvements
  • ✅ Consistent code formatting

How can this be tested?

  1. Build the extension:

    gradle shadowJar
  2. Deploy to Keycloak:

    • Copy build/libs/keycloak-scim-1.0-SNAPSHOT-all.jar to Keycloak providers directory
    • Restart Keycloak
  3. Test SCIM provisioning:

    • Configure SCIM endpoint in Keycloak admin console
    • Create a test user in Keycloak
    • Verify user is successfully provisioned to target system (e.g., AWS IAM Identity Center)
    • Confirm no InvalidResponseFromScimEndpointException errors in logs
  4. Verify extension loading:

    • Check Keycloak logs for successful SCIM extension loading
    • Confirm no Liquibase checksum errors

Additional Context

This fix addresses a critical issue where the SCIM extension would load successfully but fail during actual user provisioning. The root cause was identified as problematic OpenRewrite code transformations in the original build configuration.

The new build configuration uses modern, stable versions of all dependencies while maintaining full SCIM functionality. The comprehensive OpenRewrite setup now provides code quality improvements without breaking the core functionality.

Build Requirements:

  • Java 21+
  • Gradle 8.5+

Runtime Requirements:

  • Keycloak 25.0+
  • Java 21+ (matches Keycloak container)

@gemini-code-assist
Copy link

Summary of Changes

Hello @peepeepopapapeepeepo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue preventing successful SCIM provisioning in the Keycloak SCIM extension. By upgrading core build dependencies like Gradle, Java target version, and OpenRewrite, the PR ensures the extension builds correctly, functions as expected, and aligns with modern development standards. The changes specifically resolve problematic code transformations that previously broke SCIM functionality, leading to a stable and compliant build system.

Highlights

  • Gradle Upgrade: The build system has been upgraded from Gradle 4.4.1 to 8.5, ensuring compatibility with modern dependencies and build practices.
  • Java Target Version Update: The Java target version has been updated from 8 to 21, aligning with the Keycloak container runtime requirements.
  • Shadow Plugin Fix: The shadow plugin version has been upgraded from 4.0.4 to 8.1.1 to ensure proper functionality with Gradle 8+.
  • OpenRewrite Modernization: OpenRewrite has been modernized from version 6.24.0 to 7.18.0, including comprehensive recipes to improve code quality without breaking functionality.
  • SCIM Provisioning Fix: This update resolves critical SCIM provisioning failures caused by outdated OpenRewrite configurations that led to InvalidResponseFromScimEndpointException.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the project to Java 21 by updating dependencies and configuration in build.gradle. The changes correctly set the Java version and update the OpenRewrite plugin. I've added one suggestion to make the Java version configuration more explicit and robust by using a java block and setting both source and target compatibility, which is a recommended practice in modern Gradle builds.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant