Still warn but update gdk.yml if value the same

What does this merge request do and why?

This MR updates the gdk config set <key> <value> logic to update the gdk.yml even if the value is already set. The reason for this change is that for Gitpod, we

How to set up and validate locally

In your <GDK_ROOT> in the main branch:

  1. Run ruby -r yaml -e "puts (YAML.load_file('gdk.yml') || nil)&.dig('webpack', 'host') || 'unset'" and ensure unset is returned. This shows the webpack.host value is currently not stored in your gdk.yml.

  2. Run bin/gdk config set webpack.host 127.0.0.1 and ensure you see:

    ⚠️  WARNING: 'webpack.host' is already set to '127.0.0.1'
  3. Re-run ruby -r yaml -e "puts (YAML.load_file('gdk.yml') || nil)&.dig('webpack', 'host') || 'unset'" and ensure unset is returned. This shows the webpack.host value was not stored in your gdk.yml.

  4. Check out this branch - 1652-support-gdk-config-set-force-2

  5. Run bin/gdk config set webpack.host 127.0.0.1 and ensure you see:

    ✅️ 'webpack.host' is now set to '127.0.0.1' (explicitly setting value '127.0.0.1').
    ℹ️  A backup of 'gdk.yml' has been made at '.backups/gdk.yml.<TIMESTAMP>'.
    ℹ️  Don't forget to run 'gdk reconfigure'.
  6. Re-run ruby -r yaml -e "puts (YAML.load_file('gdk.yml') || nil)&.dig('webpack', 'host') || 'unset'" and ensure 127.0.0.1 is returned.

  7. Re-run bin/gdk config set webpack.host 127.0.0.1 and ensure you see:

    ⚠️  WARNING: 'webpack.host' is already set to '127.0.0.1'
  8. You can also run cat gdk.yml and manually inspect the changes to confirm.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Closes #1652 (closed)

Edited by Ash McKenzie

Merge request reports

Loading