espressif / esp-idf-monitor

Apache License 2.0
21 stars 8 forks source link

Support non-interactive mode (IDFGH-13828) #18

Open alanmosely opened 4 days ago

alanmosely commented 4 days ago

Checklist

Feature description

I am adding esp-idf integration to Dagger (see https://daggerverse.dev/mod/github.com/alanmosely/daggerverse/esp-idf) and one of the things I'd like to support is running idf.py monitor within the official Espressif IDF Docker image.

This is not currently possible using Dagger as it does not pass in stdin (see with_exec docs) so I get the error: Monitor requires standard input to be attached to TTY

In #14233, which covers a related issue, @dobairoland suggests creating a non-interactive mode for IDF monitor where if no stdin is attached, all interactive features are disabled with a warning - this is what this task is requesting

Use cases

Running monitor as part of an automated pipeline, in my case, a Dagger build

Alternatives

Modify Dagger SDK to be able to attach stdin - this would be a Dagger-specific workaround

Additional context

No response

dobairoland commented 3 days ago

We will consider this feature request but with lower priority.

I just want to point out that ESP-IDF, idf.py monitor and the underlying esp-idf-monitor are all designed for interactive console-based terminals. So requests about using it in various IDEs go against its core ideas. IMO IDEs could implement much nicer monitors because they can exploit the full benefit and tools of graphical user interfaces. I'm a little worried that addressing this will be just the first step on a road full of requests to handle IDEs - which is not the goal of esp-idf-monitor.

This is not a rejection of the idea, just an explanation why we don't jump into the implementation immediately.

igrr commented 3 days ago

Just to add, for testing ESP-IDF-based applications in CI, we generally recommend pytest-embedded. It allows checking the application output as well as sending commands to the application.

(If there is a specific reason why you'd like to run specifically idf.py monitor in a CI pipeline, rather than something like pytest-embedded, we'd love to hear it!)

alanmosely commented 3 days ago

Thanks for the feedback, makes sense.

Dagger supports more than just running as part of an automated CI pipeline, it enables local development, ie running and debugging pipelines locally - in this situation, being able to run monitor would be quite helpful.

With my module, on a clean machine with just Git, Docker/Podman and Dagger installed, you can trivially and repeatably run any idf.py command (except for monitor) against any esp-idf or esp-adf version.