-
Notifications
You must be signed in to change notification settings - Fork 30k
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
[web] expose api to customize generation of machine id and label #122652
Comments
Can you please elaborate your proposal? |
@sandy081 yes, I meant to add following api to interface ICurrentMachineProvider {
readonly id?: string
readonly name?: string
}
/**
* Settings sync options
*/
interface ISettingsSyncOptions {
/**
* A provider for the current machine info.
*/
readonly currentMachineProvider?: ICurrentMachineProvider;
} In Gitpod case we would implement it like: currentMachineProvider: {
get id(): string {
// encode a Gitpod workspace id into a machine id to allow associate machines with workspaces
return info.workspaceId + ':' + generateUuid();
},
get name(): string {
// it will display something like `silver-wren-puyfsx22 (Gitpod)` as a machine label by default in Gitpod
return info.workspaceId + '(Gitpod)';
}
} On implementation side I thought to refactor export interface ICurrentMachineService {
getId(): Promise<string>;
getName(): string;
} Default implementation will do the same as for now and for web workbench there will be a subclass checking |
@sandy081 Would you consider anything like that? What is your plan to clean up machines data in Codespaces if the machine gets removed? Maybe it is worth to persist codespace id as a part of the machine data to be able to remove entries for removed machines? |
I think #122457 is related, in the sense that machines should be removed if possible automatically if the remote machine does not exist anymore. |
Also related to #114640 in sense of giving more meaningful names. |
I think we can customize the default label but not the machineId. Because, it is coupled with client sync state. So the id has to be unique per sync instance. If you open the same remote from multiple browsers/machine you can see it labelled as |
Would it be an option to allow some additional data as a part of machine record? I wonder don't you experience an issue then machine resource data growth so big that one hits max payload error? |
Your consent is true and it would makes sense to limit no of machines and probably show last sync timestamp of the machine so that users can remove. |
/duplicate
|
Currently in Gitpod or Codespaces it looks like:
It would be nicer if the machine label reflected the origin and machine id could point to the underlying workspace, in Gitpod case we would like to remove such records if the workspace is deleted.
I'm fine to make a PR if you are open to it.
The text was updated successfully, but these errors were encountered: