Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

mta set credentials for application #446

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

RichardW98
Copy link
Contributor

@RichardW98 RichardW98 commented Jun 19, 2023

What this PR does / why we need it:

  1. set credentials for mta ssh
  2. fix URI getPath
  3. repositoryUrl with ssh is not url

Which issue(s) this PR fixes:
Fixes #

Change type

  • New feature
  • Bug fix
  • Unit tests
  • Integration tests
  • CI
  • Documentation
  • Auto-generated SDK code

Impacted services

  • Workflow Service
  • Notification Service

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

@@ -105,7 +107,9 @@ else if (result instanceof Result.Success<TaskGroup> success) {
"[Migration analysis report](%s) completed.".formatted(reportURL));
return new DefaultWorkReport(WorkStatus.COMPLETED, workContext);
}
else if ("Failed".equals(success.value().state())) {
else if ("Failed".equals(success.value().state())
|| Arrays.stream(Objects.requireNonNull(success.value().tasks()))
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't a failed task sets the top-level taskgroup as failed? what is the state of the taskgroup in that case? (weird API if so)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to create application with the same name of existing one. the top level is succeed but task is failed

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

@@ -51,6 +54,8 @@ interface MTAApplicationClient {

Result<App> create(App app);

Identity getIdentity(String name);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make that a Result ? the intention is among other not to throw execptions from the client level. They should be stored in the Result of type Failure.

@@ -86,10 +86,12 @@ WorkFlowOption defaultOption() {
@Bean(name = "AnalyzeApplicationAssessment")
@Assessment(parameters = {
@Parameter(key = "repositoryURL", description = "The repository with the code to analyze",
type = WorkParameterType.URL, optional = false),
type = WorkParameterType.TEXT, optional = false),
Copy link
Contributor

Choose a reason for hiding this comment

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

why not URL? because of the protocol that can be ssh? if that's the case I suggest to replace URL with URI which does support that, or at least behind the hood to use URI as the resolver

Copy link
Contributor

Choose a reason for hiding this comment

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

Java URI support opaque schemes . URI.create("foo://bar.baz").getScheme() // foo"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok let's replace URL with URI in next pr. it involves UI work too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UI's pattern for url is "^(https?)://"

@@ -15,7 +15,7 @@ public static String getPath(String server, String workspaceID, String projectID
throws URISyntaxException {
String path = "/workspaces/%s/projects/%s/outputs/%s".formatted(workspaceID, projectID, outputID);
URI baseUri = new URI(server);
return new URI(baseUri.getScheme(), baseUri.getAuthority(), path, null, null).getPath();
return new URI(baseUri.getScheme(), baseUri.getAuthority(), path, null, null).toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to update the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will update it

@rgolangh
Copy link
Contributor

/lgtm
/approve

@openshift-ci
Copy link

openshift-ci bot commented Jun 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rgolangh

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

The pull request process is described 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

@openshift-merge-robot openshift-merge-robot merged commit 78974a7 into parodos-dev:main Jun 19, 2023
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants