Include compose up diagnostics and attach logs on compose startup failures#93
Merged
Merged
Conversation
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
docker-compose upcreates a container that is not running so users get stdout/stderr and service logs.Description
ComposeUpResultto captureproject_name,service,stdout, andstderrfromup_serviceand changeup_serviceto return it instead of().service_logsto invokecompose logsand new helperscompose_startup_failure_error,append_diagnostic_section, andtruncate_diagnosticto build a diagnostic message that includescompose upoutput andcompose logs, truncating to 16KiB.create_compose_containerandrefresh_compose_container) to use the newup_serviceresult and produce a detailed error when the expected container cannot be resolved after compose up.ensure_compose_container_reports_logs_when_created_service_is_not_runningthat verifies the failure message includes compose stdout/stderr and compose logs.Testing
cargo testfor the modified module and the new testensure_compose_container_reports_logs_when_created_service_is_not_running, and all tests passed.ensure_compose_container_marks_changed_container_id_as_createdwere executed and passed.Codex Task