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

progress: Show task error in place of progress bar #259

Merged
merged 3 commits into from Jul 9, 2017

Conversation

Projects
None yet
5 participants
@aaronlehmann
Collaborator

aaronlehmann commented Jun 27, 2017

If a task encounters an error, the interactive "service create" and "service update" commands should show that error instead of showing a stuck progress bar.

To validate:

docker service create --detach=false --name broken --restart-condition=none --replicas 3 busybox asdf

and

docker service create --detach=false --name broken --mode global --restart-condition=none busybox asdf

Related to moby/moby#33807
Also related: docker/swarmkit#2287

cc @thaJeztah

progress: Show task error in place of progress bar
If a task encounters an error, the interactive "service create" and
"service update" commands should show that error instead of showing a
stuck progress bar.

To validate:

docker service create --detach=false --name broken --restart-condition=none --replicas 3 busybox asdf
and
docker service create --detach=false --name broken --mode global --restart-condition none busybox asdf

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@dnephin

How can we test these changes?

Full integration tests of the progress bars is going to be difficult, but we should be able to unit test a bunch of the internal logic.

@aaronlehmann

This comment has been minimized.

Show comment
Hide comment
@aaronlehmann

aaronlehmann Jun 28, 2017

Collaborator

Full integration tests of the progress bars is going to be difficult, but we should be able to unit test a bunch of the internal logic.

I am going to work on some tests for the internal logic. Any preferences on adding them to this PR or a separate one?

Collaborator

aaronlehmann commented Jun 28, 2017

Full integration tests of the progress bars is going to be difficult, but we should be able to unit test a bunch of the internal logic.

I am going to work on some tests for the internal logic. Any preferences on adding them to this PR or a separate one?

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Jun 28, 2017

Collaborator

My preference would be this PR

Collaborator

dnephin commented Jun 28, 2017

My preference would be this PR

@aaronlehmann

This comment has been minimized.

Show comment
Hide comment
@aaronlehmann

aaronlehmann Jun 29, 2017

Collaborator

Added unit tests and did some light refactoring.

Collaborator

aaronlehmann commented Jun 29, 2017

Added unit tests and did some light refactoring.

progress: Add unit tests
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Jun 29, 2017

Codecov Report

Merging #259 into master will decrease coverage by 1.78%.
The diff coverage is 77.77%.

@@            Coverage Diff            @@
##           master    #259      +/-   ##
=========================================
- Coverage   48.68%   46.9%   -1.79%     
=========================================
  Files         185     173      -12     
  Lines       12168   11942     -226     
=========================================
- Hits         5924    5601     -323     
- Misses       5877    6019     +142     
+ Partials      367     322      -45

codecov-io commented Jun 29, 2017

Codecov Report

Merging #259 into master will decrease coverage by 1.78%.
The diff coverage is 77.77%.

@@            Coverage Diff            @@
##           master    #259      +/-   ##
=========================================
- Coverage   48.68%   46.9%   -1.79%     
=========================================
  Files         185     173      -12     
  Lines       12168   11942     -226     
=========================================
- Hits         5924    5601     -323     
- Misses       5877    6019     +142     
+ Partials      367     322      -45
@dnephin

LGTM

Thanks for the refactor and unit tests, looks great. One nit, but it's not a blocker

Show outdated Hide outdated cli/command/service/progress/progress.go
progress: Light refactor
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@dnephin

dnephin approved these changes Jul 6, 2017

@thaJeztah

LGTM 👍

@thaJeztah thaJeztah merged commit 7ae9bc1 into docker:master Jul 9, 2017

7 checks passed

ci/circleci: cross Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
codecov/patch 77.77% of diff hit (target 50%)
Details
codecov/project Absolute coverage decreased by -1.78% but relative coverage increased by +29.09% compared to 1aa82bc
Details
dco-signed All commits are signed

@GordonTheTurtle GordonTheTurtle added this to the 17.07.0 milestone Jul 9, 2017

@aaronlehmann aaronlehmann deleted the aaronlehmann:service-progress-surface-error branch Jul 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment