Skip to content

Commit

Permalink
Merge pull request #57 from diggerhq/feat/surface-error-reason-to-ui
Browse files Browse the repository at this point in the history
surface the error reason to the ui
  • Loading branch information
motatoes authored Sep 18, 2024
2 parents 8b3e7b8 + 441aaff commit 9efa9b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function RenderContent({
run.status !== ToTitleCase('running_plan') && (
<pre className="bg-muted p-4 rounded-md overflow-auto flex-1 max-h-[600px] text-sm whitespace-pre-wrap">
{tfOutput}
{run.status === ToTitleCase("failed") && run.failure_reason}
</pre>
)}
</div>
Expand Down Expand Up @@ -106,6 +107,7 @@ function RenderContent({
{run.status === ToTitleCase('succeeded') && (
<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">
{applyTerraformOutput}
{run.status === ToTitleCase("failed") && run.failure_reason}
</div>
)}
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/app/api/github-callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { toSiteURL } from '@/utils/helpers';
import { NextRequest, NextResponse } from 'next/server';

// Use the environment variable for the callback URL
const AUTH_SERVICE_URL = process.env.GITHUB_PROXY_CALLBACK_URL;
const GITHUB_CALLBACK_URL = process.env.GITHUB_PROXY_CALLBACK_URL;
const DIGGER_WEBHOOK_SECRET = process.env.DIGGER_WEBHOOK_SECRET;

if (!AUTH_SERVICE_URL) {
throw new Error('GITHUB_CALLBACK_URL environment variable is not set');
if (!GITHUB_CALLBACK_URL) {
throw new Error('GITHUB_PROXY_CALLBACK_URL environment variable is not set');
}

export async function GET(request: NextRequest) {
Expand All @@ -28,7 +28,7 @@ export async function GET(request: NextRequest) {
);
const organizationId = await getOrganizationId();
const response = await fetch(
`${AUTH_SERVICE_URL}?${searchParams.toString()}`,
`${GITHUB_CALLBACK_URL}?${searchParams.toString()}`,
{
method: 'GET',
headers: {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ export type Database = {
created_at: string
deleted_at: string | null
digger_config: string | null
failure_reason: string | null
github_installation_id: number | null
id: string
is_approved: boolean | null
Expand All @@ -477,6 +478,7 @@ export type Database = {
created_at?: string
deleted_at?: string | null
digger_config?: string | null
failure_reason?: string | null
github_installation_id?: number | null
id?: string
is_approved?: boolean | null
Expand All @@ -502,6 +504,7 @@ export type Database = {
created_at?: string
deleted_at?: string | null
digger_config?: string | null
failure_reason?: string | null
github_installation_id?: number | null
id?: string
is_approved?: boolean | null
Expand Down

0 comments on commit 9efa9b2

Please sign in to comment.