Skip to content

Deprecation support for single file based and yaml configurations

Gabriel Mazetto requested to merge 769-config-deprecation-support into master

What does this Merge Request do?

This implements new DSL methods that can be used to deprecate port files or regular gdk.yml based attributes.

Example usage:

class Config < ConfigSettings

  # deprecating a port file
  port { read!('some_port_file', deprecation_message: 'Set port in gdk.yml') }

  # deprecating a renamed variable
  group do
    old { nil }
    new { deprecated_config!('group', 'old', deprecation_message: "Use 'group.new' instead") || 'some default value' }
  end
end

$gdk_root usage was also refactored. Instead of spreading around globals we now switch to call GDK.root eveywhere it needs it. This makes mocking for tests much easier.

This refactor also fixed an issue with GDK where it couldn't read the port files if invoked from a subfolder. We now use GDK.root as base for any file invocation, so this is consistent no matter from where you invoked gdk command.

Merge Request checklist

  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.

Closes #769

Edited by Ash McKenzie

Merge request reports