Skip to content

feat(connections): warn then connecting to an end-of-life server COMPASS-9083 #6888

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kraenhansen
Copy link
Contributor

@kraenhansen kraenhansen commented May 2, 2025

Description

Merging this PR will:

  • Add a isEndOfLife property on the BuildInfo returned byt the data-service, derived from the version.
  • Add tests for ☝️
  • Add a warning modal similar to the "Non Genuine Connection Modal" shown when connecting to MongoDB 4.4.
  • Remove the "cancel" button from the "Non Genuine Connection Modal", to align with the now modal and because it serves no purpose and is actually slightly misleading as connecting cannot be cancelled by pressing the button.

Screenshot 2025-05-02 at 10 13 34

Screen.Recording.2025-05-02.at.10.11.41.mov

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

  • Will the build info be present and potentially misleading when connecting to a non-genuine server? And do we care about that?

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@kraenhansen kraenhansen added the no release notes Fix or feature not for release notes label May 2, 2025
@kraenhansen kraenhansen self-assigned this May 2, 2025
@github-actions github-actions bot added the feat label May 2, 2025
@kraenhansen
Copy link
Contributor Author

kraenhansen commented May 2, 2025

😬 I just realized (and remembered) that @alenakhineika had already made a draft PR adding this #6805 🙈 I'll pick some of her ideas into this branch (as this has tests) and add a call to the update server.

export function isEndOfLifeVersion(version: string) {
try {
const [major, minor] = version.split('.').map((part) => parseInt(part, 10));
return (major === 4 && minor <= 4) || major < 4;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're already taking this from the buildInfo output, is there any reason not to use versionArray directly?

Copy link
Contributor Author

@kraenhansen kraenhansen May 2, 2025

Choose a reason for hiding this comment

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

Mostly that I wasn't aware that this was included in the build info.

Never the less, I expect these lines to go away and instead I'll be using "semver" like Alena did in her PR:

export function isEndOfLifeServer(
serverVersion: string | undefined | null
): boolean {
if (!serverVersion) {
return true;
}
try {
return semver.satisfies(serverVersion, `<=${getEoLServerVersion()}`);
} catch (e) {
return true;
}
}

Comment on lines +5 to +6
const { HADRON_AUTO_UPDATE_ENDPOINT, HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE } =
process.env;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if there's a better place to put these. Some package intended to share constants across the main and renderer processes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants