Skip to content
Draft
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
30 changes: 30 additions & 0 deletions src/ui/tui/screens/health/HealthCheckScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { canContinueBlockingOutage } from './outage-behavior.js';

describe('canContinueBlockingOutage', () => {
it('allows continuing when GitHub Releases is healthy', () => {
expect(
canContinueBlockingOutage({
isGithubReleasesDown: false,
signup: false,
}),
).toBe(true);
});

it('blocks non-signup runs when GitHub Releases is down', () => {
expect(
canContinueBlockingOutage({
isGithubReleasesDown: true,
signup: false,
}),
).toBe(false);
});

it('allows signup runs to continue when GitHub Releases is down', () => {
expect(
canContinueBlockingOutage({
isGithubReleasesDown: true,
signup: true,
}),
).toBe(true);
});
});
11 changes: 9 additions & 2 deletions src/ui/tui/screens/health/HealthCheckScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ServiceHealthStatus } from '../../../../lib/health-checks/types.js';
import { wizardAbort } from '../../../../utils/wizard-abort.js';
import { fetchSkillMenu, downloadSkill } from '../../../../lib/wizard-tools.js';
import { REMOTE_SKILLS_BASE_URL } from '../../../../lib/constants.js';
import { canContinueBlockingOutage } from './outage-behavior.js';

interface HealthCheckScreenProps {
store: WizardStore;
Expand Down Expand Up @@ -92,6 +93,10 @@ export const HealthCheckScreen = ({ store }: HealthCheckScreenProps) => {
if (blockingKeys.length === 0) return null;

const isGithubReleasesDown = blockingKeys.includes('githubReleases');
const canContinue = canContinueBlockingOutage({
isGithubReleasesDown,
signup: store.session.signup,
});
const canDownloadSkills =
result.health.githubReleases.status === ServiceHealthStatus.Healthy;
const integration = store.session.integration;
Expand All @@ -100,7 +105,9 @@ export const HealthCheckScreen = ({ store }: HealthCheckScreenProps) => {

const docsUrl = store.session.frameworkConfig?.metadata.docsUrl;
const description = isGithubReleasesDown
? "The Wizard can't download necessary skills from GitHub Releases right now."
? store.session.signup
? "PostHog account creation can continue, but the Wizard can't download necessary skills from GitHub Releases right now."
: "The Wizard can't download necessary skills from GitHub Releases right now."
: 'The Wizard may not work reliably while services are affected.';

const handleDownloadAndExit = async () => {
Expand Down Expand Up @@ -138,7 +145,7 @@ export const HealthCheckScreen = ({ store }: HealthCheckScreenProps) => {
title={title}
width={72}
footer={
isGithubReleasesDown ? (
!canContinue ? (
<ConfirmationInput
message=""
confirmLabel=""
Expand Down
9 changes: 9 additions & 0 deletions src/ui/tui/screens/health/outage-behavior.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function canContinueBlockingOutage({
isGithubReleasesDown,
signup,
}: {
isGithubReleasesDown: boolean;
signup: boolean;
}): boolean {
return signup || !isGithubReleasesDown;
}
Loading