Refactor common methods in gitlab-ctl commands
Currently, the commands defined inside pg-upgrade.rb file (delay_for
, progress_message
etc) are under a namespace that other gitlab-ctl commands share. This means, if delay_for
is called in one gitlab-ctl command, the definition given in pg-upgrade may get executed. With !2733 (merged) we are adding a prometheus-upgrade command, which uses some of the logic implemented in pg-upgrade and this is a problem there.
We should collect these common stuff to a parent class and have component specific libraries that extend and override it. For example, parse_gitlab_options
(parsing command line arguments) can be declared in the parent class, and can be overridden in prometheus-upgrade and pg-upgrade differently as they support different arguments.
@ibaum Any suggestions, as you originally implemented this ?
Triggered by the discussion:
-
@marin started a discussion: (+1 comment) Rename to
delay_for
, same as inpg-upgrade
.