Grayside.Org - features http://grayside.org/category/terms/features en Features Module, Then, Now, and in the Future http://grayside.org/2012/03/features-module-then-now-and-future <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Between the <a href="http://drupal.org/project/issues/features">issues queue</a>, Twitter, podcasts, and ad hoc discussions, there is a lot of confusion about what the Features module is all about. As someone that has used and developed in it for a long time, I thought I&#8217;d lend my perspective. My sense is the maintainers are on the same page, but don&#8217;t hold them to this post.</p> <h2>Then</h2> <p>Features is a module to help site builders and command-line gurus easily package up the configuration associated with a specific use case (like a blog), and manage it in code.</p> <p>Unfortunately, there is no standard for doing this, so Features develops a mechanism for wrangling exports. This is sad, because it confuses the use case of the Features module itself.</p> <h2>Now</h2> <p>Unless you are active in the Distributions movement or style of site-building, the sense I get is that this is a common thought process for those that run across Features:</p> <blockquote><p> I need to toss my configuration into code so I can ship my website around. This Features module things has traction. Darn, the <span class="caps">UI</span> sucks, I have to click all these little boxes. And all these info hooks, info alter hooks, and caching layers complicate my day. </p></blockquote> <p>Meanwhile, in #drupal-features, a paraphrase:</p> <blockquote><p> We totally need to get the exporting out of Features. It adds complexity and attracts all these irrelevant use cases to the issue queue. </p></blockquote> <h2>Future</h2> <p>The <a href="http://groups.drupal.org/build-systems-change-management/cmi">Configuration Management Initiative</a> is exciting. From the perspective of a Features user and developer, it finally defines the standard and mechanism for configuration. That means Features finally has a target for how to pull the out-of-scope pieces out.</p> <p>After several conversations at DrupalCon, I&#8217;m expecting we&#8217;ll be seeing a 2.x architectural branch for Features that drops the export stuff. That doesn&#8217;t mean it will become an inconsequential module&#8211;it turns out capturing use cases in configuration is surprisingly complex. People do not agree on what bits and pieces naturally fall together. But that&#8217;s okay, because we are reviving the <a href="http://drupal.org/project/kit">Kit</a> specification. Expect more from me on that in the future, I think standards like that are key to keeping Drupal intuitive as the Distributions-driven approach to Drupal continues to&nbsp;accelerate.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/features">features</a></div><div class="field-item odd"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item even"><a href="/category/1/cmi">cmi</a></div></div></div> Wed, 28 Mar 2012 21:03:03 +0000 Grayside 96 at http://grayside.org http://grayside.org/2012/03/features-module-then-now-and-future#comments Integrating Some Other Feature with Spaces http://grayside.org/2010/07/integrating-some-other-feature-spaces <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>I have found more than once a situation in which I had a basic feature that could be used on any site which I would like to see integrated with Spaces (for OpenAtrium magic). It usually runs like this:</p> <ol> <li>I have the FeatureServer feature.</li> <li>I want it in OpenAtrium.</li> <li>Here&#8217;s a new Feature that provides some Contexts and some Groups variables.</li> <li>Here&#8217;s a patch that you must apply to FeatureServer to make Spaces aware of it. (And other stuff).</li> </ol> <p>&#35;4 is a pain, but I&#8217;ve recently discovered how to shrink it down a little more: hook_system_info_alter().</p> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009933; font-style: italic;">/** &nbsp;* Implementation of hook_system_info_alter(). &nbsp;*/</span> <span style="color: #000000; font-weight: bold;">function</span> my_atrium_savvy_feature_system_info_alter<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$info</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'some_other_feature'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'spaces'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'types'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'og'</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span></pre></div> </div> <p>This hook is called from <em>features_get_info()</em> in features.module. The hook allows you to changes all the info files settings of a feature. Note: Row is apparently a huge variable to dump to the&nbsp;screen.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/spaces">spaces</a></div><div class="field-item even"><a href="/category/terms/features">features</a></div></div></div> Fri, 23 Jul 2010 16:10:17 +0000 Grayside 85 at http://grayside.org http://grayside.org/2010/07/integrating-some-other-feature-spaces#comments cat kit | specificity http://grayside.org/2010/05/cat-kit-specificity <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>When you read through <a href="http://drupal.org/project/kit">Kit</a>, one of the themes that keeps cropping up is the concept of specific relevance. How do you know when it is a good idea to include a given variable, permission, or other component in your Feature?</p> <p>The answer boils down to this: <em>Keep your Feature lean and mean. Include only what&#8217;s necessary for a good, mission-complete piece of functionality.</em> The primary reason for this rule strikes me as the worthy goal of avoiding a horde of bloated, conflicting Features that will make an ill-configured wreckage of the sites that try to use them.</p> <p>Behind the fold for further thoughts about what specificity means in a well-built Feature.</p> <p>In thinking about it further (and the way I&#8217;ve used Features so far), I found a couple examples of why specificity is worth thinking about.</p> <h2>1. The Over-Configured Content Type</h2> <p>I created a Feature around a new content type. The Feature itself related to how that content was listed around the site (a couple of Views). I exported every variable related to how I had configured the content type, even though my <a href="http://drupal.org/project/vertical_tabs">Vertical Tabs</a> settings had no specific relevance to the functionality I was seeking to isolate and export.</p> <p>For an internal-use sort of Feature, I&#8217;m sure this does not matter. (Unless you are trying to define all your Vertical Tabs settings in a different Feature). For a publicly-shared feature, you have now introduced a piece of Vertical Tabs configuration which really has no bearing on the reason someone else might have been interested in your Feature.</p> <h2>2. It&#8217;s How I Use It</h2> <p>People disagree on how specialized any given modular website nugget should be. Just look at all the Drupal Modules with overly-themed defaults. Kit specificity in a Feature means the Feature includes only the aspects of theming and site integration necessary for the Feature to make sense, not that your specific use case for that Feature is realized in a shiny exported module.</p> <p>For internal-use&#8230; go for it! Kit is clearly intended as a standard for the growing world of shared Features. Exportables purely for deployment facilitation need not apply. Of course, Kit-compliance from the get-go will surely help you make the unlooked for transition to a publicly published Feature much&nbsp;easier.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item odd"><a href="/category/terms/features">features</a></div><div class="field-item even"><a href="/category/terms/kit">kit</a></div></div></div> Tue, 01 Jun 2010 06:52:43 +0000 Grayside 76 at http://grayside.org http://grayside.org/2010/05/cat-kit-specificity#comments cat kit | summarize namespacing http://grayside.org/2010/05/cat-kit-summarize-namespacing <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>I decided a few notes would help me grok the <a href="http://drupal.org/project/kit">Kit Specification</a>. I post them here in case someone else finds them useful.</p> <h2>Shortest Summary</h2> <p>Project Name and Feature Name should be the same. They should have a nice, unique namespace. The human readable version doesn&#8217;t need to show the prefix. Views and other individually exported pieces should be prefixed with the not-necessarily-unique part of the Feature name.</p> <h2>Barely-Shorter Sumary</h2> <p>This summary currently covers the Features Specification 1.0-draft.</p> <h3>Code Namespace</h3> <p><strong>Covers:</strong> Filenames, function names, directory name.<br /> <strong>Rule:</strong> Make the namespace (prefix) unique.</p> <p>&gt; Domain names and Drupal.Org user names make good prefixes. Why? Because they are guaranteed unique by an external authority everyone in the Drupal community is bound to bump into.</p> <h3>Project Namespace</h3> <p><strong>Covers:</strong> Project name, as defined in .info file and a Features Server feature node.<br /> <strong>Rule:</strong> Same as the code namespace for a single-feature project.</p> <h3>Machine Name</h3> <p><strong>Covers</strong>: Generic part of the feature name.<br /> <strong>Rule:</strong> Should be short and descriptive.</p> <p>Features will generally be called <em>&lt;namespace&gt;_&lt;machine name&gt;</em>.</p> <h3>Human Readable Name</h3> <p><strong>Covers</strong>: Name of the feature, such as on the modules page. (As defined by <em>name</em> in .info file.)<br /> <strong>Rule:</strong> Skip the namespace. Stick with a descriptive name.</p> <p>(I interpret this to be a human-readable version of the Machine Name.)</p> <h3>Component Namespace</h3> <p><strong>Covers</strong>: All the bits that are exportable. (Views, Content Types, Rules, etc)<br /> <strong>Rule:</strong> Prefix with the Machine Name.</p> <h2>Example</h2> <p>Here are the namespace selections for a project enhancing the OpenAtrium Notebook.</p> <ul> <li><strong>Namespace</strong>: grayside</li> <li><strong>Project Name</strong>: grayside_oa_book_manager</li> <li><strong>Machine Name</strong>: oa_book_manager</li> <li><strong>Human Readable Name</strong>: <span class="caps">OA</span> Book Manager</li> <li><strong>Component Namespace</strong>: <ul> <li><em>View:</em> oa_book_manager_bulk_update</li> <li><em>Rule:</em>&nbsp;oa_book_manager_new_page_message</li> </ul> </li> </ul> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item odd"><a href="/category/terms/features">features</a></div><div class="field-item even"><a href="/category/terms/kit">kit</a></div><div class="field-item odd"><a href="/category/terms/namespace">namespace</a></div></div></div> Sun, 23 May 2010 06:03:15 +0000 Grayside 75 at http://grayside.org http://grayside.org/2010/05/cat-kit-summarize-namespacing#comments Feature Server: Not That Hard http://grayside.org/2010/05/feature-server-not-hard <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>It turns out that running your own Feature Server isn&#8217;t that complicated. Get a Drupal site. Install the <a href="http://code.developmentseed.org/featureserver/node/163">fserver</a> feature. It&#8217;s most exotic requirements are Filefield and Context, and context is just their to facilitate easy block placement of release information.</p> <p>All the feature really does is provide a fancy <span class="caps">XML</span> Views style plugin, a couple content types with their <span class="caps">CCK</span> fields to specify things like version information, and some special file-handling magic to push files and tarballs around.</p> <p>It slid into this blog site very easily, and now I have a very clean way of upload and sharing Drupal code and functionality snippets. But should I leave the fserver as part of my blog? The last thing I need is to release a couple popular features into the wild and have to worry about the Update Status module pinging my words to&nbsp;death.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/features">features</a></div><div class="field-item odd"><a href="/category/terms/features-servers">features-servers</a></div></div></div> Fri, 07 May 2010 06:27:40 +0000 Grayside 71 at http://grayside.org http://grayside.org/2010/05/feature-server-not-hard#comments Drush and Features Servers http://grayside.org/2010/05/drush-and-features-servers <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Feature Servers have great potential to help structure the use of code sourced outside the formal ecosphere around Drupal.Org this has it&#8217;s pro&#8217;s and con&#8217;s, but I already see their usefulness in providing a little more structure to issue-queue code exchanges and organization-internal modules. So let&#8217;s bring Drush into this and boost the ease of use of that usefulness another step up.</p> <p><em>For those who need more catching up:</em><br /> Features are a special kind of <a href="http://drupal.org">Drupal</a> module built on the <a href="http://drupal.org/project/features">features</a> project. They allow you to easily export configuration from your site into a module usable on any site. Modules downloaded from a <a href="http://developmentseed.org/blog/2009/jun/24/distributed-feature-servers-drupal">Features Server</a> are the next best thing to one posted to Drupal.org. <a href="http://sf2010.drupal.org/conference/sessions/managing-and-deploying-configuration-exportables-and-features-module">DrupalConSF has a great video</a>.</p> <h3>Current State</h3> <p>The rise of Feature Servers, and perhaps other types of code release repositories would benefit from a little Drush magic. The little-documented option of <strong>&#8211;source</strong> is a starting place:</p> <div class="geshifilter"> <div class="text geshifilter-text" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal">drush --source=http://code.developmentseed.org/fserver/ dl fserver </pre></div> </div> <p>This code will grab the latest, most recommended release of the Feature Server code from DevSeed&#8217;s feature server.</p> <h3>Future Directions</h3> <p>I&#8217;ve started an issue in the <a href="http://drupal.org/node/786916">Drush queue</a> to talk about some kind of repository scheme to help manage the download and file placement of code from individually preferred&nbsp;repositories.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item odd"><a href="/category/terms/drush">drush</a></div><div class="field-item even"><a href="/category/terms/features">features</a></div><div class="field-item odd"><a href="/category/terms/features-servers">features-servers</a></div></div></div> Sat, 01 May 2010 07:14:15 +0000 Grayside 65 at http://grayside.org http://grayside.org/2010/05/drush-and-features-servers#comments