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

Changes to Che-Theia preferences are persisted and loaded at every workspace start using a ConfigMap #20622

Closed
Tracked by #20830
l0rd opened this issue Oct 11, 2021 · 26 comments
Assignees
Labels
area/plugins kind/enhancement A feature request - must adhere to the feature request template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system. sprint/current
Milestone

Comments

@l0rd
Copy link
Contributor

l0rd commented Oct 11, 2021

Is your enhancement related to a problem? Please describe

Che-Theia preferences are not persisted anymore. When I refresh the browser, when I restart a workapce ore when I create a new workspace, the preferences are reset.

Describe the solution you'd like

Persist preferences after refresh/restart and across all user workspaces.

Release Notes Text

When Che-Theia user preferences (including plugins preferences) are changed, they are persisted in a Kubernetes ConfigMap. When a workspace is restarted or when a new workspace is created the existing user preferences will be loaded. There is still a bug that prevents color theme preferences to be persisted. This is something that already worked whith DevWorkspace disabled.

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Oct 11, 2021
@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 Oct 11, 2021
@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 Oct 12, 2021
@l0rd
Copy link
Contributor Author

l0rd commented Oct 12, 2021

@svor @vinokurig: since che-server doesn't manage users preferences anymore, we should use a mechanism similar to what we do for secrets but using a configmap to store the preferences of a user.

@l0rd
Copy link
Contributor Author

l0rd commented Oct 13, 2021

Related to eclipse-che/che-server#117

@vinokurig
Copy link
Contributor

blocked by #20749

@vinokurig vinokurig added the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Nov 9, 2021
@svor svor mentioned this issue Nov 9, 2021
18 tasks
@svor svor removed the sprint/next label Nov 10, 2021
@max-cx
Copy link

max-cx commented Nov 15, 2021

Hi, a question to the assignee of this issue:

Will the outcome require any changes to the relevant content of the Installation Guide or Administration Guide or End-user Guide?

Yes/No?

@vinokurig
Copy link
Contributor

@max-cx

Will the outcome require any changes to the relevant content of the Installation Guide or Administration Guide or End-user Guide?

I don't think so, this is just a technical debt.

@benoitf
Copy link
Contributor

benoitf commented Dec 21, 2021

moving issue to 7.42 milestone as this issue is part of the endgame

@svor
Copy link
Contributor

svor commented Jan 20, 2022

@svor svor closed this as completed Jan 20, 2022
@l0rd
Copy link
Contributor Author

l0rd commented Jan 23, 2022

This doesn't work for me. I am trying on next channel but preferences are not persisted. I have started a workspace, I set git user name and email, I have changed the theme but when the workspace is restarted these preferences are lost. Reopening.

@l0rd l0rd reopened this Jan 23, 2022
@svor
Copy link
Contributor

svor commented Jan 24, 2022

for some reason colorTheme preferences were overridden after restarting , other preferences were restored without problems:

screencast-nimbus-capture-2022.01.24-13_35_24.mp4

@l0rd
Copy link
Contributor Author

l0rd commented Jan 24, 2022

@svor I forgot to mention that I had setup gitcredentials secret with my github token in my namespace. That may have an effect on git user name and email.

To clarify I have done the following on an openshift cluster:

  • created the git credentials secret
  • started the workspace
  • set git user name and email
  • restarted the workspace and the git settings were lost

@svor
Copy link
Contributor

svor commented Jan 24, 2022

some investigation around clolorTheme: I've tried to set colorTheme on old version of Che 7.40.2 and see the same bug that preference is overridden:

screencast-git.luolix.top-2022.01.24-14_14_01.mp4

@svor
Copy link
Contributor

svor commented Jan 24, 2022

@l0rd @vinokurig I've created another issue about restoring Theme Color preferences #21065
It's reproducible with older versions of Che and I don't think it's related to the current work.

@l0rd
Copy link
Contributor Author

l0rd commented Jan 24, 2022

The problem with git config may be related to the new way of the DevWorkspace to set that: devfile/devworkspace-operator#708 (comment)?

