-
Notifications
You must be signed in to change notification settings - Fork 92
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
Auto update notification #5884
Auto update notification #5884
Conversation
E2E Tests 🚀 ? |
@@ -9,6 +9,7 @@ import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurati | |||
import { Registry } from '../../registry/common/platform.js'; | |||
|
|||
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration); | |||
// --- START POSITRON --- |
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.
Nit, here and elsewhere: should use the standard casing for comment fences (Start Positron
)
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.
I keep forgetting this!
@@ -57,8 +78,11 @@ export abstract class AbstractUpdateService implements IUpdateService { | |||
@IEnvironmentMainService private readonly environmentMainService: IEnvironmentMainService, | |||
@IRequestService protected requestService: IRequestService, | |||
@ILogService protected logService: ILogService, | |||
@IProductService protected readonly productService: IProductService | |||
// --- START POSITRON --- |
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.
Could you split this into several more granular code fences? When merging, it's important that the code fences wind up in the conflicted text.
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.
That makes sense!
} | ||
|
||
protected doCheckForUpdates(context: any): void { |
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.
It looks like this whole function from upstream got refactored out. Could you leave it in place so that it doesn't generate merge conflicts when it changes upstream? It's cool to mark it with @ts-ignore
if it becomes unused.
src/vs/platform/update/test/electron-main/positronVersions.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Jonathan <[email protected]> Signed-off-by: Tim Mok <[email protected]>
Address #1837
Checks the releases JSON and determines if there is an update available. This can be manually invoked from the cog menu at the bottom of the left sidebar or Positron will do so once per hour.
The Output view shows debug messages in the Main output. It will show the update URL (points to the platform's release JSON) at startup. Update checks are logged here as well. If the update URL is unavailable, a toast notification displays the error with more details in the Output view.
There didn't seem to be a calendar versioning package that supported build numbers and zero-padding so that's why there's a Positron version utility. It seems important to know that
2024.12.0-1
is older than2024.12.0-2
if we want to be able to test updating private releases.There are two environment variables for internal use:
POSITRON_UPDATE_CHANNEL
- The default isprereleases
but can be set todailies
orstaging
for releases that haven't been published to Positron's releases page on GitHub.dailies
isn't auto-publishing at the moment andstaging
has a 1-day expiry.POSITRON_AUTO_UPDATE
- Setting to1
will automatically download the update and notify the user when it is ready to restart to complete the install. This is for testing and needs a certified build (at least on Mac).This will check is functional for all platforms with the following caveats:
system
release info. I think differentiating the system and user installers via a key/value inproduct.json
would work.deb
release info. It could use the same solution as Windows to differentiate the install type. Despite no auto-update support, it might be useful to know.Manual check when there are no updates available
Update is available as indicated by the bottom of the left sidebar
The cog menu will change the check update action to download the update. This download action opens Positron's releases page in the user's browser.
QA Notes
Positron Builds can run the action to push a staging release if we want to run an internal test. This is experimental as the generated release info may be stale (rerunning doesn't automatically update the hosted file) or expired (file is auto-deleted after one day).