Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ trait AbstractAssociateAtlassianHostUserActionRefiner[R[A] <: WrappedRequest[A]]
.findByClientKey(installation.clientKey)
.map(hostSearchResultToActionResult(_, request))
case None =>
logger.error(
s"Failed to associate Connect host to Forge Remote Compute invocation: No host mapping for installation id $installationId found"
logger.info(
s"Could not associate Connect host to Forge Remote Compute invocation: No host mapping for installation id $installationId found. This is probably a pure Forge installation"
)
Future.successful(
hostSearchResultToActionResult(None, request)
)
Future.successful(Left(BadRequest(s"Missing Connect mapping")))
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand Down Expand Up @@ -176,7 +176,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand All @@ -188,7 +188,7 @@ class AssociateAtlassianHostUserActionSpec
val result = await {
refiner.refine(forgeRemoteContextRequest)
}
result mustBe Left(BadRequest(s"Missing Connect mapping"))
result mustBe Left(BadRequest("Missing Connect installation"))
}
}

Expand All @@ -212,7 +212,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand Down Expand Up @@ -267,7 +267,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand Down Expand Up @@ -304,7 +304,7 @@ class AssociateAtlassianHostUserActionSpec
}
}

"fail to refine if no Connect mapping exists" in {
"successfully refine to ForgeRemoteAssociateMaybeAtlassianHostUserRequest if no Connect mapping exists" in {
forAll(
forgeInvocationTokenGen(fakeForgeInvocationContext, keyId, privateKey)
) { invocationToken =>
Expand All @@ -324,7 +324,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand All @@ -336,7 +336,12 @@ class AssociateAtlassianHostUserActionSpec
val result = await {
refiner.refine(forgeRemoteContextRequest)
}
result mustBe Left(BadRequest(s"Missing Connect mapping"))
result mustBe Right(
ForgeRemoteAssociateMaybeAtlassianHostUserRequest(
None,
forgeRemoteContextRequest
)
)
}
}

Expand All @@ -360,7 +365,7 @@ class AssociateAtlassianHostUserActionSpec
ForgeRemoteContext(
fakeForgeInvocationContext,
forgeRemoteCredentials.traceId,
forgeRemoteCredentials.spanId,
forgeRemoteCredentials.spanId
),
forgeRemoteRequest
)
Expand Down