Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not start menu manager if there is no tty on up #11672

Merged
merged 1 commit into from Mar 28, 2024

Conversation

jhrotko
Copy link
Contributor

@jhrotko jhrotko commented Mar 28, 2024

What I did
Handle when there is no tty available and navigation menu is enabled. Also gracefully handle key events when an error occurs instead of panic.
Also did small refactor in cmd/up.go related with NavigationMenu validation.

This can be tested locally by running:

(/opt/homebrew/opt/util-linux/bin/setsid ~/workspace/compose/bin/build/docker-compose up --menu=true) </dev/null |& cat

make sure you have util-linux install

brew install util-linux

Related issue

fixes https://docker.atlassian.net/browse/DDB-25

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@jhrotko jhrotko self-assigned this Mar 28, 2024
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 38.70968% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 54.50%. Comparing base (6fe69b2) to head (3436537).
Report is 1 commits behind head on main.

❗ Current head 3436537 differs from pull request most recent head 29b95f5. Consider uploading reports for the commit 29b95f5 to get more accurate results

Files Patch % Lines
pkg/compose/up.go 25.00% 15 Missing ⚠️
cmd/compose/up.go 70.00% 2 Missing and 1 partial ⚠️
cmd/formatter/shortcut.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11672      +/-   ##
==========================================
- Coverage   54.65%   54.50%   -0.15%     
==========================================
  Files         145      145              
  Lines       12600    12610      +10     
==========================================
- Hits         6886     6873      -13     
- Misses       5018     5044      +26     
+ Partials      696      693       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jhrotko jhrotko force-pushed the fix-no-tty-menu branch 2 times, most recently from 6619c26 to 294e83e Compare March 28, 2024 16:57
@jhrotko jhrotko marked this pull request as ready for review March 28, 2024 17:01
cmd/compose/up.go Outdated Show resolved Hide resolved
@jhrotko jhrotko force-pushed the fix-no-tty-menu branch 3 times, most recently from de3b30f to 1734ce3 Compare March 28, 2024 17:31
@jhrotko jhrotko changed the title Does not start keyboard manager if there is no tty Does not start menu manager if there is no tty in up Mar 28, 2024
@jhrotko jhrotko changed the title Does not start menu manager if there is no tty in up Does not start menu manager if there is no tty on up Mar 28, 2024
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
@jhrotko jhrotko merged commit ff20b64 into docker:main Mar 28, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants