Skip to content

Pronovix/ddev-drupal-qa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

add-on registry tests last commit release

DDEV Drupal Qa

Overview

This add-on seamlessly integrates various quality assurance tools from Drupal QA into DDEV, providing convenient ddev commands for various QA tools.

Installation

Since this add-on resides in a private Github repository ddev add-on get Pronovix/ddev-drupal-qa does not work, you need to configure a GitHub personal access token (PAT) for DDEV to download it.

Step 1: Create a Fine-Grained GitHub Token

  1. Log in to GitHub with an account that has access to the private Pronovix/ddev-drupal-qa repository.
  2. Navigate to GitHub's Fine-Grained Personal Access Tokens page.
  3. Fill out the following fields:
    • Token name: ddev-pronovix-private-addons (or any descriptive name).
    • Resource owner: Select Pronovix.
    • Expiration: Select a reasonable timeframe (up to 3 months, but not more).
    • Repository access: Select Only select repositories, then choose Pronovix/ddev-drupal-qa from the list.
    • Repository permissions: Expand the list, find Contents, and set its access level to Read-only. This provides enough permissions for DDEV to download the add-on files.
  4. Click Generate token, copy the generated token immediately, and store it in a secure location. You will not be able to see it again on GitHub.
  5. Request Approval: Because the token's resource owner is Pronovix, the token must be approved by an organization administrator before it can be used. Ping the infrastructure team in the #tribe_infrastructure channel to check and approve your new access token request at https://github.com/organizations/Pronovix/settings/personal-access-token-requests.

Step 2: Configure DDEV to Use the Token

DDEV automatically recognizes the DDEV_GITHUB_TOKEN environment variable and uses it to authenticate API requests for downloading private add-ons.

Export the token in your current terminal session:

export DDEV_GITHUB_TOKEN="github_pat_your_fine_grained_token_here"

Tip: To avoid having to export the token in every new shell session, you can add the export command to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.bash_profile).

Step 3: Install the Add-on

Run the installation command in your DDEV project root:

Option A: Install from the main branch (default)

ddev add-on get https://api.github.com/repos/Pronovix/ddev-drupal-qa/tarball/main    

Option B: Install a specific tagged release (recommended for stability)

Pinning to a specific release ensures that your environment is reproducible:

ddev add-on get https://api.github.com/repos/Pronovix/ddev-drupal-qa/tarball/v1.0.0

(Replace v1.0.0 with the desired release tag).

Step 4: Restart DDEV

Restart your DDEV project to apply the changes:

ddev restart

After installation, make sure to commit the .ddev directory to version control.

Prerequisites

Before using the commands, ensure you have the pronovix/drupal-qa package installed in your project:

composer require --dev pronovix/drupal-qa

This add-on also automatically installs ddev/ddev-selenium-standalone-chrome as a dependency of running tests with PHPUnit and other frameworks.

Usage

Once installed and configured, you can use the following ddev commands:

ddev phpcbf

Description: Run phpcbf inside the web container Usage: ddev phpcbf [flags] [args] Example: "ddev phpcbf" or "ddev phpcbf -n"

ddev phpcs

Description: Run phpcs inside the web container Usage: ddev phpcs [flags] [args] Example: "ddev phpcs" or "ddev phpcs -n"

ddev phpstan

Description: Run phpstan inside the web container Usage: ddev phpstan [flags] [args] Example: "ddev phpstan" or "ddev phpstan -n"

ddev phpunit

Description: Run phpunit inside the web container Usage: ddev phpunit [flags] [args] Example: "ddev phpunit" or "ddev phpunit --stop-on-failure"

ddev behat

Description: Run behat inside the web container Usage: ddev behat [flags] [args] Example: "ddev behat" or "ddev behat --tags=@my_tag"

Credits

Contributed and maintained by @Pronovix

About

DDEV add-on for seamlessly integrating tools from Drupal QA into DDEV.

Resources

Stars

Watchers

Forks

Contributors

Languages

Generated from ddev/ddev-addon-template