* Add tests to check git-flow on 'azure-devops' git-provider
* Refactor methods
* Upfdate tests
* Update 'pat-secret.yaml' file
* Update the '.ci/openshift-ci/Dockerfile'
* Exclude 'testFactoryResolverNoPatOAuth' from the test
* Fix variable name
* Refactor '<testClone>' methods to handle errors more informative
A user claims that he couldn't start a workspace form GitLab repository because of the raw file location request doesn't contain the ref query parameter. Rework the way of generating the GitLab raw file location function to permanently add the ref query param.
Duplicate the git-credentials secret creation step on create personal access token secret. Currently this step is performed on workspace provision step but in this case the PAT secret might be initialised when the provision is finished. In order to synchronise the personal access token secret and git credentials secret creation step duplicate the git credentials secret creation step after the PAT secret creation step.
Refactor the get(scmServerUrl) function in the KubernetesPersonalAccessTokenManager class
Remove the personalAccessTokenManager.get() call from the OAuth API getToken() method. The OAuth API must not know anything about PAT secrets. It should get tokens only by requesting an SCM provider OAuth API.
Fix validating the Bitbucket-Server PAT method by requesting user instead of requesting.
This prevents the code execution going to a recursive loop: bitbucketServerApiClient.getPersonalAccessToken() calls oauthApi.getToken() which referred to personalAccessTokenManager.getToken() which validated the token by calling scmPersonalAccessTokenFetcher.getScmUsername() -> bitbucketServerApiClient.getPersonalAccessToken().
https://github.com/eclipse/che/issues/22407
Comment out the mattermost notification so it doesn't fail the release workflow, but leaving it in the file so I remember to replace it.
Do not substring .git while parsing Azure DevOps Urls. Azure doesn't add the .git suffix neither to the generated clone URLs nor to the browser repository URLs.
Change user.getName() to user.getLogin() in the GitHub getTokenScopes() API request, in order to fix a bug where NullPointer exception is appeared when a GitHub user request returns a user with null in the name field.
Ignore the che.eclipse.org/scm-username annotation when fetching token from a PAT secret. Instead fetch the username from the isValid(<token>) request.
Pass string to ObjectMapper instead of InputStream in order to avoid No content to map due to end-of-input error caused by jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream.
An error was discovered in our customers environment
Since Azure git provider do not support username for its user object, use username string as username in the git credentials file if the PAT is related to Azure Devops: https://username:<token>@dev.azure.com
On workspace start iterate user PAT secrets. If a PAT secret is not included to the devworkspace-merged-git-credentials secret, create a git credentials secret based on the PAT secret.
Remove the redundant logic of creation an empty workspace-credentials-secret secret.
* Create 'Dockerfile' file to configure ci-operator
* Update 'build-pr-check.yml' github action
* Add tests to check git flow without PAT setup
* Add tests to check git flow with PAT setup
---------
Co-authored-by: artaleks9 <artaleks9@users.noreply.github.com>
Co-authored-by: Igor Vinokur <ivinokur@redhat.com>
Pass user neme instead of user id when creating a PAT secret for bitbucket-server in order to fix the generation of thegit-credentials-secret secret which requires the user name: https://<user name>:<token>@<host name>.
Change the OAUTH_PROVIDER_NAME constant from bitbucket to bitbucket-server in order to fix the git user data initialisation flow, when a PAT is initialised in a user namespace.