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

Do not fetch git username and email if the gitconfig configmap contains the data #777

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Mar 5, 2025

What does this PR do?

Check the workspace-userdata-gitconfig-configmap configmap if it contains gitconfig with username and email and the data is not empty. Only then, try to fetch username and email from a git provider.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes eclipse-che/che#23376

How to test this PR?

N/A

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.

Comment on lines 83 to 93
if (usernameAndEmailFromGitconfigOptional.isEmpty()) {
Optional<Pair<String, String>> usernameAndEmailFromFetcher =
getUsernameAndEmailFromFetcher(namespaceName);
if (usernameAndEmailFromFetcher.isPresent()) {
ConfigMap gitconfigConfigmap = buildGitconfigConfigmap();
Optional<String> gitconfigSectionsOptional =
generateGitconfigSections(gitconfigOptional, usernameAndEmailFromFetcher);
gitconfigConfigmap.setData(
ImmutableMap.of(CONFIGMAP_DATA_KEY, gitconfigSectionsOptional.orElse("")));
client.configMaps().inNamespace(namespaceName).createOrReplace(gitconfigConfigmap);
}
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 extract it to a separate method and add clear javadoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added javadocs to each step.

@vinokurig
Copy link
Contributor Author

/retest

Copy link

openshift-ci bot commented Mar 6, 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 6678d86 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.

@artaleks9
Copy link
Contributor

Verified on Eclipse Che with quay.io/eclipse/che-server:pr-777 - the functionality works properly

Copy link

openshift-ci bot commented Mar 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: artaleks9, ibuziuk, 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

@vinokurig vinokurig merged commit eae5ba1 into main Mar 6, 2025
27 of 28 checks passed
@vinokurig vinokurig deleted the che-23376 branch March 6, 2025 14:13
@devspacesbuild
Copy link

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

vinokurig added a commit that referenced this pull request Mar 6, 2025
…ns the data (#777)

Check the workspace-userdata-gitconfig-configmap configmap if it contains gitconfig with username and email and the data is not empty. Only then, try to fetch username and email from a git provider.
vinokurig added a commit that referenced this pull request Mar 6, 2025
…ns the data (#777)

Check the workspace-userdata-gitconfig-configmap configmap if it contains gitconfig with username and email and the data is not empty. Only then, try to fetch username and email from a git provider.
@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.20 :: server_3.x/387: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/8853 triggered

vinokurig added a commit that referenced this pull request Mar 6, 2025
…ns the data (#777)

Check the workspace-userdata-gitconfig-configmap configmap if it contains gitconfig with username and email and the data is not empty. Only then, try to fetch username and email from a git provider.
@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

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

devspaces-operator-bundle : 3.x :: Failed in 66901388 : BREW:BUILD/STATUS:UNKNOWN
FAILURE:; copied to quay

vinokurig added a commit that referenced this pull request Mar 6, 2025
…ns the data (#777) (#778)

Check the workspace-userdata-gitconfig-configmap configmap if it contains gitconfig with username and email and the data is not empty. Only then, try to fetch username and email from a git provider.
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.

Do not fetch git username and email if the gitconfig configmap contains the data
5 participants