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

chore: Apply git user data configmap to mount to /etc/gitconfig #305

Merged
merged 3 commits into from
May 27, 2022
Merged

Conversation

vinokurig
Copy link
Contributor

What does this PR do?

Add a workspace provisioner that checks registered git oAuth providers. When first provider found, a configmap with git user data, fetched from the corresponding git service, with mount to /etc/gitconfig is created.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#20938

How to test this PR?

  1. Deploy che to a cluster: chectl server:deploy --platform=openshift -i=quay.io/ivinokur/che-server:next
    where quay.io/ivinokur/che-server:next is che-server image built from the PR.
  2. Configure GitHub oAth
  3. Start a factory from a private GitHub repo e.g. https://github.com/vinokurig/test-extension/tree/devfile2
  4. Check that workspace-userdata-gitconfig configmap is created in the user namespace:
kind: ConfigMap
apiVersion: v1
metadata:
  name: workspace-userdata-gitconfig
  namespace: <user namespace>
  labels:
    controller.devfile.io/mount-to-devworkspace: 'true'
    controller.devfile.io/watch-configmap: 'true'
  annotations:
    controller.devfile.io/mount-as: subpath
    controller.devfile.io/mount-path: /etc/
data:
  gitconfig: "[user]\n\tname = <username>\n\temail = <email>"

Tested with github.com. Didn't test with gitlab and bitbucket as only on-premises versions are supported.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but did not have a chance to test.

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as described in the description with my private repo on GitHub, works as expected:
screenshot-console-openshift-console apps ci-ln-fbdg8cb-72292 origin-ci-int-gce dev rhcloud com-2022 05 25-11_51_13

screenshot-eclipse-che apps ci-ln-fbdg8cb-72292 origin-ci-int-gce dev rhcloud com-2022 05 25-11_50_32

@skabashnyuk
Copy link
Contributor

What would be the way for the user to override this information?

@svor
Copy link
Contributor

svor commented May 25, 2022

What would be the way for the user to override this information?

one of the possible way is Theia preferences:
screenshot-eclipse-che apps ci-ln-fbdg8cb-72292 origin-ci-int-gce dev rhcloud com-2022 05 25-12_42_43

@skabashnyuk
Copy link
Contributor

Cool thanks

@svor svor merged commit 68c1af0 into main May 27, 2022
@svor svor deleted the che-20938 branch May 27, 2022 08:56
@che-bot che-bot added this to the 7.49 milestone May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants