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

Refactor CLI to use the original deployment status #1247

Merged
merged 2 commits into from Dec 14, 2020
Merged

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented Dec 14, 2020

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.68%. This pull request increases coverage by 0.37%.

File Function Base Head Diff
pkg/model/deployment.go DeploymentStatusesFromStrings -- 0.00% +0.00%
pkg/model/deployment.go DeploymentStatusStrings -- 0.00% +0.00%
pkg/yamlprocessor/yamlprocessor.go GetValue -- 100.00% +100.00%
pkg/yamlprocessor/yamlprocessor.go ReplaceValue -- 90.00% +90.00%
pkg/app/piped/logpersister/stagelogpersister.go stageLogPersister.flushFromLastCheckpoint 50.00% 61.11% +11.11%
pkg/app/pipectl/cmd/application/add.go newAddCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/add.go add.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/application.go NewCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go newSyncCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go sync.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go makeStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/application/sync.go availableStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/deployment/deployment.go NewCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go newWaitStatusCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go waitStatus.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go makeStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go availableStatuses 100.00% -- -100.00%

@@ -59,7 +59,7 @@ func newSyncCommand(root *command) *cobra.Command {
}

func (c *sync) run(ctx context.Context, t cli.Telemetry) error {
statuses, err := makeStatuses(c.status)
statuses, err := model.DeploymentStatusesFromStrings(c.status)
Copy link
Member

Choose a reason for hiding this comment

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

nit: not in the scope of this PR but should we rename this s.status to s.statuses since it's type []string 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch! Let me fix them in this too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed them!

@@ -60,7 +60,7 @@ func newWaitStatusCommand(root *command) *cobra.Command {
}

func (c *waitStatus) run(ctx context.Context, t cli.Telemetry) error {
statuses, err := makeStatuses(c.status)
statuses, err := model.DeploymentStatusesFromStrings(c.status)
Copy link
Member

Choose a reason for hiding this comment

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

same as the above comment 👀

@khanhtc1202
Copy link
Member

Thanks 👍
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.68%. This pull request increases coverage by 0.37%.

File Function Base Head Diff
pkg/model/deployment.go DeploymentStatusesFromStrings -- 0.00% +0.00%
pkg/model/deployment.go DeploymentStatusStrings -- 0.00% +0.00%
pkg/yamlprocessor/yamlprocessor.go GetValue -- 100.00% +100.00%
pkg/yamlprocessor/yamlprocessor.go ReplaceValue -- 90.00% +90.00%
pkg/app/piped/logpersister/stagelogpersister.go stageLogPersister.flushFromLastCheckpoint 50.00% 61.11% +11.11%
pkg/app/pipectl/cmd/application/add.go newAddCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/add.go add.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/application.go NewCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go newSyncCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go sync.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/application/sync.go makeStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/application/sync.go availableStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/deployment/deployment.go NewCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go newWaitStatusCommand 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go waitStatus.run 0.00% -- +-0.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go makeStatuses 100.00% -- -100.00%
pkg/app/pipectl/cmd/deployment/waitstatus.go availableStatuses 100.00% -- -100.00%

@pipecd-bot pipecd-bot merged commit 98b5ae8 into master Dec 14, 2020
@pipecd-bot pipecd-bot deleted the pipectl branch December 14, 2020 09:43
@pipecd-bot pipecd-bot mentioned this pull request Dec 16, 2020
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

3 participants