-
Notifications
You must be signed in to change notification settings - Fork 0
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
TSPS-138 add cbas client integration #49
Conversation
service/build.gradle
Outdated
@@ -35,6 +35,9 @@ dependencies { | |||
implementation "bio.terra:terra-common-lib" // 0.0.94-SNAPSHOT is defined in bio.terra.pipelines.java-common-conventions.gradle | |||
implementation "bio.terra:terra-resource-buffer-client:0.4.3-SNAPSHOT" | |||
|
|||
// hk2 is required to use cbas client, but not correctly exposed by the client | |||
implementation group: "org.glassfish.jersey.inject", name: "jersey-hk2" |
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.
this is pretty weird, i got this from workspace manager https://github.com/DataBiosphere/terra-workspace-manager/blob/a376aad7a021f648d7d688ba9d0555ca54ff9f1a/service/gradle/dependencies.gradle#L42 but I think we should be able to fix it on the cbas client end
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.
should we make tickets to make the fix in the cbas client and update this as necessary?
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.
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.
really nice and clear, thanks!
T execute() throws ApiException; | ||
} | ||
|
||
@SuppressWarnings("java:S125") // The comment here isn't "commented code" |
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.
do we need this? I don't see any comments
service/build.gradle
Outdated
@@ -35,6 +35,9 @@ dependencies { | |||
implementation "bio.terra:terra-common-lib" // 0.0.94-SNAPSHOT is defined in bio.terra.pipelines.java-common-conventions.gradle | |||
implementation "bio.terra:terra-resource-buffer-client:0.4.3-SNAPSHOT" | |||
|
|||
// hk2 is required to use cbas client, but not correctly exposed by the client | |||
implementation group: "org.glassfish.jersey.inject", name: "jersey-hk2" |
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.
should we make tickets to make the fix in the cbas client and update this as necessary?
return apiClient; | ||
} | ||
|
||
PublicApi publicApi(String cbasBaseUri, String accessToken) { |
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.
it'd be helpful to have a brief comment for each of these describing what functionality each is used for
@@ -61,13 +68,29 @@ public List<ListAppResponse> queryForWorkspaceApps() { | |||
samService.getTspsServiceAccountToken(), | |||
imputationConfiguration.workspaceId())); | |||
|
|||
// cbas related calls |
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.
just to remind myself, this whole method queryForWorkspaceApps()
is just a placeholder to make these calls and show they're working, right? eventually these will be moved into flight steps and the uris will be used to make calls etc etc
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.
yup yup exactly
@Autowired CbasConfiguration cbasConfiguration; | ||
|
||
@Test | ||
void verifySamServerConfig() { |
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.
minor: update copy pasta (Sam -> Cbas)
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.
whoops
PublicApi publicApi = cbasClient.publicApi(cbasBaseUri, authToken); | ||
|
||
assertEquals(cbasBaseUri, publicApi.getApiClient().getBasePath()); | ||
assertTrue(publicApi.getApiClient().isDebugging()); |
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.
what sets this to True? is that the default that the CBAS client sets? I guess what I'm really asking is, why are we testing this?
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.
its set to true in the application-test.yml file but realistically there isnt any reason to test this simple of a config. Pretty much just wrote it cuz it was easy and if we ever decide to something more complicated (like the leonardo config) we'll have this set up already
.thenAnswer(errorAnswer) | ||
.thenAnswer(errorAnswer) | ||
.thenAnswer(errorAnswer) | ||
.thenReturn(expectedResponse); |
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.
minor: maybe add a comment somewhere that the max number of attempts is defined as 3 in RetryConfiguration
(this is the kind of thing that now that i've looked this up i'll never have this question again, but coming to this fresh it took me a few minutes to track that down. so not a huge deal, just would be helpful.)
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.
added!
c97a013
to
7f309a0
Compare
7f309a0
to
78cdef0
Compare
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Description
This adds the ability to interact with the cbas client for a given workspace. Currently only added the function to list all methods available. Future work will add more functions as needed
Jira Ticket
https://broadworkbench.atlassian.net/browse/TSPS-138