-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add Azure DevOps Server support #754
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
/retest |
1 similar comment
/retest |
} | ||
|
||
protected AzureDevOpsUrl withDevfileFilenames(List<String> devfileFilenames) { | ||
this.devfileFilenames.addAll(devfileFilenames); | ||
return this; | ||
} | ||
|
||
public AzureDevOpsUrl withServerUrl(String serverUrl) { | ||
this.serverUrl = serverUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When use set serverUrl, then hostname is null, which is used later in getRepositoryLocation
@@ -172,8 +172,19 @@ public Optional<Boolean> isValid(PersonalAccessToken personalAccessToken) { | |||
public Optional<Pair<Boolean, String>> isValid(PersonalAccessTokenParams params) | |||
throws ScmCommunicationException { | |||
if (!isValidScmServerUrl(params.getScmProviderUrl())) { | |||
LOG.debug("not a valid url {} for current fetcher ", params.getScmProviderUrl()); | |||
return Optional.empty(); | |||
if (OAUTH_PROVIDER_NAME.equals(params.getScmProviderName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor this fuction?
For instance, move if (OAUTH_PROVIDER_NAME.equals(params.getScmProviderName())) {
before if (!isValidScmServerUrl(params.getScmProviderUrl())) {
azureDevOpsApiClient.getUserWithPAT( | ||
personalAccessToken.getToken(), personalAccessToken.getScmOrganization()); | ||
return new GitUserData(user.getDisplayName(), user.getEmailAddress()); | ||
if (personalAccessToken.getScmProviderUrl().equals("https://dev.azure.com")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have AzureDevOps
class for contants
What does this PR do?
Add Azure DevOps Server support to use with PAT ONLY, as the azure Devops Api does not support oauth2, see: eclipse-che/che#23306 (comment)
Screenshot/screencast of this PR
What issues does this PR fix or reference?
fixes eclipse-che/che#23306
How to test this PR?
quay.io/eclipse/che-serve:pr-754
Organization
input to enter theCollection
name.See: workspace starts with the devfile resolve.
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.