Top Banner
R.E.A.D How to select the right modules https://2015.midcamp.org/node/34 MidCamp 2015 #MidCamp
96

R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Jul 20, 2015

Download

Internet

Michael Miles
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

R.E.A.DHow to select the right modules

https://2015.midcamp.org/node/34MidCamp 2015

#MidCamp

Page 2: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Who You AreNew to Drupal.Want to improve habits.Session curious.

Page 3: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Your RoleA Drupal developer.A site architect.Functionality decision maker.

Page 4: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

What it is all AboutHow to quickly make smart, informed functionality decisions.

Page 5: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

What we will CoverSteps to decide between a contrib, patched or custom module.Basics of writing/contributing a patch.Basics of writing/contributing a module.

Page 6: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Michael MilesFrom: Boston, MA  ..a.k.a Planet Hoth

Work:   (@WeAreGenuine)Genuine

Exp: Working with Drupal since 2008.Recently named an Acquia M.V.P

Twitter: @mikemiles86 Drupal.org: mikemiles86 All the Places: mikemiles86 

mike­miles.com

Page 7: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

R.E.A.DResearch what exists.Evaluate the options.Analyze the gap.Determine amount of change.

Page 8: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Research What Exists

Page 9: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Isolate KeywordsRead documentation, specs, etc...Pay attention to unique nouns and verbs.Ask questions!

Page 10: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Perform Searches30k+ Modules available.Favorite search engine "Drupal [keyword]".Search on Drupal.org

Page 11: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Utilize the CommunityUse IRC: #drupal, #drupal­support.Use Stack Exchange:  .Social Networks: G+, Facebook, LinkedIn.Even reddit!  .

drupal.stackexchange.com

reddit.com/r/drupal

Page 12: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Isolate Keywords.Perform Searches.Utilize Community.

Page 13: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Evaluate the Options

Page 14: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Read the DescriptionWhat does the module do?What does the module not do?What does the module depend on?

Page 15: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Community AdoptionDownloads vs. Installs vs. Age.Activity of issue queue.Issues are good, not bad!

Page 16: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Maintainer ActivityParticipate in issue queue?Accepting of feedback?Regular commits and/or releases?

Page 17: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Read the description.Check community adoption.Check maintainer activity.

Page 18: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Analyze the Gap

Page 19: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Download and Test the ModuleGain a better understanding.Use a sandbox:  .What is offered out of the box?

simplytest.me

Page 20: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Discover Missing FunctionalityWhat does it not do?Missing 80%? Missing 20%?Bigger gap = Bigger effort.

Page 21: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Check for Community SolutionsLook at the issue queue.Search "Drupal [module] [functionality]".Ask questions!

Page 22: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Download and test the module.Discover missing functionality.Check for comunity solutions.

Page 23: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Determine Change

Page 24: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Review the Module CodeDoes it follow coding standards?Is it extendable?Can you figure out what does what?

Page 25: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Estimate EffortHow much code to rewrite?How much code to add?How much time is there?

Page 26: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Extend or AlterAdding functionality?Changing functionality?Changing the modules goal?

Page 27: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Review module code.Estimate effort.Extend or alter?

Page 28: R.E.A.D: Four steps for selecting the right modules Midcamp 2015
Page 29: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Examples

Page 30: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Scenario #1

Page 31: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

The RequirementsWHEN SAVING A FILE ENTITYAND IT IS A JPEG IMAGETHEN THE EXIF META DATA NEEDS TO BE CAPTUREDAND MAPPED TO CUSTOM FIELDSAND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES

Page 32: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Research What Exists

Page 33: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Isolate Keywords

WHEN SAVING A FILE ENTITYAND IT IS A JPEG IMAGETHEN THE EXIF META DATA NEEDS TO BE CAPTUREDAND MAPPED TO CUSTOM FIELDSAND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES

Page 34: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Perform SearchWe will focus on the keyword "Exif"

Page 35: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Search Google

Page 36: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Utilize the Community

Page 37: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Evaluate the OptionsExif custom seems like best fit.

Page 38: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Read the Module Description

Page 39: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Look at Community Adoption

Page 40: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Look at Maintainer Activity

Page 41: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Analyze the Gap

Page 42: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Download and Test the Module

Page 43: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Discover Missing Functionality

Page 44: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Check for Solutions

Page 45: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Determine Change

Page 46: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Review Code

Page 47: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Estimate EffortAdd Features integration.Alter primary key for mappings.Time is minimal.

Page 48: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Extend or AlterAdding features support.Not changing what module does.Extending.

Page 49: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Which Path to ChooseUse module as is.Patch module.Write own module.

Page 50: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Patch!Module meets 90% of needs.Small gap, small effort.Extends module.

Page 51: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

What is a Patch?.

A structured list of changes to files.Re­appliable to files.Focused on a single change.

drupal.org/patch