@vinokurig
Copy link
Contributor

Yes, the problem is that gitconfig is not stored when workspace stops, but I am not sure if this is related to this issue.

@vinokurig
Copy link
Contributor

@l0rd Could you please elaborate on how did you set git user name and email?
If you updated the .gitconfig file directly, then it is related to a problem that gitconfig is not stored.
If you updated the settings.json file then it didn't cause the .gitconfig because of the bug which is fixed here: eclipse-che/che-theia#1307. Anyway the problem is that gitconfig is not stored yet.

@l0rd
Copy link
Contributor Author

l0rd commented Jan 25, 2022

I create a secret:

USERNAME=<my-gh-username>
PERSONAL_ACCESS_TOKEN=<my-access-token>
GIT_WEBSITE="github.com"
CREDENTIALS=$(echo -n "https://${USERNAME}:${PERSONAL_ACCESS_TOKEN}@${GIT_WEBSITE}" | base64)  #<== this command works on macOS only

kubectl apply -f - <<EOF
kind: Secret
apiVersion: v1
metadata:
  name: git-credentials-secret
  annotations:
    controller.devfile.io/mount-path: /etc/git-credentials/
  labels:
    controller.devfile.io/watch-secret: 'true'
    controller.devfile.io/git-credential: 'true'
type: Opaque
data:
  credentials: ${CREDENTIALS}
EOF

And then I updated the settings.json file (from Che-Theia preferences widget) with git name and email.

@vinokurig
Copy link
Contributor

I tried to create the secret by oAuth flow but this is brocken: #21077
When I tried to manually create the secret and restart the workspace I had such errors:
screenshot-192 168 64 132 nip io-2022 01 26-18_51_31

@l0rd l0rd changed the title Persist Che-Theia preferences when DW is enabled Changes to Che-Theia preferences are persisted and loaded at every workspace start using a ConfigMap Jan 27, 2022
@l0rd l0rd added new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording labels Jan 27, 2022
@vinokurig
Copy link
Contributor

So I managed to add a github token secret to the user namespace, and the settings.xml with the git settings was restored after workspace restart.

@svor svor removed the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Jan 27, 2022
@vinokurig
Copy link
Contributor

The settings.json file with git settings was successfully restored on openshift che either.

@svor
Copy link
Contributor

svor commented Jan 28, 2022

@l0rd do you still have this problem?
we can't reproduce the problem when git preferences are not restored

@l0rd
Copy link
Contributor Author

l0rd commented Jan 28, 2022

Let me start a cluster to check that

@l0rd
Copy link
Contributor Author

l0rd commented Jan 28, 2022

I was not able to start workspace (#21089). I will try again on Monday.

@svor svor mentioned this issue Jan 31, 2022
18 tasks
@l0rd
Copy link
Contributor Author

l0rd commented Feb 1, 2022

@l0rd do you still have this problem?

@svor @vinokurig unfortunately I still have problems although one thing is working:

  1. When I restart the workspace after I set the git configuration, the settings.json is persisted 👍

image

  1. But even if git.user.name and git.user.email are set in settings.json I still get this message in Theia status bar:

image

  1. And the git config is not set in the command line

image

@svor
Copy link
Contributor

svor commented Feb 2, 2022

@l0rd Thanks for testing it. It seems that the problem is not related to the Preferences persisting. The information about username/email in the status bar is taken form the .gitconfig which doesn't exist in the container. The problem with .gitconfig is related to devfile/devworkspace-operator#694, I'm going to close current issue, please reopen it if you don't think so

@svor svor closed this as completed Feb 2, 2022
@l0rd
Copy link
Contributor Author

l0rd commented Feb 3, 2022

@svor @vinokurig I have created this separate issue: #21115

@devstudio-release
Copy link

sync'd to Red Hat JIRA https://issues.redhat.com/browse/CRW-2714

@max-cx max-cx removed the status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording label Jan 12, 2023
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. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

7 participants