Skip to content

Conversation

@bnbong
Copy link
Owner

@bnbong bnbong commented Jul 11, 2025

Requesting Merging

Description

Fixing #6

Type of Change

  • BUG FIX
  • ADDING NEW FEATURES
  • FEATURE UPDATE
  • HOTFIX
  • DELETING UNNECESSARY FEATURES
  • DOCUMENTATION & DEVOPS
  • Etc..

Test Environment

localhost, MacOS M1

Major Changes

  • fixing not showing error stacktrace
  • add debug logging at inspection (will be implemented more)

Screenshots (optional)

Etc

@bnbong bnbong requested a review from Copilot July 11, 2025 01:07
@bnbong bnbong self-assigned this Jul 11, 2025
@github-actions github-actions bot added the template Add or editing a FastAPI template label Jul 11, 2025
@bnbong bnbong added bug Something isn't working enhancement New feature or request fix Fix or improve source codes and removed template Add or editing a FastAPI template labels Jul 11, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses issue #6 by adding structured debug logging throughout the template inspection process and improving error message formatting for better traceability. It also updates the CI workflow to ensure Docker Compose is available and enables verbose output.

  • Consolidated error and warning handling by introducing error_msg/warning_msg variables and using debug_log calls.
  • Enhanced inspection methods (_check_*, testing, Docker steps) with debug-level and severity-specific logs.
  • Modified the GitHub Actions workflow to grant permissions, install Docker Compose when missing, and pass --verbose to the inspection script.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/fastapi_fastkit/backend/inspector.py Added debug_log calls after appending errors/warnings, refactored report generation logging
.github/workflows/template-inspection.yml Granted extra permissions, added Docker Compose install step, and switched inspection to verbose mode
Comments suppressed due to low confidence (3)

.github/workflows/template-inspection.yml:38

  • [nitpick] Some Docker installations use the docker compose subcommand rather than a separate docker-compose binary. Consider also checking for docker compose to improve compatibility.
          if ! command -v docker-compose &> /dev/null; then

src/fastapi_fastkit/backend/inspector.py:224

  • New debug_log calls have been added but there are no tests ensuring these logs are emitted. Consider adding tests to verify debug logging behavior on both success and failure paths, and validate the --verbose flag in the inspection script.
                debug_log(f"File structure check failed: {error_msg}", "error")

src/fastapi_fastkit/backend/inspector.py:222

  • [nitpick] The pattern of assigning error_msg, appending to self.errors, and calling debug_log is repeated across multiple methods. Consider extracting this into a helper method (e.g., _record_error) to reduce duplication and improve maintainability.
                error_msg = f"Missing required path: {path}"


permissions:
contents: read
issues: write
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow grants write access to issues but does not interact with issues in this job. Remove or narrow the issues: write permission to follow the principle of least privilege.

Suggested change
issues: write

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 68.18182% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/fastapi_fastkit/backend/inspector.py 68.18% 28 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added the template Add or editing a FastAPI template label Jul 11, 2025
@bnbong bnbong merged commit fd66b18 into main Jul 11, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request fix Fix or improve source codes template Add or editing a FastAPI template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants