How to organize features and implications of getting everything into code

Description

Collection: Change Management and Version ControlChapter: How To Version Control Site Configuration With Features

Transcript

Now we just got done grouping a set of configuration components into a feature called “Articles”. Fairly clear, as we worked through all the possible components we could add, which ones were directly related. And sometimes you’ll find this is the case where there’s a clear delineation of the edge of the feature.

What should belong within a feature and what shouldn’t? Other times it’s going to be a little bit more ambiguous. So I wanted to talk briefly about some ideas around organizing your features. So I'm going to go ahead and click on this “CREATE FEATURE” tab.

Now we’re not creating a feature here, we’re just exploring the components. And I wanted to point out a couple things. When we click the drop-down, and if we select “Content type” here, we’ll see that there’s only one listed now.

“Basic page”. That’s because the article content type is already part of a feature. And every component can belong to just one feature.

Otherwise it’s considered a conflict. So what this means, is that it’s very easy to tell what aspects of our site are currently under “Version Control” and what isn’t, because we can go through this list and just check and see what items are still left to collect into a feature. Now one idea behind the use of features, is that you want to get everything into code that you possibly can.

Practically speaking, there may be some components that you don’t really care about because you’re never going to modify them after their initial installation. But in general, the more components that are in code, the more secure you’re going to be and the easier time you’re going to have rolling things back if something goes wrong. Now one implication of putting something in a feature that we haven’t really discussed, is that when you make modifications to that component later, then it’s either going to appear as an override, meaning that there a change that isn’t in “Version Control” or you’ll need to re-export it into code, which is kind of a lengthy process if you’re doing it manually.

But that’s a little bit of overhead. Instead of just pointing and clicking and selecting your ...

In this series we uncover how to use powerful tools to speed up and stabilize the Drupal development process. We begin with a thorough walk-through of Git, the version control system. After we cover how to patch modules and upgrade Drupal from one minor version to another, we demonstrate how to use the Features module to version control components of Drupal that aren't typically available to version control. Finally, we wrap up with how to integrate Drush - a powerful command line tool for Drupal - into your workflow to speed up the process of doing everything we discussed earlier in the series.

Some of the key points we'll be covering include:

How to use the command line

How to work with the Features module to capture important database changes and make deployment easier.

How to use Git for version control

Best practices for working on a Drupal team

Who this collection is for

This video collection is mainly for developers who want to improve their deployment strategies and learn how to work on a shared Drupal code base with other developers. However, even if you are not a developer, our coverage of using Features and version control is extremely valuable for deploying Drupal sites and sharing reusable components between projects.

Prerequisites

Even if you are not a developer, you will be able to follow with most of this collection. When we talk about code we do not go into detail about the basic components of the code, so you may want to brush up on some coding basics in the "PHP Programming Basics" collection.

It looks like there might be an issue playing videos in this browser. We're working on better cross-brower experience, but in the meantime please try the latest Chrome or Firefox browsers. Or, you may be able to watch the video directly without progress tracking or transcript: