chef / chef_backup

A library to backup an Chef server
Other
7 stars 15 forks source link

Replace highline with pastel and tty-prompt #40

Closed btm closed 2 years ago

btm commented 2 years ago

replaces highline.color with pastel.decorate and highline.ask with tty-prompt.ask

We had started removing the use of highline from chef/chef: https://github.com/chef/chef/issues/9359

I can't remember exactly right now why, but I think it was that highline had lots of different functionality in a single gem while the tty-* gems let us choose à la carte. Currently chef/chef is using highline 2.0.3, and we're pinned to < 2.0 with the pessimistic version constraint. We should be able to just relax that constraint, but moving to the more lightweight options should be better overall, at least in the long run.

btm commented 2 years ago

testing with infra-server:

testing with chef-backend:

I'm failing to get the right combination of a bundle here that works.


Manual testing using a pre-release gem:

image

btm commented 2 years ago

Infra Server adhoc with the pre-release gem passed: https://buildkite.com/chef/chef-chef-server-main-omnibus-adhoc/builds/3591

verified the right gem was in the build:

ubuntu@ip-10-0-10-233:/tmp$ find /tmp/opt -name '*chef_backup-*'
/tmp/opt/opscode/embedded/lib/ruby/gems/2.7.0/gems/chef_backup-0.2.0.pre1
/tmp/opt/opscode/embedded/lib/ruby/gems/2.7.0/specifications/chef_backup-0.2.0.pre1.gemspec
btm commented 2 years ago

Colors look good on chef-server-ctl backup from the adhoc build (this node is in the chef-backend test cluster so it can't actually back up):

image

btm commented 2 years ago

The list of tasks with the checkmarks (that are animated) are actually from chef-backend/libcb and are still highline, but the above "WARNING: Cannot backup external postgresql" is colored by chef_backup, which is now pastel driven with this change.