-
Notifications
You must be signed in to change notification settings - Fork 111
Add ability to set up git user name and email in theia preferences #424
Conversation
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
return {} as UserConfiguration; | ||
} | ||
|
||
const userName = gitConfig.user.name; |
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.
Up to you, but it can be a bit simplier:
const {name, email} = gitConfig.user;
return { name, email }
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.
Thanks! Updated.
return; | ||
} | ||
|
||
const gitConfig = { user: {} }; |
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.
You can improve typization here:
const gitConfig = { user : {} as UserConfiguration };
if (config.name) {
gitConfig.user.name = config.name;
}
...
Or create object and use it.:
export interface GitConfig {
user: UserConfiguration
}
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.
Thanks, updated.
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
userPreferences = JSON.stringify(JSON.parse(userPreferences)); | ||
const userPreferences = JSON.parse(userPreferencesContent); | ||
this.fireUserPreferencesModify(userPreferences); | ||
userPreferencesContent = JSON.stringify(userPreferences); |
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.
Sorry, why do you override userPreferencesContent = JSON.stringify(userPreferences);
? You have already got content like string in the code above:
let userPreferencesContent = await readFile(THEIA_USER_PREFERENCES_PATH, 'utf8');
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.
The origin logic was not modified in this piece of code, just extracted parsed JSON object to fire it in event. 1) we read settings.json
; 2) validate it through JSON.parse
; 3) fire event with parsed preferences (was added); 4) call JSON.stringify
, I suppose just for formatting JSON string; 5) update user preferences with new value.
Agree, looks a bit odd, but decided not to remove this line.
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
import * as nsfw from 'nsfw'; | ||
import { Disposable } from '@theia/core'; | ||
|
||
export const GIT_CONFIG_PATH = resolve(homedir(), '.gitconfig'); |
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 is better to have path.resolve
here, because resolve is often used in promises.
extensions/eclipse-che-theia-git-provisioner/src/node/git-configuration-controller.ts
Outdated
Show resolved
Hide resolved
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
The PR was checked locally. The Happy Path scenario passed without any failures. |
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
Signed-off-by: Vlad Zhukovskyi <vzhukovs@redhat.com>
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
* Use png icons for Kubernetes plugin * Update regexp for icon validation * Update README Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
What does this PR do?
This changes proposal is addition to eclipse-che/che#14402 and adds ability to configure git user name and email through Theia preferences.
Demo for this PR: https://www.youtube.com/watch?v=Q_XsUWR_mJY&feature=youtu.be
Signed-off-by: Vlad Zhukovskyi vzhukovs@redhat.com
What issues does this PR fix or reference?
eclipse-che/che#13959
Release Notes
Add ability to set up git user name and email in theia preferences
Docs PR