Skip to content

Conversation

@ironcladlou
Copy link
Contributor

Make the rollback command speak in terms of deployment configs and
versions, instead of deployments which aren't formal API resources.

This keeps the command consistent with other deployment related APIs
and commands.

Rollback now accepts a deployment config and version for the rollback
target; if no version is supplied, the last completed deployment will
be inferred.

Closes #3338

@ironcladlou
Copy link
Contributor Author

@deads2k @Kargakis PTAL.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this better, but it breaks existing scripts. @smarterclayton what's our stance on that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't

On Jul 9, 2015, at 10:58 AM, David Eads [email protected] wrote:

In pkg/cmd/cli/cmd/rollback.go
#3643 (comment):

@@ -57,14 +60,14 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra
}

cmd := &cobra.Command{

  • Use:     "rollback DEPLOYMENT",
    
  • Use:     "rollback [dc/]config-name",
    

I like this better, but it breaks existing scripts. @smarterclayton
https://github.com/smarterclayton what's our stance on that?


Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3643/files#r34264171.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't

@ironcladlou I'm not sure how you can distinguish the different cases (old arg versus new arg). Also, the fact that hack/test-cmd.sh didn't require any changes suggests this needs to be added there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can never change the syntax of this command? What is the proposed syntax that gets us to a place where we can accept a config? rollback --to-config=config --to-version=N (no arg[0]?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Add new flags, deprecate old ones, or allow a wider range of options. But
we must manage cli syntax change exactly like API or config change -
slowly, with explicit deprecation and management.

On Jul 9, 2015, at 12:52 PM, Dan Mace [email protected] wrote:

In pkg/cmd/cli/cmd/rollback.go
#3643 (comment):

@@ -57,14 +60,14 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra
}

cmd := &cobra.Command{

  • Use:     "rollback DEPLOYMENT",
    
  • Use:     "rollback [dc/]config-name",
    

We can never change the syntax of this command? What is the proposed syntax
that gets us to a place where we can accept a config? rollback
--to-config=config --to-version=N (no arg[0]?)


Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3643/files#r34276449.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's what @deads2k and I are proposing now:

rollback <name>

We'll try and use <name> as an RC first, then a DC, and use whatever we find. The possibility of a DC and RC having the same name within a namespace seems extremely low, since RC names are <config-name>-<version>.

Both rc/ and dc/ prefixes would be supported.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable to me

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch 3 times, most recently from 53b1cc4 to 03a9d0e Compare July 9, 2015 15:01
@deads2k
Copy link
Contributor

deads2k commented Jul 9, 2015

Since this is a reasonably significant refactor, are you willing to follow the RollbackOptions, Complete, Validate, RunRollback pattern?

@ironcladlou
Copy link
Contributor Author

Since this is a reasonably significant refactor, are you willing to follow the RollbackOptions, Complete, Validate, RunRollback pattern?

I'm not sure what pattern you're referring to. Details?

Copy link
Contributor

Choose a reason for hiding this comment

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

couldn't you just default to-version to 0 and then say that to-version=0 means auto-detect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right; changed this to always use the argument value (which defaults to 0) and updated the argument's description.

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch from 03a9d0e to 409faaf Compare July 9, 2015 15:09
@0xmichalis
Copy link
Contributor

Since this is a reasonably significant refactor, are you willing to follow the RollbackOptions, Complete, Validate, RunRollback pattern?

+1 to this. Or at least factor out RunRollback.

@0xmichalis
Copy link
Contributor

I'm not sure what pattern you're referring to. Details?

https://github.com/openshift/origin/pull/3470/files?short_path=6191d79#diff-6191d79908dca377719733511c6b39e9 - Check the Command Structure part

@deads2k
Copy link
Contributor

deads2k commented Jul 9, 2015

I'm not sure what pattern you're referring to. Details?

https://github.com/openshift/origin/blob/master/pkg/cmd/cli/secrets/new.go

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch 2 times, most recently from 87d1860 to 3ec1798 Compare July 9, 2015 20:41
@ironcladlou
Copy link
Contributor Author

Re-re-factored... PTAL. test-cmd.sh coverage is still outstanding.

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch from 3ec1798 to 7dfea81 Compare July 9, 2015 21:09
@ironcladlou
Copy link
Contributor Author

Added basic test coverage in test-cmd.sh.

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch from 7dfea81 to 8a37aa1 Compare July 9, 2015 21:20
Copy link
Contributor

Choose a reason for hiding this comment

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

Edit help text to say that this is ignored (invalid?) when specifying an rc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch 2 times, most recently from 07e143e to b80d6f4 Compare July 10, 2015 13:59
@deads2k
Copy link
Contributor

deads2k commented Jul 10, 2015

lgtm. Please open the issues before you merge so we don't lose track of them.

Make the rollback command speak in terms of deployment configs and
versions, instead of deployments which aren't formal API resources.

This keeps the command consistent with other deployment related APIs
and commands.

Rollback now accepts a deployment config and version for the rollback
target; if no version is supplied, the last completed deployment will
be inferred.
@ironcladlou ironcladlou force-pushed the rollback-arg-simplification branch from b80d6f4 to 14c47aa Compare July 10, 2015 14:34
@ironcladlou
Copy link
Contributor Author

Okay, can somebody tag this?

@smarterclayton
Copy link
Contributor

LGTM [merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2704/) (Image: devenv-fedora_1972)

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3595/)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to 14c47aa

openshift-bot pushed a commit that referenced this pull request Jul 10, 2015
@openshift-bot openshift-bot merged commit 70152d7 into openshift:master Jul 10, 2015
@ironcladlou ironcladlou deleted the rollback-arg-simplification branch July 22, 2015 17:56
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.

5 participants