From 6e928a85337efcee096ed0cbc614b0e74e657db8 Mon Sep 17 00:00:00 2001 From: Riaan Kleinhans Date: Wed, 3 Dec 2025 07:56:25 -0500 Subject: [PATCH] Add debug logging to GHA Signed-off-by: Riaan Kleinhans --- .github/workflows/create-tech-review.yml | 26 ++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-tech-review.yml b/.github/workflows/create-tech-review.yml index 5d4581042..185bd1c49 100644 --- a/.github/workflows/create-tech-review.yml +++ b/.github/workflows/create-tech-review.yml @@ -104,6 +104,9 @@ jobs: const issueNumber = issue.number; const issueBody = issue.body; + console.log(`🔍 Processing issue #${issueNumber}`); + console.log(`📄 Issue body length: ${issueBody ? issueBody.length : 0}`); + // Extract fields const projectName = extractFormField(issueBody, 'name'); const projectLink = extractFormField(issueBody, 'projectLink'); @@ -111,13 +114,23 @@ jobs: const projectContact = extractFormField(issueBody, 'projectContact'); const additionalInfo = extractFormField(issueBody, 'additionalInfo'); + console.log(`📋 Extracted fields: + projectName: ${projectName || 'NOT FOUND'} + projectLink: ${projectLink || 'NOT FOUND'} + ddLink: ${ddLink || 'NOT FOUND'} + projectContact: ${projectContact || 'NOT FOUND'} + additionalInfo: ${additionalInfo ? 'FOUND' : 'NOT FOUND'} + `); + // Validate required fields if (!projectName) { + console.log('❌ Missing project name - commenting and exiting'); await commentOnce(issueNumber, COMMENT_MARKERS.missingProjectName, `❌ Could not extract project name from issue body. Please ensure the issue was created from a template with a "Project name" field.`); return; } if (!projectLink) { + console.log('❌ Missing project link - commenting and exiting'); await commentOnce(issueNumber, COMMENT_MARKERS.missingProjectLink, `❌ Could not extract project link from issue body. Please ensure the issue contains a "Project link" or "GitHub URL" field.`); return; @@ -127,8 +140,10 @@ jobs: const projectNameLower = normalize(projectName); // Check if tech review already created for this issue - if (await hasExistingComment(issueNumber, COMMENT_MARKERS.techReviewCreated)) { - console.log('â„šī¸ Tech review issue already created for this issue.'); + const hasExistingCommentCheck = await hasExistingComment(issueNumber, COMMENT_MARKERS.techReviewCreated); + console.log(`🔍 Checked for existing comment: ${hasExistingCommentCheck}`); + if (hasExistingCommentCheck) { + console.log('â„šī¸ Tech review issue already created for this issue - exiting'); return; } @@ -155,9 +170,12 @@ jobs: }); if (existingIssue) { + console.log(`â„šī¸ Found existing tech review issue #${existingIssue.number} - commenting and exiting`); await commentOnce(issueNumber, COMMENT_MARKERS.techReviewExists, `A tech review issue already exists for this project: [#${existingIssue.number} - ${existingIssue.title}](${existingIssue.html_url})`); return; + } else { + console.log('✅ No existing tech review issue found - proceeding to create'); } } catch (error) { console.log('âš ī¸ Error checking for existing issues:', error.message); @@ -173,6 +191,7 @@ jobs: issueBodyContent += `---\n\n_This issue was automatically created from [issue #${issueNumber}](${originalIssueUrl})_`; // Create tech review issue + console.log(`🚀 Attempting to create tech review issue for: ${normalizedProjectName}`); try { const newIssue = await github.rest.issues.create({ owner: context.repo.owner, @@ -182,9 +201,12 @@ jobs: labels: LABELS_TECH_REVIEW }); + console.log(`✅ Successfully created issue #${newIssue.data.number}`); await commentOnce(issueNumber, COMMENT_MARKERS.techReviewCreated, `✅ Created tech review issue: [#${newIssue.data.number} - ${newIssue.data.title}](${newIssue.data.html_url})`); } catch (error) { + console.error(`❌ Error creating issue: ${error.message}`); + console.error(`❌ Error stack: ${error.stack}`); await commentOnce(issueNumber, COMMENT_MARKERS.createTechReviewFailed, `❌ Failed to create tech review issue: ${error.message}`); throw error;