Skip to content

Conversation

@alronova
Copy link
Member

@alronova alronova commented Feb 9, 2026

Implement real-time build logging and status updates

This PR implements a full feedback loop for deployment builds. Users can now see real-time status updates ("Building", "Success", "Failed") and view detailed error logs directly in the UI if a build fails.

Implementation Details

This PR transitions the deployment process from a "fire-and-forget" model to a reactive feedback loop, ensuring users are kept informed of their build status in real-time.

  1. Optimistic Initiation (Frontend)

    • Upon submission, the create function immediately marks the new project status as building in the initial payload.
    • The Home component initiates a polling mechanism that checks the database every 5 seconds for status updates.
  2. Dynamic Environment Injection (Backend)

    • The scripts.ts controller now injects the backend's running port (PORT_BACKEND) into the shell execution environment, enabling the isolated build scripts to communicate back to the main server.
  3. Self-Reporting Workers (Shell Scripts)

    • The build script (container.sh) is no longer silent. It now traps execution errors and utilizes curl to "phone home" to the new /maplogs endpoint, reporting either a success or failed status along with the specific error logs.
  4. Callback Handling (Backend)

    • A new controller, updateBuildStatus, listens for these callbacks. It logs critical failures to Sentry and updates the database record via updateMapStatus.
  5. User Alerting (Frontend)

    • The polling mechanism detects the status change (to failed or success) and updates the UI automatically.
    • If a failure occurs, a new LogModal component is triggered, parsing and displaying the raw build logs for immediate debugging.

Key Changes

Backend

  • src/backend/db.ts: Added updateMapStatus to update the build status and save failure logs in the database.
  • src/backend/main.ts: Created updateBuildStatus controller to handle callbacks from shell scripts and log errors to Sentry.
  • src/backend/server.ts: Registered the new /maplogs endpoint.
  • src/backend/scripts.ts: Updated script execution to pass the PORT_BACKEND environment variable to the shell scripts, ensuring dynamic port handling.

Shell Scripts

  • src/backend/shell_scripts/container.sh: Implemented report_error and report_success functions. The script now traps errors and sends a curl POST request to the backend with the build status and logs.

Frontend

  • src/frontend/src/utils/create.ts: Updated the initial payload to set the status to "building" immediately upon submission.
  • src/frontend/src/components/Home.vue:
    • Implemented polling logic to auto-refresh the project list while builds are active.
    • Added a status column to the dashboard table.
    • Integrated LogModal to display error logs when clicking "Failed".
  • src/frontend/src/components/LogModal.vue: Created a new component to display and copy build failure logs.

@alronova alronova force-pushed the feat/show-build-logs branch from 3851f3d to d28e634 Compare February 10, 2026 00:06
Signed-off-by: alronova <aditya.divyam001@gmail.com>
@alronova alronova force-pushed the feat/show-build-logs branch from d28e634 to fe4f103 Compare February 10, 2026 15:55
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.

1 participant