-
Notifications
You must be signed in to change notification settings - Fork 27
mta set credentials for application #446
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,10 @@ | |
record Repository(String kind, String url, String branch) { | ||
} | ||
|
||
record App(int id, String name, Repository repository) { | ||
record App(int id, String name, Repository repository, Identity[] identities) { | ||
} | ||
|
||
record Identity(int id, String name) { | ||
} | ||
|
||
record Mode(boolean binary, boolean withDeps, boolean diva, String artifact) { | ||
|
@@ -30,7 +33,7 @@ static TaskGroup ofCloudReadiness(int appID) { | |
new Data(new Mode(false, false, false, ""), "/windup/report", new Rules("", null), | ||
new Scope(false, new Packages(new String[] {}, new String[] {})), new String[] {}, | ||
new String[] { "cloud-readiness" }), | ||
null, new Task[] { new Task(new App(appID, "parodos", null), null, | ||
null, new Task[] { new Task(new App(appID, "parodos", null, null), null, | ||
String.format("parodos.%s.windup", appID), null, null, null) }); | ||
} | ||
} | ||
|
@@ -51,6 +54,8 @@ interface MTAApplicationClient { | |
|
||
Result<App> create(App app); | ||
|
||
Identity getIdentity(String name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
} | ||
|
||
interface MTATaskGroupClient { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to update the test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will update it |
||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Java URI support opaque schemes . There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UI's pattern for url is "^(https?)://" |
||
@Parameter(key = "applicationName", description = "The name of the application to analyze", | ||
type = WorkParameterType.TEXT, optional = false), | ||
@Parameter(key = "branch", description = "The repository branch to analyze", type = WorkParameterType.TEXT, | ||
optional = true), | ||
@Parameter(key = "identity", description = "The identity of ssh key in MTA", type = WorkParameterType.TEXT, | ||
optional = true) }) | ||
public WorkFlow AnalyzeApplicationAssessment(CreateApplicationTask createApplicationTask, | ||
GetApplicationTask getAppTask, SubmitAnalysisTask submitAnalysisTask) { | ||
|
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.
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)
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.
I tried to create application with the same name of existing one. the top level is succeed but task is failed
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.
ack