Decisions by Marcos Cano

Architectural decision records contributed to by Marcos Cano

41 decisions
  1. accepted
    Always provide editors control over image style cropping

    Manual user intervention can help prevent automated cropping from eliminating the most important parts of a photo.

    drupal contrib-modules editorial-experience media
  2. accepted
    Automate checking for uncommitted files

    Uncommitted files resulting from builds can cause issues during deployments.

    git ci devops
  3. accepted
    Use the feature branch git workflow

    Establishing a standard git workflow improves velocity and consistency of delivery.

    git
  4. accepted
    Always pin GitHub Actions to a commit hash

    GitHub Actions referenced by a mutable tag or branch can be silently replaced with malicious code, exposing CI/CD secrets across every repository that uses them.

    ci security
  5. accepted
    Use Tagify for entity autocomplete widgets in Drupal

    Drupal's default entity reference autocomplete widget has limited UX. A modern, well-supported replacement is needed and the Tagify module has been successfully used in several Lullabot projects.

    drupal contrib-modules editorial-experience
  6. accepted
    Use composer audit in automated checks for known security vulnerabilities

    Third-party dependencies can introduce known security vulnerabilities at any time, so projects need an automated mechanism to detect them early.

    composer security ci
  7. accepted
    Only allow developers and site administrators access to the default Drupal files listing

    Drupal's built-in files listing at /admin/content/files is a technical tool that has caused editorial confusion and accidental data loss.

    drupal access-control media editorial-experience
  8. accepted
    Use PHPStan for PHP code static analysis at level 6

    Static analysis catches type errors, logic bugs, and unsafe code paths without running the application, improving code quality at low cost.

    php drupal ci
  9. accepted
    Use 'drush deploy' when building Drupal sites

    When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.

    drush drupal deployments
  10. accepted
    Use the term "microcontent" to describe embeddable content from the same website

    Teams have used inconsistent terminology — including "micro-content", "component", "embeds", and "inline content" — to describe content that is embedded within pages but never exists independently.

    drupal content-modeling editorial-experience
  11. accepted
    Use `access_unpublished` for password-protected pages

    Some pages need to be accessible only to specific groups or individuals using a password or token, without requiring a full user account.

    drupal contrib-modules access-control
  12. accepted
    Use human-readable names as exposed filter identifiers in Views
    drupal editorial-experience views
  13. accepted
    Use ImageMagick with Drupal

    Drupal requires the GD PHP extension, but many sites prefer ImageMagick for better performance, flexibility, and reliability. This choice affects image features, speed, and deployment in various hosting environments.

    drupal images
  14. accepted
    Use description template for upstream patches in composer

    When managing patches in a composer.json file, clear and consistent descriptions improve maintainability and facilitate tooling. Currently, there is no standard template for describing patches, leading to inconsistent documentation.

    composer
  15. accepted
    Document project setup in README.md

    Documentation for getting started on a project should always be found in the same place and use the same formatting.

    documentation
  16. accepted
    Do not use placeholder text in form fields

    Placeholder text introduces significant usability and accessibility issues and should be avoided.

    drupal editorial-experience
  17. accepted
    Order content type form fields based on content priority

    When content types have dedicated pages, matching the display order when possible makes edit forms easier to understand.

    drupal editorial-experience
  18. deprecated
    Standardize the order of steps when building a Drupal site

    When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.

    drush drupal deployments
  19. accepted
    Use Typed Entity to encapsulate business logic in dedicated classes

    Wrapping the business logic for an entity using Typed Entity produces code that is easier to read, maintain, test, and discover.

    drupal code quality
  20. accepted
    Leverage view modes when rendering entities

    Rendering entities using view modes have multiple benefits. These include better maintainability, faster initial development time, better performance, and hardened security.

    drupal
  21. accepted
    Use [ticket-id]--[short-description] in feature branch names

    Omitting key information in branch names can cause confusion over the purpose of a branch.

    git
  22. accepted
    Do not add the Metatag field to the node form

    The metatag field makes the node form slow and overly complex for editorial users.

    drupal node-form editorial-experience performance seo
  23. accepted
    Use Claro for the Drupal administration theme

    Claro offers a modern, responsive, and accessible interface that showcases Drupal's capabilities from the outset.

    drupal editorial-experience
  24. accepted
    Use Type Tray to improve editorial UX

    Drupal's editorial experience in the "Add Content" page is confusing out of the box, especially when the content model's complexity increases.

    drupal contrib-modules editorial-experience
  25. accepted
    Use Simple Add More to improve editorial experience

    Drupal core by default outputs the maximum number of values (cardinality) as empty elements on entity forms, which usually represents a poor user-experience.

    drupal contrib-modules editorial-experience
  26. accepted
    Break composer install if patches don't apply

    Allowing builds to succeed with failed patches can lead to malformed code or hidden errors.

    drupal composer php
  27. accepted
    Use local copies of patch files

    When using cweagans/composer-patches, it is important that patch sources are consistent and do not change between builds.

    drupal php composer
  28. accepted
    Store Composer Patches configuration in composer.json

    Validating a complete Composer configuration is important to ensuring build issues are caught early.

    drupal php composer
  29. accepted
    Configure Composer Patches to Use `-p2` as `patchLevel` for Drupal core

    Drupal's git repository has a different directory structure than projects built on Drupal. Default Composer Patches settings can cause Drupal patches to be silently misapplied.

    drupal php composer
  30. accepted
    Use dedicated accounts for service integrations

    Service integrations that use personal accounts tie the function of the service with the person's engagement with the project.

    devops
  31. accepted
    Always hide non-translatable fields on translation forms

    When content translation is enabled, it's possible to decide which fields can be translated.

    drupal
  32. accepted
    Lock entity language on edit forms

    Editors new to Drupal often try to translate content by changing the language on existing content, causing confusion for site visitors.

    drupal
  33. accepted
    Consistently name entity fields

    Adopting a consistent set of rules when naming entities in Drupal can reduce errors and improve maintainability.

    drupal
  34. deprecated
    Composer patches configuration and best practices

    Default composer-patches settings can lead to misapplied patches or hidden errors. Using a consistent configuration across projects will reduce errors and save time.

    drupal php composer
  35. accepted
    Use PHPUnit for unit testing PHP code
    drupal php coding testing
  36. accepted
    Block the Drupal user 1 account in production environments

    The first user account in a Drupal site (often referred to as "administrator" or "user 1") is granted every permission automatically. If the account credentials are compromised, an attacker can easily inject JavaScript to attack site visitors and can likely execute arbitrary PHP code.

    drupal security
  37. accepted
    Confirm Drupal site configuration is always in a default state

    Configuration should never be in an overridden state after configuration import(s) have been completed.

    drupal deployment automation devops
  38. accepted
    Use strict types in PHP code

    PHP's type coercion can cause logical errors within a program. For example, when a float is cast to an int, the decimal portion is lost. We aim to reduce these errors in our code, but they can easily slip through manual code review. Following stricter typing where available can significantly reduce bugs, as shown by Python's urllib3 type hinting case study.

    php drupal
  39. accepted
    Stage File Proxy for static files

    Lullabot often works on projects that have large numbers of static file assets in production, such as images or PDFs. Keeping a complete copy of those files for each environment is wasteful, since developers tend to only look at a small portion of a site locally. A solution is needed to reduce disk use and the time it takes to update an environment.

    devops locals drupal contrib-modules
  40. accepted
    Use settings.php for environment overrides and local settings

    When developing a Drupal website, additional modules and configuration are useful for local and development environments.

    dev-tools drupal
  41. deprecated
    Define the order of steps when building a Drupal site

    When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.

    drush deployments

Search Decisions