Skip to content

BE: Allow disabling GitHub release info #1108

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stklcode
Copy link

@stklcode stklcode commented May 29, 2025

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make?

The application info object contains details about the latest version which is queried online from GitHub API. While this info can be useful, it raises warning when Kafbat UI is deployed in environments with restricted internet access.

Introduce a new property github.release.info.enabled (default: true) that can be set to false to disable release info and just display the currently running version/commit.

Is there anything you'd like reviewers to focus on?

The original feature was introduced in provectus/kafka-ui#3570

Apparently, the issue was already known during development (provectus/kafka-ui#3570 (review)):

We need a boolean property to make it possible to opt-out of such checks in air-gap environments.

Did I miss anything or was this point just ignored? Anyway with this PR now there it is.

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

For manual testing, start the app with environment variable or property, e.g. GITHUB_RELEASE_INFO_ENABLED=false.

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

PR for documentation update: kafbat/ui-docs#56

@stklcode stklcode requested review from a team as code owners May 29, 2025 09:44
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels May 29, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi stklcode! 👋

Welcome, and thank you for opening your first PR in the repo!

Please wait for triaging by our maintainers.

Please take a look at our contributing guide.

Copy link
Member

@Haarolean Haarolean left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR. I've left some inline comments, PTAL!

if (githubInfoEnabled) {
this.githubReleaseInfo = new GithubReleaseInfo(githubApiMaxWaitTime);
} else {
this.githubReleaseInfo = null;
Copy link
Member

Choose a reason for hiding this comment

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

let's either mark the field as nullable or replace it with some empty object instead to prevent NPEs

Copy link
Member

Choose a reason for hiding this comment

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

Let's also output a bold warning into logs on startup in case this is disabled that running outdated versions is dangerous due to CVEs and we will not provide support for outdated versions per our security policy

Copy link
Author

Choose a reason for hiding this comment

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

Let's also output a bold warning into logs on startup ...

A real "warning", i.e. WARN log level? INFO ... OK, but warning seems little overdone. I'm running about 400 instances in various test clusters and remote systems, no online access, updates and security scans are done by external tooling. Simply shifting Firewall/eBPF warnings to application warnings was not what I had in mind....

Copy link
Member

Choose a reason for hiding this comment

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

It might seem "overdone" until folks start coming up with air-gapped installations requesting support for 2 yo releases.

Copy link
Author

Choose a reason for hiding this comment

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

I get the point. But does a warning really prevent these folks from requesting anything? My experience is you can write "UNMAINTEINED" in 50px bold at the top of a GH issue template and you still get new tickets with the warning not even removed 🤷‍♂️

Copy link
Author

Choose a reason for hiding this comment

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

Nevertheless I've added a log warning. (yet another one to ignore, but at least consistent with other config scenarios).

WARN  [restartedMain] i.k.u.s.ApplicationInfoService: Check for latest release is disabled. Note that old versions are not supported, please make sure that your system is up to date.

@@ -8,6 +8,7 @@

@Slf4j
public class GithubReleaseInfo {
public static final String GITHUB_RELEASE_INFO_ENABLED = "github.release.info.enabled";
Copy link
Member

Choose a reason for hiding this comment

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

Please document this property in the docs too: https://github.com/kafbat/ui-docs

Copy link
Author

Choose a reason for hiding this comment

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

Done: kafbat/ui-docs#56

Also added the 2 pre-existing properties for this feature (timeout, update-rate)

@@ -19,7 +19,7 @@ const Version: React.FC = () => {

return (
<S.Wrapper>
{!isLatestRelease && (
{isLatestRelease === false && (
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to see a visual difference between "no latest release present" and "user disabled version check" in the UI. This is crucial as it's often only the UI screenshots I have to deduct things from.

Copy link
Author

Choose a reason for hiding this comment

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

Any suggestion how such information should look?

Frankly, I don't see any benefit in such information. Currently running version is displayed, if the check failed there's a warning symbol and the information if there's an update available or not can change 1 second after a screenshot was taken, because it's dynamic info.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps a red (rather than yellow) exclamation mark icon (most likely it's an svg, so altering stroke-color should work) with a different text about version check disabled.
The benefit is offloading responsibility of running an oudated and possibly CVE-"enriched" version and giving the maintainers visual signal of what the user's running (red icon -> no version check = most likely outdated -> no support)

Copy link
Author

Choose a reason for hiding this comment

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

A red warning, really?

I've learned to ignore the yellow icon due do failing version checks and yet there are frequent questions if there's something wrong. So annoying users, who have no control whatsoever about the deployed version in our case, with read warning sign that typically means "something is wrong here" ...

Our use case are - you guessed it - isolated systems, mostly dev/staging environments. We allow users some access to the underlying Kafka and deployment/updates are done by some automation/opt team who don't see the UI warnings anyway.

We were looking for a solution to remove the frontend warning, not making it look worse.

Copy link
Member

Choose a reason for hiding this comment

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

You wouldn't imagine the number of issues I've seen where people come with their "up-to-date" installations, only to realize after wasting some time that it's not only an outdated version, but also a fork with completely unrelated functionality that we don't even have. Not sure of a middle ground here. @germanosin thoughts?

Copy link
Author

@stklcode stklcode May 29, 2025

Choose a reason for hiding this comment

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

On the oder end, I've seen questions from users about the warning of "UNKNOWN" version and regular tickets from ops about log warnings that nobody can do anything about.

We have filters on our network logs to prevent alerting from unauthorized access attempts and injected a logging config to suppress the "Authentication is disabled" warning for instances running behind an external auth gateway. But we cannot filter the human eye and regular "just ignore the warning" is not really a satisfactory answer.


Evaluated red and gray symbol (current yellow and none for reference). My preference is "none" or maybe gray 😉

kafkaui_versioncheck

Copy link
Member

Choose a reason for hiding this comment

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

My personal preference: gray

Copy link
Author

Choose a reason for hiding this comment

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

I extended the <WarningIcon> component to (a) use theme's warningIcon color instead of hardcoded color (was #F2C94C, now #FFDD57 ... close enough for me) and (b) allow override by parameter.

Override to infoIcon color (#ABB5BA) with adjusted message in case the check info is not available.

@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/backend Related to backend changes and removed status/triage/manual Manual triage in progress labels May 29, 2025
@Haarolean Haarolean changed the title Allow disabling GitHub release info BE: Allow disabling GitHub release info May 29, 2025
@stklcode stklcode force-pushed the feat/disable-releaseinfo branch from f1f15de to 3c4131c Compare May 29, 2025 12:31
The application info object contains details about the latest version
which is queried online from GitHub API. While this info can be useful,
it raises warning when Kafbat UI is deployed in environments with
restricted internet access.

Introduce a new property "github.release.info.enabled" (default: true)
that can be set to "false" to disable release info and just display the
currently running version/commit.
@stklcode stklcode force-pushed the feat/disable-releaseinfo branch from 3c4131c to bc55bce Compare May 29, 2025 13:04
Extend he WarningIcon template to allow custom coloring with fallback
to theme's "warningIcon" color. If version check is disabled, show a
corresponding info with a "infoIcon" (gray) colored icon instead.
@stklcode stklcode force-pushed the feat/disable-releaseinfo branch from c3a87e3 to c4f2562 Compare May 29, 2025 16:43
@Haarolean Haarolean self-assigned this Jun 11, 2025
@Haarolean Haarolean self-requested a review June 11, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants