-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
task: Add banner encouraging edge upgrade #6018
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ export type UiFlags = { | |
executiveDashboard?: boolean; | ||
changeRequestConflictHandling?: boolean; | ||
feedbackComments?: Variant; | ||
displayUpgradeEdgeBanner?: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth considering making this a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something we'd like to have in OSS deploys as well, and hopefully not for very long. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I think having it as a normal flag is fine. |
||
}; | ||
|
||
export interface IVersionInfo { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import { IPrivateProjectChecker } from '../../private-project/privateProjectChec | |
import { IFlagResolver, SYSTEM_USER } from '../../../types'; | ||
import { ALL_PROJECTS } from '../../../util'; | ||
import { Logger } from '../../../logger'; | ||
import { SemVer } from 'semver'; | ||
|
||
export default class ClientInstanceService { | ||
apps = {}; | ||
|
@@ -224,4 +225,20 @@ export default class ClientInstanceService { | |
async removeInstancesOlderThanTwoDays(): Promise<void> { | ||
return this.clientInstanceStore.removeInstancesOlderThanTwoDays(); | ||
} | ||
|
||
async usesSdkOlderThan( | ||
sdkName: string, | ||
sdkVersion: string, | ||
): Promise<boolean> { | ||
const semver = new SemVer(sdkVersion); | ||
const instancesOfSdk = | ||
await this.clientInstanceStore.getBySdkName(sdkName); | ||
return instancesOfSdk.some((instance) => { | ||
if (instance.sdkVersion) { | ||
const [_sdkName, sdkVersion] = instance.sdkVersion.split(':'); | ||
const instanceUsedSemver = new SemVer(sdkVersion); | ||
return instanceUsedSemver < semver; | ||
} | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was just checking that SemVer can throw some exceptions: https://github.com/npm/node-semver/blob/main/classes/semver.js and we have a helper class that does the try catch: https://github.com/Unleash/unleash/blob/chore/update-features-created-by-user-id/src/lib/util/semver.ts maybe we should just try catch here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Good point. I'll have a look |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to #5239 (comment) - I would recommend we create a new
EdgeUpgradeBanner
(or similar) component and add it directly toApp.tsx
. I don't think it makes much sense to add it here, especially as it is not an internal banner.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Will fix