Page 52: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Creating a Patch

Page 53: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Clone and branch module git repo.

Page 54: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Make changes to code.

Page 55: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Test your changes.

Page 56: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Generate patch file.

Page 57: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

diff --git a/exif_custom.features.inc b/exif_custom.features.incnew file mode 100644index 0000000..243bbe2--- /dev/null+++ b/exif_custom.features.inc@@ -0,0 +1,158 @@+<?php+/**+ * @file+ * Features file for the exif_custom module.+ */++/**+ * Implements hook_features_api().+ */+function exif_custom_features_api() {+ return array(+ 'exif_custom' => array(+ 'name' => t('EXIF Custom mappings'),+ 'default_hook' => 'exif_custom_export_maps',+ 'feature_source' => TRUE,+ 'default_file' => FEATURES_DEFAULTS_INCLUDED,+ 'file' => drupal_get_path('module', 'exif_custom') . '/exif_custom.features.inc',+ ),+ );+}+...

Page 58: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Submitting a Patch

Page 59: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Create/comment on issue queue.

Page 60: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Attach your patch.Follow patch naming standards

[module]­[description]­[issue­number]­[comment­number].patch

Page 61: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Watch for feedback.

Page 62: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Wait for merge. (hopefully)

Page 63: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Giving back to thecommunity

Page 64: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Scenario #2

Page 65: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

The RequirementsWHEN SITE USES WORKBENCH TO MODERATE CONTENTTHEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATESAND TRANSITIONS ARE EXPORTABLE USING FEATURES

WHEN EDITNG A CONTENT REVISIONTHEN CAN SCHEDULE A TRANSITIONAND CAN SELECT DATE FOR FIRST STATEAND CAN SELECT DATE FOR SECOND STATE

Page 66: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Research What Exists

Page 67: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Isolate Keywords

WHEN SITE USES WORKBENCH TO MODERATE CONTENTTHEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATESAND TRANSITIONS ARE EXPORTABLE USING FEATURES

WHEN EDITNG A CONTENT REVISIONTHEN CAN SCHEDULE A TRANSITIONAND CAN SELECT DATE FOR FIRST STATEAND CAN SELECT DATE FOR SECOND STATE

Page 68: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Search for Existing ModulesWe will focus on the keywords "workbench schedule"

Page 69: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Search Drupal

Page 70: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Evaluate the OptionsLook at Scheduler Workbench Integration.

Page 71: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Read the Module Description

Page 72: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Look at Community Adoption

Page 73: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Look at Maintainer Activity

Page 74: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Analyze the Gap

Page 75: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Download and Test the Module

Page 76: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Discover Missing FunctionalityUnable to create different transitions per type.Unable to select per revision.No features support.

Page 77: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Determine Change

Page 78: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Review Code

Page 79: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Estimate EffortRefactor creating schedules & transitions.Decouple transitions from content types.Add Features integration.Will take time.

Page 80: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Extend or AlterChanging how transitions/schedules are created.Changing purpose of module.Altering.

Page 81: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Which path to choose?Use module as is.Patch module.Write own module.

Page 82: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Build a custom module!Too big/complicated to be a patch.Would alter module goals.No other module exists to support use cases.

Page 83: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Writing a Module.

Follow Drupal coding standards.Make use of hooks and APIs.Test your code!

drupal.org/developing/modules

Page 84: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Contributing a ModuleAsk yourself:

Could others use this?Seriously, is it abstracted enough?

Page 85: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Name module appropriately.Namespace based on dependencies.Be clear, not clever.Should indicate what module does.

Page 86: R.E.A.D: Four steps for selecting the right modules Midcamp 2015
Page 87: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Provide a detailed description.Explain what module does and does not do.Outline any dependencies.Help fellow R.E.A.D­ers.

Page 88: R.E.A.D: Four steps for selecting the right modules Midcamp 2015
Page 89: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Be a good maintainer.Bugs are badges not bruises.Participate in the issue queue.Update, release and improve.

Page 90: R.E.A.D: Four steps for selecting the right modules Midcamp 2015
Page 91: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Let's review

Page 92: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Remember to R.E.A.DResearch what exists.Evaluate the options.Analyze the gap.Determine amount of change.

Page 93: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Slides & Notesbit.ly/midcampREADbit.ly/midcampREADslidesbit.ly/drupalREAD

Page 94: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Sprint Sunday 09:00-17:00The Nerdery, 300 N Elizabeth St., Suite 500C

http://2015.midcamp.org/schedule

Learn through contributionContributors of all skill sets and levels are

welcome and encouraged

Page 95: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

Feedbackhttps://joind.in/13791

Speaker Name: @mikemiles86#MidCamp

Page 96: R.E.A.D: Four steps for selecting the right modules Midcamp 2015

 #MidCamp R.E.A.D /  Michael Miles

Thank You!