Skip to content

Commit 0fea0b2

Browse files
committed
Use helmchart names for pact identifiers.
Rename the pacticipant names to the recommended convention. * See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern. * See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helmchart name. * This must be paired with corresponding changes in [BPM](https://github.com/DataBiosphere/terra-billing-profile-manager) maintain existing contract verification coverage. * There are not currently any [TPS](https://github.com/DataBiosphere/terra-policy-service) contract verification tests, so no updates needed there.
1 parent 6a56280 commit 0fea0b2

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.github/workflows/consumer_contract_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
wsm-consumer-contract-tests:
5858
runs-on: ubuntu-latest
59-
needs: [init-github-context]
59+
needs: [ init-github-context ]
6060
outputs:
6161
pact-b64: ${{ steps.encode-pact.outputs.pact-b64 }}
6262

@@ -72,7 +72,7 @@ jobs:
7272
- name: Output consumer contract as non-breaking base64 string
7373
id: encode-pact
7474
run: |
75-
NON_BREAKING_B64=$(cat service/build/pacts/wsm-consumer-bpm-provider.json | base64 -w 0)
75+
NON_BREAKING_B64=$(cat service/build/pacts/wsm-bpm.json | base64 -w 0)
7676
echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT
7777
7878
publish-contracts:

service/src/test/java/bio/terra/workspace/pact/ProfileApiTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ProfileApiTest {
3232
static final String dummyAzureProfileId = "4a5afeaa-b3b2-fa51-8e4e-9dbf294b7837";
3333
static final String dummyGCPProfileId = "37bfb7e0-8261-4160-9ae7-882800d6464f";
3434

35-
@Pact(consumer = "wsm-consumer", provider = "bpm-provider")
35+
@Pact(consumer = "workspacemanager", provider = "bpm")
3636
public RequestResponsePact existingAzureBillingProfile(PactDslWithProvider builder) {
3737
var billingProfileResponseShape =
3838
new PactDslJsonBody()
@@ -57,7 +57,7 @@ public RequestResponsePact existingAzureBillingProfile(PactDslWithProvider build
5757
.toPact();
5858
}
5959

60-
@Pact(consumer = "wsm-consumer", provider = "bpm-provider")
60+
@Pact(consumer = "workspacemanager", provider = "bpm")
6161
public RequestResponsePact existingGCPBillingProfile(PactDslWithProvider builder) {
6262
var billingProfileResponseShape =
6363
new PactDslJsonBody()
@@ -77,7 +77,7 @@ public RequestResponsePact existingGCPBillingProfile(PactDslWithProvider builder
7777
.toPact();
7878
}
7979

80-
@Pact(consumer = "wsm-consumer", provider = "bpm-provider")
80+
@Pact(consumer = "workspacemanager", provider = "bpm")
8181
public RequestResponsePact billingProfileUnAvailable(PactDslWithProvider builder) {
8282
return builder
8383
.uponReceiving("A request to retrieve a billing profile")

service/src/test/java/bio/terra/workspace/pact/TpsApiTest.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void setup(MockServer mockServer) throws Exception {
110110
dispatch = new TpsApiDispatch(featureConfig, tpsConfig);
111111
}
112112

113-
@Pact(consumer = "wsm", provider = "tps")
113+
@Pact(consumer = "workspacemanager", provider = "tps")
114114
public RequestResponsePact createPaoWithNoExistingPolicy(PactDslWithProvider builder) {
115115
return builder
116116
.uponReceiving("A request to create a policy")
@@ -134,7 +134,7 @@ public void testCreatingAPolicyWithNoExistingPolicy() throws Exception {
134134
TpsObjectType.WORKSPACE);
135135
}
136136

137-
@Pact(consumer = "wsm", provider = "tps")
137+
@Pact(consumer = "workspacemanager", provider = "tps")
138138
public RequestResponsePact createPaoWithAPreexistingPolicy(PactDslWithProvider builder) {
139139
return builder
140140
.given(existingPolicyState)
@@ -164,7 +164,7 @@ public void creatingAPolicyThatAlreadyExists() {
164164
TpsObjectType.WORKSPACE));
165165
}
166166

167-
@Pact(consumer = "wsm", provider = "tps")
167+
@Pact(consumer = "workspacemanager", provider = "tps")
168168
public RequestResponsePact deletePaoThatExists(PactDslWithProvider builder) {
169169
return builder
170170
.given(existingPolicyState)
@@ -184,7 +184,7 @@ public void deletingAnExistingPolicy() throws Exception {
184184
dispatch.deletePao(existingPolicyId);
185185
}
186186

187-
@Pact(consumer = "wsm", provider = "tps")
187+
@Pact(consumer = "workspacemanager", provider = "tps")
188188
public RequestResponsePact getPaoWithAnExistingPolicy(PactDslWithProvider builder) {
189189
var policyResponseShape =
190190
new PactDslJsonBody()
@@ -226,7 +226,7 @@ public void retrievingAnExistingPolicy() throws Exception {
226226
assertFalse(policy.getNamespace().isEmpty());
227227
}
228228

229-
@Pact(consumer = "wsm", provider = "tps")
229+
@Pact(consumer = "workspacemanager", provider = "tps")
230230
public RequestResponsePact getPaoThatDoesNotExist(PactDslWithProvider builder) {
231231
return builder
232232
.uponReceiving("A request to retrieve a policy that doesn't exist")
@@ -243,7 +243,7 @@ public void retrievingAPolicyThatDoesNotExist() {
243243
assertThrows(PolicyServiceNotFoundException.class, () -> dispatch.getPao(existingPolicyId));
244244
}
245245

246-
@Pact(consumer = "wsm", provider = "tps")
246+
@Pact(consumer = "workspacemanager", provider = "tps")
247247
public RequestResponsePact linkPaoWhenBothExist(PactDslWithProvider builder) {
248248
var linkRequestShape =
249249
new PactDslJsonBody()
@@ -280,7 +280,7 @@ public void linkTwoExistingPaosWithNoConflicts() throws Exception {
280280
assertNotNull(result);
281281
}
282282

283-
@Pact(consumer = "wsm", provider = "tps")
283+
@Pact(consumer = "workspacemanager", provider = "tps")
284284
public RequestResponsePact mergePaoWhenBothExist(PactDslWithProvider builder) {
285285
var linkRequestShape =
286286
new PactDslJsonBody()
@@ -318,7 +318,7 @@ public void mergingTwoExistingPaos() throws Exception {
318318
assertNotNull(result);
319319
}
320320

321-
@Pact(consumer = "wsm", provider = "tps")
321+
@Pact(consumer = "workspacemanager", provider = "tps")
322322
public RequestResponsePact replacePaoThatExists(PactDslWithProvider builder) {
323323
var updateRequestShape =
324324
new PactDslJsonBody()
@@ -354,7 +354,7 @@ public void replacingAnExistingPaoWithNoConflicts() throws Exception {
354354
assertNotNull(result);
355355
}
356356

357-
@Pact(consumer = "wsm", provider = "tps")
357+
@Pact(consumer = "workspacemanager", provider = "tps")
358358
public RequestResponsePact updatePaoPreexistingNoConflicts(PactDslWithProvider builder) {
359359
var updateRequestShape =
360360
new PactDslJsonBody()
@@ -394,7 +394,7 @@ public void updatingAnExistingPaoWithNoConflicts() throws Exception {
394394
assertNotNull(result);
395395
}
396396

397-
@Pact(consumer = "wsm", provider = "tps")
397+
@Pact(consumer = "workspacemanager", provider = "tps")
398398
public RequestResponsePact listValidRegions(PactDslWithProvider builder) {
399399
return builder
400400
.given(existingPolicyState)
@@ -417,7 +417,7 @@ public void listingValidRegionsOnAWorkspace() throws Exception {
417417
assertNotNull(result);
418418
}
419419

420-
@Pact(consumer = "wsm", provider = "tps")
420+
@Pact(consumer = "workspacemanager", provider = "tps")
421421
public RequestResponsePact listValidByPolicyInput(PactDslWithProvider builder) {
422422
return builder
423423
.given(existingPolicyState)
@@ -448,7 +448,7 @@ public void listingValidRegionsOnAPolicy() throws Exception {
448448
assertNotNull(result);
449449
}
450450

451-
@Pact(consumer = "wsm", provider = "tps")
451+
@Pact(consumer = "workspacemanager", provider = "tps")
452452
public RequestResponsePact explainingAWorkspacePolicy(PactDslWithProvider builder) {
453453
var explainResponse =
454454
new PactDslJsonBody()
@@ -494,7 +494,7 @@ public void explainingAPolicy() throws Exception {
494494
assertNotNull(result.toApi());
495495
}
496496

497-
@Pact(consumer = "wsm", provider = "tps")
497+
@Pact(consumer = "workspacemanager", provider = "tps")
498498
public RequestResponsePact getLocationInfo(PactDslWithProvider builder) {
499499
var locationArray =
500500
new PactDslJsonArray()
@@ -529,7 +529,7 @@ public void retrievingInformationOnALocation() throws Exception {
529529
assertNotNull(result);
530530
}
531531

532-
@Pact(consumer = "wsm", provider = "tps")
532+
@Pact(consumer = "workspacemanager", provider = "tps")
533533
public RequestResponsePact getLocationInfoWithNullLocation(PactDslWithProvider builder) {
534534
var locationArray =
535535
new PactDslJsonArray()

0 commit comments

Comments
 (0)