Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Fixes #19759 - Add options to skip publish and promote #159

Merged
merged 1 commit into from Jun 9, 2017

Conversation

daviddavis
Copy link

No description provided.

@akofink
Copy link
Member

akofink commented Jun 8, 2017

Something makes me think this should be --publish and --promote and skip them by default.

@daviddavis
Copy link
Author

👍 from me. @thomasmckay any objection?

Copy link
Member

@akofink akofink left a comment

Choose a reason for hiding this comment

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

The functionality works for me. Just a few comments.

@@ -9,6 +9,9 @@ class ContentViewsCommand < BaseCommand
command_name 'content-views'
desc 'import or export content-views'

option %w(--no-publish), :flag, _('Skip publishing content views on import')
option %w(--no-promote), :flag, _('Skip promoting content views on import')
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps there should be a small bit of validation here; if --export is given, these options should be disallowed. Additionally, you might consider having a validation for --no-publish requires --no-promote. If you negate the options, you'd require --publish if you have --promote. Of course, you could also change the option description to be option %w(--promote), :flag, _('Publish and promote content views on import'); maybe that's the better solution.

Copy link
Author

@daviddavis daviddavis Jun 8, 2017

Choose a reason for hiding this comment

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

The --export validation sounds like a good idea.

I wasn't thinking that --no-publish requires --no-promote. IOW, if you pass in --no-publish it automatically doesn't promote. You can still pass in --no-promote but you don't have to.

Similarly, I was thinking if you call --promote, it would automatically publish. I was thinking this would be more convenient for users but I suppose maybe explicit is better?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I overlooked your last sentence. I think I will go with updating the descriptions.

Copy link
Member

Choose a reason for hiding this comment

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

The validation is good to do, if possible. I would suggest that the options follow the hammer pattern of --[no-]publish
https://github.com/Katello/hammer-cli-csv/blob/master/lib/hammer_cli_csv/products.rb#L7

@@ -25,7 +25,7 @@ http_interactions:
message: Not Found
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need to commit this file.

@thomasmckay
Copy link
Member

+1 to defaulting to not publishing and promoting

@daviddavis daviddavis force-pushed the 19759 branch 6 times, most recently from dcdc4a8 to 3d84b6a Compare June 9, 2017 17:29
@daviddavis
Copy link
Author

@akofink @thomasmckay think I addressed all the feedback. thanks for the reviews/comments.

@akofink
Copy link
Member

akofink commented Jun 9, 2017

It works as expected. Just one quirk: the publish [..... ] [X%] dialog happens before the Updating content view 'cv1' dialog. It should be:

Updating content view 'cv1'...
[.............................................] [100%]
done

If it's not important or too difficult to fix, that's fine. It's a pretty small gripe. ACK

https://gist.github.com/akofink/773af789833bbce87a4692768220ec79

@daviddavis
Copy link
Author

@akofink should be fixed now.

@daviddavis daviddavis merged commit 60b1511 into Katello:master Jun 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants