Skip to content

Commit

Permalink
Merge branch 'bob/7019-prod-e2e-health-check' into bob/smoke-test-test
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Dec 15, 2023
2 parents 2236029 + b678b5b commit 0af5696
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@
@Slf4j
@RequiredArgsConstructor
public class BackendAndDatabaseHealthIndicator implements HealthIndicator {
private final FeatureFlagRepository _ffRepo;
private final OktaRepository _oktaRepo;
private final FeatureFlagRepository _ffRepo;
private final OktaRepository _oktaRepo;

@Override
public Health health() {
try {
_ffRepo.findAll();
String oktaStatus = _oktaRepo.getApplicationStatusForHealthCheck();
@Override
public Health health() {
try {
_ffRepo.findAll();
String oktaStatus = _oktaRepo.getApplicationStatusForHealthCheck();

if (oktaStatus.equals("ACTIVE")) {
log.info("Okta status didn't return active, instead returned %s", oktaStatus);
return Health.down().build();
}
if (oktaStatus.equals("ACTIVE")) {
log.info("Okta status didn't return active, instead returned %s", oktaStatus);
return Health.down().build();
}

return Health.up().build();
} catch (JDBCConnectionException e) {
return Health.down().build();
// Okta API call errored
} catch (ApiException e) {
log.info(e.getMessage());
return Health.down().build();
}
return Health.up().build();
} catch (JDBCConnectionException e) {
return Health.down().build();
// Okta API call errored
} catch (ApiException e) {
log.info(e.getMessage());
return Health.down().build();
}
}
}
1 change: 0 additions & 1 deletion backend/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ okta:
client:
org-url: https://hhs-prime.okta.com
token: ${OKTA_API_KEY:MISSING}
group:
smarty-streets:
id: ${SMARTY_AUTH_ID}
token: ${SMARTY_AUTH_TOKEN}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/DeploySmokeTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const DeploySmokeTest = (): JSX.Element => {
.then((response) => {
const status = JSON.parse(response);
if (status.status === "UP") return setSuccess(true);
// log something using app insights
setSuccess(false);
})
.catch((e) => {
Expand Down

0 comments on commit 0af5696

Please sign in to comment.