(Don’t Fear) the Features · 1996 – Enterprise Web Tech & CMS 2006 – PMP, Stanford...

Preview:

Citation preview

answers@hook42.com

(Don’t Fear) the Features Now with more cowbell. AND DRUPAL 8!!

Aimee Degnan / aimee@hook42.com

answers@hook42.com answers@hook42.com

Me   1996 – Enterprise Web Tech & CMS   2006 – PMP, Stanford Advanced PM   2008 – Drupal   2010 – Agile: Scrum Master, Product Owner   aimee@hook42.com   @aimeeraed

www.hook42.com

  @hook42inc

Aimee Degnan, CEO

answers@hook42.com answers@hook42.com

Hook 42

A boutique software development firm. Cater to both luxury clients and humanitarian efforts. Specialize in complex projects. Contribute to the community. Focus areas: site rescue, migration / upgrades, multilingual, SEO, responsive design, digital strategy, business process improvements

Who are we?

answers@hook42.com answers@hook42.com

Drupal has a nice feature,

you can create a feature using Features.

Remember when…

answers@hook42.com

Are you scared yet?

answers@hook42.com answers@hook42.com

Remember when… Drupal has a nice [development and

deployment] feature - you can create a feature [on your website]

[using the] Features [module].

6

answers@hook42.com answers@hook42.com

What is the Features module? It exports Drupal configurations in the database to

code in the structure of a

module.

answers@hook42.com answers@hook42.com

Intended Usage of Features Bundle a reusable website feature for reuse on other sites.

Site1.com/blog Site2.com/blog Site3.com/blog

For example, a custom blog feature = content type + views + block + permissions Feature: h42_awesome_blog

answers@hook42.com answers@hook42.com

Adapted Usage of D7 Features Bundle database configurations to code for deployment in a multi-stage publication process for a single web site.

example.com Dev à Test à Prod

answers@hook42.com answers@hook42.com

D7 Features has a bad reputation  Too much work  Hard to use  Messy  Painful  Evil  Ugh

answers@hook42.com answers@hook42.com

Poorly made Features hurts everyone

 Missing variables  Circular & multiple dependencies  Missing settings  Non-exportable?!  Un-tested?!?

answers@hook42.com answers@hook42.com

Goal: Fix Configuration Management in D8 core The next-gen cowbell has arrived.

answers@hook42.com answers@hook42.com

Isn’t it cute? Less menacing?

answers@hook42.com answers@hook42.com

But wait…   Is there a D8 version of Features?

  Yes   What does it do?

  Exports configuration as module code.   Do I need it?

  Depends on your use case.   Does Configuration Management replace the use of Features?

  For configuration exports. Yes. Absolutely.   Are there usage considerations with Configuration Management?

  Yes. Absolutely.

answers@hook42.com answers@hook42.com

Improvements Drupal 8 Features   Management Interface (single roll-up page)   Clearer terminology aligned to core

  revert->import   update->export   generate -> write   overridden -> changed

  Namespace management   Can bundle Features together   Bundle prefix management for module export   Automatic packaging / architecting features   Automatic namespace management   Can configure what is “automatic”

answers@hook42.com answers@hook42.com

FEATURES VS. CONFIG MANAGEMENT FOCUS: KNOW WHAT EACH SYSTEM IS REALLY GOOD FOR

answers@hook42.com answers@hook42.com

Features   Nice interface   Easy to see changes   Creates modules   Modules generate an “active config” footprint in the Config Management system

Configuration Management

  Manual, needs dev skill.   All or none model.   Core UI is overwhelming.   See Config partial export module for UI.

Picking & Choosing Changes

answers@hook42.com answers@hook42.com

Features

  Nice interface.   Namespace management.   Module packaged for you.

Configuration Management

  Manual creation of module from YAML exports.   Needs more dev skill.   It can be done.

Sharing

answers@hook42.com answers@hook42.com

Features

  D7 – low to medium.   D8 – much better.   Edge cases and less supported modules iffy.

Configuration Management

  Core config management is great! Contrib is better off the start.   Edge cases and less

supported modules better than D7, but still may have issues.

Confidence in Exports

answers@hook42.com answers@hook42.com

Features   D7 – based on architecture.   D8 – much better.   Zombie fields, deletion management.   Dreaded Features Override.

Configuration Management

  Core config management is great! Contrib is better off the start.   Zombie fields.   “Stuck” imports.

Confidence in Imports

answers@hook42.com answers@hook42.com

Features

  features-export fex/fu   features-import fim/fr   D7 (drush cc)

Configuration Management

cex (config-export) cim (config-import) cget (config-get) cset (config-set) config-merge   D8 (drush cr)

Command line differences

answers@hook42.com answers@hook42.com

Watch out for… The gotchas.

D7Features:Incorrectmodule

exports

D7Features:StatebasedVariablesinStrongarm

D7Features:Circular&Mul>pleDependencies

Timingdependencydeployments

ThingsthathaveanID(role,terms,content)

D7Features:Filesdon’tgetdeleted

FieldCleanup

D7Features:Moduledependencies&patching

Force,ccall==drushcim,drushcr

Conflicts

answers@hook42.com answers@hook42.com

Takeaways 1.  A Feature is an bundled export of custom configurations and

custom YAML code. 2.  A Feature is great for sharing. 3.  Features, you did well in D7. You are better in D8. 4.  Drupal 8 is time for Configuration Management. 5.  I’m going to try work without Features in D8. 6.  D7 Features best practices help parallel development in D8. 7.  I love you, Features. Sort of. ;)

answers@hook42.com answers@hook42.com

Reference Links   Mike Potter: https://www.phase2technology.com/blog/best-practices-for-cmi-and-features-in-drupal-8/   https://chromatichq.com/blog/drupal-7-features-vs-drupal-8-configuration-management   http://nuvole.org/blog/2013/sep/03/configuration-management-and-features-look-drupal-8   https://www.drupal.org/project/config_partial_export   https://pantheon.io/blog/configuration-workflow-drupal-8-sites   https://pantheon.io/docs/drupal-8-configuration-management/

Recommended