Skip to content
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

Create or update local git config when user changes Che Theia git settings #21115

Closed
Tracked by #694 ...
l0rd opened this issue Feb 3, 2022 · 1 comment
Closed
Tracked by #694 ...
Assignees
Labels
area/plugins kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/current

Comments

@l0rd
Copy link
Contributor

l0rd commented Feb 3, 2022

Is your enhancement related to a problem? Please describe

If the user changes git user and git email in Che Theia settings.json and restarts the workspace he still has this message in the status bar:

image

Moreover the gitconfig ConfigMap expected by the DevWorkspace operator is not created so if using git from the command line the email and name will be missing and the user won't be able to commit:

image

Describe the solution you'd like

When a user changes the git user name or git user email settings in Che-Theia, if the gitconfig ConfigMap
- doesn't exist: create one with the content matching the one in Theia settings.json
- exist: update the content with the new changes but don't delete other gitconfig settings

  • Theia user preferences should be persisted in a configmap (that's already the case, the CM is workspace-preferences-configmap)
  • At Theia startup copy git user name and email from Theia user preferences to local git config. But only if they don't exist yet (for example if local git config file doesn't exist or if it exist or it doesn't include user.email or user.name). Note that /etc/gitconfig/ may exist and have different values but Theia preference and local git config have higher priority.
  • If user sets or updates Theia preferences the values should be copied to local git config if previous values matched. That means that if theia preferences and gitconfig had the same values than they should be kept in sync, if they had different values they should not be sync.
  • If local git config is updated (manually by the user), Theia user preferences should not be changed.
  • If local git config is created, Theia preferences should not be changed.

Note that local git config is the file under $PROJECT_SOURCE/.git/config

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Feb 3, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Feb 3, 2022
@l0rd l0rd added area/plugins severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Feb 3, 2022
@svor svor mentioned this issue Feb 3, 2022
18 tasks
@svor svor mentioned this issue Apr 6, 2022
45 tasks
@l0rd l0rd changed the title Create or update gitconfig ConfigMap when user change Che Theia git settings Create or update local git config when user changes Che Theia git settings Apr 25, 2022
@l0rd
Copy link
Contributor Author

l0rd commented Apr 25, 2022

@svor @vinokurig I have updated this issue description to reflect the discussion we had this morning

@svor svor closed this as completed May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

4 participants