drupal-vm icon indicating copy to clipboard operation
drupal-vm copied to clipboard

Add debug mode and hide deprecation warnings by default

Open oxyc opened this issue 8 years ago • 10 comments
trafficstars

Issue #1553. I'm assuming you're not going to bump the version requirements of all your roles to 2.4.0. If you are we could drop the conditional ansible.cfg config.

  • ansible.cfg was never loaded with Vagrant. It would need to reside next to the Vagrantfile to do so.
  • control_path no longer needs to be set in ansible.cfg (read https://github.com/geerlingguy/drupal-vm/commit/633810ae76f19cedc3e204d56cd8d1c866c13926)
  • Hide Vagrant 2.0+ messages about ansible auto compatibility mode. @geerlingguy could you test this on vagrant < 2.0 to make sure it works? (read docs)
  • Add support for DRUPALVM_DEBUG environment variable to easily debug ansible tasks (see examples in https://github.com/geerlingguy/drupal-vm/commit/93abae9d3f05b1147a9071e256820887e10fe338)
  • Hide deprecation warnings by default, unless DRUPALVM_DEBUG is truthy. I don't think users need to care about such things. This puts a bit more pressure on developers to stay up-to-date with ansible releases though but that shouldn't be a problem for @geerlingguy :) He has 1 or 2 other roles he maintains and learns about these things from. If you prefer I can drop this commit though.

oxyc avatar Sep 23 '17 17:09 oxyc

I especially like the ability to tell users in the issue queue to run DRUPALVM_DEBUG=v vagrant up

oxyc avatar Sep 23 '17 18:09 oxyc

My main question is what does the debug .cfg file provide over the normal one? It seems like it would just be the first few messages at the top of the Ansible playbook output—but is there any more? Maybe it's just my late-night read of the code...

geerlingguy avatar Sep 26 '17 03:09 geerlingguy

I do like the idea of hiding the deprecation warnings. Since 2.2, it seems like Ansible will be popping deprecation warnings for some commonly-used features that don't have a backwards-compatible fix, so either we live with the warnings, I break compatibility with Ansible < latest, or we do this.

Since Drupal VM is an end-user-oriented system, it shouldn't be showing these more playbook-developer-centric messages since the end user can't really do anything about it.

geerlingguy avatar Sep 26 '17 03:09 geerlingguy

My main question is what does the debug .cfg file provide over the normal one? It seems like it would just be the first few messages at the top of the Ansible playbook output—but is there any more?

No that's it but I wasn't aware of disabling depreciation notices any other way than with a config file. Is it possible somehow?

oxyc avatar Sep 26 '17 03:09 oxyc

Also as I'm fixing the bug where the ansible.cfg isn't taken into account at all currently, I thought it was better to introduce a new ansible.debug.cfg vs ansible.cfg setup so it's more clear. Let me know if you come up with something better.

oxyc avatar Sep 26 '17 13:09 oxyc

I'll take a second look soon since I finally had some time to finish up the 4.7.0 release.

geerlingguy avatar Oct 07 '17 05:10 geerlingguy

@oxyc - This looks great! One last suggestion—can we add something in the docs about setting DRUPALVM_DEBUG=v to enable debug mode?

geerlingguy avatar Apr 24 '18 19:04 geerlingguy

I'm closing PRs which have conflicts or are failing builds and are older than 6 months old, to tidy up the Drupal VM PR queue; please create a new PR against the latest master branch if you feel this is still an important fix or feature for Drupal VM. Thank you!

geerlingguy avatar Dec 28 '18 23:12 geerlingguy

(Note that I'm still for these changes, with the small addition of something about debugging with DRUPALVM_DEBUG=v.)

geerlingguy avatar Dec 28 '18 23:12 geerlingguy

I'll reopen this and work on the docs (soon!)

oxyc avatar Dec 29 '18 01:12 oxyc