Skip to content

Commit 9efa9b2

Browse files
authored
Merge pull request #57 from diggerhq/feat/surface-error-reason-to-ui
surface the error reason to the ui
2 parents 8b3e7b8 + 441aaff commit 9efa9b2

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/runs/[runId]/ProjectRunDetails.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function RenderContent({
6565
run.status !== ToTitleCase('running_plan') && (
6666
<pre className="bg-muted p-4 rounded-md overflow-auto flex-1 max-h-[600px] text-sm whitespace-pre-wrap">
6767
{tfOutput}
68+
{run.status === ToTitleCase("failed") && run.failure_reason}
6869
</pre>
6970
)}
7071
</div>
@@ -106,6 +107,7 @@ function RenderContent({
106107
{run.status === ToTitleCase('succeeded') && (
107108
<div className="dark font-mono bg-muted p-4 rounded-md overflow-auto flex-1 max-h-[600px] text-sm whitespace-pre-wrap text-white">
108109
{applyTerraformOutput}
110+
{run.status === ToTitleCase("failed") && run.failure_reason}
109111
</div>
110112
)}
111113
</div>

src/app/api/github-callback/route.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { toSiteURL } from '@/utils/helpers';
33
import { NextRequest, NextResponse } from 'next/server';
44

55
// Use the environment variable for the callback URL
6-
const AUTH_SERVICE_URL = process.env.GITHUB_PROXY_CALLBACK_URL;
6+
const GITHUB_CALLBACK_URL = process.env.GITHUB_PROXY_CALLBACK_URL;
77
const DIGGER_WEBHOOK_SECRET = process.env.DIGGER_WEBHOOK_SECRET;
88

9-
if (!AUTH_SERVICE_URL) {
10-
throw new Error('GITHUB_CALLBACK_URL environment variable is not set');
9+
if (!GITHUB_CALLBACK_URL) {
10+
throw new Error('GITHUB_PROXY_CALLBACK_URL environment variable is not set');
1111
}
1212

1313
export async function GET(request: NextRequest) {
@@ -28,7 +28,7 @@ export async function GET(request: NextRequest) {
2828
);
2929
const organizationId = await getOrganizationId();
3030
const response = await fetch(
31-
`${AUTH_SERVICE_URL}?${searchParams.toString()}`,
31+
`${GITHUB_CALLBACK_URL}?${searchParams.toString()}`,
3232
{
3333
method: 'GET',
3434
headers: {

src/lib/database.types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ export type Database = {
452452
created_at: string
453453
deleted_at: string | null
454454
digger_config: string | null
455+
failure_reason: string | null
455456
github_installation_id: number | null
456457
id: string
457458
is_approved: boolean | null
@@ -477,6 +478,7 @@ export type Database = {
477478
created_at?: string
478479
deleted_at?: string | null
479480
digger_config?: string | null
481+
failure_reason?: string | null
480482
github_installation_id?: number | null
481483
id?: string
482484
is_approved?: boolean | null
@@ -502,6 +504,7 @@ export type Database = {
502504
created_at?: string
503505
deleted_at?: string | null
504506
digger_config?: string | null
507+
failure_reason?: string | null
505508
github_installation_id?: number | null
506509
id?: string
507510
is_approved?: boolean | null

0 commit comments

Comments
 (0)