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

Handle --no-build and --watch args #11664

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

jhrotko
Copy link
Contributor

@jhrotko jhrotko commented Mar 26, 2024

What I did
Fix case when running

docker compose up --watch --no-build

and

docker compose up --no-build --menu (and then hit w - triggering watch)

It was throwing a panic since we were trying to access options.Create.Build which was nil.

Related issue

fixes https://docker.atlassian.net/browse/COMP-501

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

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think this makes the most sense for now given how Compose mutates the <svc>.build entries in the project.

In the future, it'd be nice if we could get to the point where it does not need to nil those out, so that they're still available for future rebuilds (via watch.action: rebuild for example), but that's a substantial change

@jhrotko jhrotko self-assigned this Mar 26, 2024
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

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

Project coverage is 54.61%. Comparing base (4b7b6ad) to head (dd5614e).

Files Patch % Lines
cmd/formatter/shortcut.go 0.00% 5 Missing ⚠️
cmd/compose/up.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11664      +/-   ##
==========================================
+ Coverage   54.57%   54.61%   +0.04%     
==========================================
  Files         145      145              
  Lines       12593    12600       +7     
==========================================
+ Hits         6872     6881       +9     
  Misses       5023     5023              
+ Partials      698      696       -2     

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

@ndeloof
Copy link
Contributor

ndeloof commented Mar 27, 2024

LGTM, while --watch does not require build until some service use the rebuild action, so we could be clever here and detect this as develop config is being parsed. Anyway still better than a panic 😅

@glours glours merged commit 6fe69b2 into docker:main Mar 27, 2024
30 checks passed
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.

4 participants