Skip to content

fix: log preflight issues as warnings#352

Merged
ArthurCRodrigues merged 1 commit into
mainfrom
351-bug-preflight---submission-related-problems-are-logged-as-error
Jun 11, 2026
Merged

fix: log preflight issues as warnings#352
ArthurCRodrigues merged 1 commit into
mainfrom
351-bug-preflight---submission-related-problems-are-logged-as-error

Conversation

@matheusmra

Copy link
Copy Markdown
Member

Context

The PreFlight step is responsible for validating submissions before grading checking for required files and running setup commands (e.g., compilation). When these checks fail, it is expected behavior: the step exists precisely to catch invalid submissions.

However, failures in check_required_files and check_setup_commands were being logged at ERROR level, causing observability tools (e.g., alerting, dashboards) to treat them as application failures. Logs at ERROR should be reserved for unexpected failures in application procedures (e.g., failing to save grading results, failing to fetch a template), not for predictable, student-caused outcomes.

Solution

Downgraded two logger.error calls in PreFlightService to logger.warning:

  • check_required_files: a missing required file is a known, expected submission validation failure.
  • check_setup_commands: a failed setup command (e.g., compilation error) is a known, expected submission validation failure.

Calls that represent genuine application-level issues were left as logger.error:

  • Asset injection failure in PreFlightStep (infrastructure failure).
  • Missing sandbox when setup commands are configured (pipeline misconfiguration).
  • check_setup_commands called with no sandbox directly via the service (defensive guard, indicates incorrect usage).

Further clarifications

No behavior changes — only log severity is affected. Observability tools will no longer fire false-positive alerts for routine submission validation failures caught by PreFlight.

Related issues

Closes #351

Checklist

  • I linked the related issue(s) and explained the motivation.
  • I kept this PR focused and scoped to a single concern.
  • I added or updated tests for changed behavior (or explained why not needed).
    • No tests needed: log level is an observability concern, not a behavioral one. Existing tests remain valid.
  • I ran the relevant tests locally.
  • I updated documentation when needed (README/docs/API examples). — N/A
  • This PR introduces API contract changes (request/response/endpoint/DTO). — No
  • If API changed, I documented compatibility or migration notes. — N/A
  • This PR includes breaking changes. — No
  • If breaking, I clearly described impact and migration steps. — N/A

Copilot AI review requested due to automatic review settings June 11, 2026 15:40
@matheusmra matheusmra linked an issue Jun 11, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adjusts observability for the PreFlight validation path by treating predictable, student-caused validation failures as warnings rather than application errors. This aligns log severity with the pipeline’s intended behavior (PreFlight is expected to reject invalid submissions) and reduces false-positive alerts.

Changes:

  • Downgraded logging for missing required submission files from ERRORWARNING.
  • Downgraded logging for failed setup commands (e.g., compile errors) from ERRORWARNING.

@matheusmra

Copy link
Copy Markdown
Member Author

@ArthurCRodrigues

@ArthurCRodrigues ArthurCRodrigues merged commit 7256277 into main Jun 11, 2026
3 checks passed
@ArthurCRodrigues ArthurCRodrigues deleted the 351-bug-preflight---submission-related-problems-are-logged-as-error branch June 11, 2026 15:46
Change logging level from error to warning for missing required files and failed setup commands in the preflight service. The conditions still append fatal PreflightError entries, but reduce log severity to avoid noisy error-level logs during these checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] (PreFlight) - Submission Related Problems are Logged as Error

3 participants