Skip to content

Add debug logging to rake-ui#54

Open
nicholaspufal wants to merge 2 commits into
masterfrom
np-better-logging
Open

Add debug logging to rake-ui#54
nicholaspufal wants to merge 2 commits into
masterfrom
np-better-logging

Conversation

@nicholaspufal
Copy link
Copy Markdown
Member

@nicholaspufal nicholaspufal commented May 11, 2026

JIRA link: https://doximity.atlassian.net/browse/CSVUEAN-2825

What is this?

  • rake-ui runs rake tasks asynchronously, but today there is very little structured host-app logging around that lifecycle. When a task appears to hang, exits before producing useful output, or never reaches the local task log, maintainers have to infer where execution stopped: request handling, log creation, process handoff, or completion marker writing. That makes failures harder to diagnose than they need to be.

  • This adds debug-level lifecycle breadcrumbs with a small, stable, public-safe shape. Each event identifies the rake-ui component, the lifecycle event, the host Rails app name, the rake task name, and the task log id when one exists. It intentionally does not log command strings, argument values, environment values, authentication data, or application-specific metadata.

  • I also documented the events and fields in the README so host applications can enable Rails debug logging and know what each breadcrumb means.

Diagram

The lifecycle has a few handoff points, so this is useful context for what the breadcrumbs cover:

sequenceDiagram
    participant Host as Host Rails app
    participant RakeUi as rake-ui
    participant Log as Local task log
    participant Child as Forked task process

    Host->>RakeUi: Execute rake task
    RakeUi-->>RakeUi: debug: task_execution.requested
    RakeUi->>Log: Create task log file
    RakeUi-->>RakeUi: debug: task_log.created
    RakeUi->>Child: Fork execution
    RakeUi-->>RakeUi: debug: task_execution.forked
    Child->>Log: Write command output
    Child->>Log: Write finished marker
    Child-->>RakeUi: debug: task_execution.finished_marker_written
Loading

@nicholaspufal nicholaspufal self-assigned this May 11, 2026
@nicholaspufal nicholaspufal marked this pull request as ready for review May 11, 2026 19:36
@nicholaspufal nicholaspufal changed the title Add public-safe debug logging to rake-ui Add debug logging to rake-ui May 11, 2026
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.

2 participants