Skip to content

Conversation

@dlabrecq
Copy link
Contributor

@dlabrecq dlabrecq commented Nov 19, 2025

  • Add hidden UI version to verify Konflux image has been updated
  • Rename notFound to match uiVersion component
  • Remove unused build_deploy.sh and pr_check.sh scripts

Summary by Sourcery

Expose a hidden UI version indicator across multiple applications by injecting git metadata at build time and renaming the NotFound imports to match the reorganized ui-lib structure

New Features:

  • Add UiVersion component in ui-lib to render a hidden UI version tag with branch and commit hash
  • Render UiVersion in HCCM, ROS, and OnPrem application roots (including the ROS optimizations wrapper)

Enhancements:

  • Update NotFound imports in HCCM and ROS routes to use the refactored '@koku-ui/ui-lib/components/page/notFound' path

Build:

  • Integrate git-revision-webpack-plugin into HCCM and ROS webpack configs to inject COMMITHASH and BRANCH environment variables
  • Add git-revision-webpack-plugin dependency to HCCM and ROS package.json files

@dlabrecq dlabrecq requested review from a team as code owners November 19, 2025 02:58
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 19, 2025

Reviewer's Guide

This PR introduces a hidden UI version component that embeds the Git branch and commit hash into each UI app via environment variables and renames the NotFound component path to match the new structure.

Class diagram for the new UiVersion component

classDiagram
  class UiVersion {
    +appName?: string
    +render(): JSX.Element
  }
  UiVersion --|> React.Component
Loading

File-Level Changes

Change Details Files
Add hidden UI version indicator component
  • Create UiVersion component in ui-lib with hidden div showing appName, branch, and commit hash
  • Export UiVersion via index.ts
  • Import and render UiVersion in each app’s App.tsx
  • Import and render UiVersion in ROS optimizationsWrapper
libs/ui-lib/src/components/page/uiVersion/uiVersion.tsx
libs/ui-lib/src/components/page/uiVersion/index.ts
apps/koku-ui-hccm/src/app.tsx
apps/koku-ui-ros/src/app.tsx
apps/koku-ui-ros/src/fed-modules/optimizationsWrapper.tsx
Expose Git branch and commit hash via webpack
  • Import and instantiate GitRevisionPlugin in fec.config.js
  • Add GitRevisionPlugin and DefinePlugin entries for COMMITHASH and BRANCH
  • Add git-revision-webpack-plugin to package.json dependencies
apps/koku-ui-hccm/fec.config.js
apps/koku-ui-hccm/package.json
apps/koku-ui-ros/fec.config.js
apps/koku-ui-ros/package.json
Rename NotFound component path
  • Update NotFound import to '@koku-ui/ui-lib/components/page/notFound' in both route configurations
  • Remove old NotFound component file from ui-lib
apps/koku-ui-hccm/src/routes.tsx
apps/koku-ui-ros/src/routes.tsx
libs/ui-lib/src/components/NotFound/NotFound.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dlabrecq, 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 introduces a mechanism to embed UI version information (Git branch and commit hash) directly into the application builds for "koku-ui-hccm" and "koku-ui-ros". This is achieved by leveraging Webpack plugins and a new "UiVersion" React component, which renders this data as a hidden element in the DOM. The primary purpose is to facilitate verification of deployed Konflux images, ensuring that the correct UI version is running. Additionally, the "NotFound" component has been refactored and moved to a more logical location within the "ui-lib".

Highlights

  • Version Tracking Integration: Implemented "GitRevisionPlugin" and "webpack.DefinePlugin" in "fec.config.js" for "koku-ui-hccm" and "koku-ui-ros" to embed Git commit hash and branch into the build process, making this information available at runtime.
  • New UI Version Component: Introduced a "UiVersion" React component that renders a hidden "div" containing the application name, Git branch, and commit hash. This component is integrated into the main application entry points for "koku-ui-hccm" and "koku-ui-ros", enabling verification of deployed Konflux images.
  • Component Refactoring: Renamed and relocated the "NotFound" component from "components/NotFound/NotFound" to "components/page/notFound" across multiple applications ("koku-ui-hccm", "koku-ui-onprem", "koku-ui-ros") for improved organization and consistency within the "ui-lib".
  • Dependency Updates: Added "git-revision-webpack-plugin" to "package.json" and updated "package-lock.json" to include new dependencies like "git-sha-webpack-plugin", "bluebird", and "git-bundle-sha" to support the new version tracking functionality.
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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The webpack config changes are duplicated in multiple apps—consider extracting the GitRevisionPlugin setup into a shared config to reduce duplication.
  • You added UiVersion to hccm and ros but not to the on-prem app—consider including the version marker there for consistency across all UI flavors.
  • Ensure the NotFound component deletion aligns with the new import path and that the renamed component exists in ui-lib to avoid broken imports.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The webpack config changes are duplicated in multiple apps—consider extracting the GitRevisionPlugin setup into a shared config to reduce duplication.
- You added UiVersion to hccm and ros but not to the on-prem app—consider including the version marker there for consistency across all UI flavors.
- Ensure the NotFound component deletion aligns with the new import path and that the renamed component exists in ui-lib to avoid broken imports.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.07%. Comparing base (acafaa0) to head (57b270c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4674   +/-   ##
=======================================
  Coverage   87.07%   87.07%           
=======================================
  Files         480      480           
  Lines        9078     9078           
  Branches     2195     2195           
=======================================
  Hits         7905     7905           
  Misses       1107     1107           
  Partials       66       66           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@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 successfully adds a hidden UI version identifier to the koku-ui-hccm and koku-ui-ros applications by leveraging git-revision-webpack-plugin. A new reusable UiVersion component has been created for this purpose. The changes also include refactoring the import path for the NotFound component.

My review includes suggestions to improve the robustness of the new UiVersion component and to clean up an apparently unused dependency. Most importantly, it appears the implementation for the koku-ui-onprem application is incomplete, as it's missing the UiVersion component and its related build configurations, contrary to the PR's description.

@dlabrecq dlabrecq merged commit ccf4ab6 into project-koku:main Nov 19, 2025
9 checks passed
@dlabrecq dlabrecq deleted the ui-version branch November 19, 2025 04:28
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