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

Rework the gitconfig configmap provision #766

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Rework the gitconfig configmap provision #766

merged 2 commits into from
Feb 20, 2025

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Feb 18, 2025

What does this PR do?

Enhance the provision of the workspace gitconfig, to be able to respect data another from username and email.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-7947

How to test this PR?

  1. Deploy che with the pull request image: quay.io/eclipse/che-server:pr-766
  2. Go to dashboard user preferences -> Gitconfig tab -> click Switch to Viewer, see:
[user]
    name=""
    email=""
  1. Go to Personal Access Token tab and add a PAT.
  2. Go back to the Gitconfig tab.

See: username and email were fetched from the git provider's user account.

PR Checklist

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

Release Notes

Reviewers

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

@vinokurig
Copy link
Contributor Author

/retest

@@ -109,7 +109,7 @@ protected void configure() {
namespaceConfigurators.addBinding().to(WorkspaceServiceAccountConfigurator.class);
namespaceConfigurators.addBinding().to(UserProfileConfigurator.class);
namespaceConfigurators.addBinding().to(UserPreferencesConfigurator.class);
namespaceConfigurators.addBinding().to(GitconfigUserDataConfigurator.class);
namespaceConfigurators.addBinding().to(GitconfigConfigmapConfigurator.class);
Copy link
Member

Choose a reason for hiding this comment

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

Can we just call it GitconfigConfigurator ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@openshift-ci openshift-ci bot removed the lgtm label Feb 20, 2025
ImmutableMap.of(
"controller.devfile.io/mount-as", "subpath", "controller.devfile.io/mount-path", "/etc");
private final Pattern usernmaePattern =
Pattern.compile("\\[user](.|\\s)*name\\s*=\\s*(?<username>.*)");

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '[user]' and containing many repetitions of ' '.
private final Pattern usernmaePattern =
Pattern.compile("\\[user](.|\\s)*name\\s*=\\s*(?<username>.*)");
private final Pattern emailPattern =
Pattern.compile("\\[user](.|\\s)*email\\s*=\\s*(?<email>.*)");

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '[user]' and containing many repetitions of ' '.
@artaleks9
Copy link
Contributor

Verified on Eclipse Che with quay.io/eclipse/che-server:pr-766

the functionality works properly

Copy link

openshift-ci bot commented Feb 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: artaleks9, tolusha, vinokurig

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Feb 20, 2025

@vinokurig: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v14-gitlab-with-oauth-setup-flow b4cf813 link true /test v14-gitlab-with-oauth-setup-flow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@vinokurig vinokurig merged commit d81a700 into main Feb 20, 2025
26 of 28 checks passed
@vinokurig vinokurig deleted the CRW-7947 branch February 20, 2025 15:05
@devspacesbuild
Copy link

Build 3.20 :: server_3.x/383: Console, Changes, Git Data

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.20 :: get-sources-rhpkg-container-build_3.x/8945: FAILURE

server : 3.x :: Failed in 66771381 : BREW:BUILD/STATUS:UNKNOWN
FAILURE:; copied to quay

vinokurig added a commit that referenced this pull request Feb 26, 2025
Enhance the provision of the workspace gitconfig, to be able to respect data another from username and email.
vinokurig added a commit that referenced this pull request Feb 27, 2025
Enhance the provision of the workspace gitconfig, to be able to respect data another from username and email.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants