From 0e82c5562877ef34af9be6a2663547fd3532c1d0 Mon Sep 17 00:00:00 2001 From: LiteObject Date: Thu, 22 May 2025 21:24:45 -0500 Subject: [PATCH 1/2] Remove commented log message in InfoController's Get method for clarity --- src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs b/src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs index 946f089..11da5dc 100644 --- a/src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs +++ b/src/MyWebApi/MyWebApi/Controllers/WeatherForecastController.cs @@ -17,7 +17,6 @@ public InfoController(ILogger logger) public IActionResult Get() { var helloworld = "Hello World"; - // Log a message at the Information level var message = "Hello World from InfoController. This is a sample message."; _logger.LogInformation(message); return Ok(message); From 1be7052dbf3f53e123602091291d0d474a2eec5a Mon Sep 17 00:00:00 2001 From: LiteObject Date: Thu, 22 May 2025 21:51:30 -0500 Subject: [PATCH 2/2] Fix prompt variable reference and improve error handling in Code Review step --- .github/workflows/code-review.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index b99ffe4..1b9d6c2 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -64,7 +64,7 @@ jobs: run: | PAYLOAD=$(jq -n \ --arg model "$MODEL_NAME" \ - --arg prompt "$prompt" \ + --arg prompt "$PROMPT" \ '{ model: $model, prompt: $prompt, @@ -76,10 +76,10 @@ jobs: echo "RAW RESPONSE:\n$RAW_RESPONSE" # Try to extract the response, fallback to a default message if not found - REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response') + REVIEW=$(echo "$RAW_RESPONSE" | jq -r '.response // empty') - if [ -z "$REVIEW" ]; then - echo "Model did not return a valid review. Check RAW_RESPONSE for errors." + if [ -z "$REVIEW" ] || [ "$REVIEW" = "null" ]; then + echo "Error: .response field is missing or empty in the API response." REVIEW="Model did not return a valid review. RAW_RESPONSE: $RAW_RESPONSE" fi @@ -88,7 +88,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const review = process.env.REVIEW; + const review = process.env.REVIEW || 'No review generated due to an error.'; await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo,