Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Exclude files from releases/tarballs
tests/ export-ignore
.github/ export-ignore
.gitattributes export-ignore
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🐞 Bug report or Support Request
description: Create a report to help us improve.
labels: [bug]
body:
- type: checkboxes
attributes:
label: Preliminary checklist
description: Please complete the following checks before submitting an issue.
options:
- label: I am using the latest stable version of DDEV
required: true
- label: I am using the latest stable version of this add-on
required: true
- type: textarea
attributes:
label: Expected Behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: What actually happened instead?
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Specific steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run `...`
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Screenshots? Anything that will give us more context about your issue!

💡 Attach images or log files by clicking this area to highlight it and dragging files in.
validations:
required: false
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 🚀 Feature request
description: Suggest an idea for this project.
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search existing issues to see if one already exists for your request.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: Clearly and concisely describe the problem. (Ex. I'm always frustrated when...)
validations:
required: true
- type: textarea
attributes:
label: Describe your solution
description: Clearly and concisely describe what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives
description: Clearly and concisely describe any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request.
validations:
required: false
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## The Issue

- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER

<!-- Provide a brief description of the issue. -->

## How This PR Solves The Issue

<!-- Describe the key change(s) in this PR that address the issue above. -->

## Manual Testing Instructions

<!-- If this PR changes logic, consider adding additional steps or context to the instructions below. -->

```bash
ddev add-on get https://github.com/justafish/ddev-drupal-core-dev/tarball/refs/pull/REPLACE_ME_WITH_THIS_PR_NUMBER/head
ddev restart
```

## Automated Testing Overview

<!-- Please describe the tests introduced by this PR, or explain why no tests are needed. -->

## Release/Deployment Notes

<!-- Does this affect anything else or have ramifications for other code? Does anything have to be done on deployment? -->
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# ddev-core-dev
[![add-on registry](https://img.shields.io/badge/DDEV-Add--on_Registry-blue)](https://addons.ddev.com)
[![tests](https://github.com/justafish/ddev-drupal-core-dev/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/justafish/ddev-drupal-core-dev/actions/workflows/tests.yml?query=branch%3Amain)
[![last commit](https://img.shields.io/github/last-commit/justafish/ddev-drupal-core-dev)](https://github.com/justafish/ddev-drupal-core-dev/commits)
[![release](https://img.shields.io/github/v/release/justafish/ddev-drupal-core-dev)](https://github.com/justafish/ddev-drupal-core-dev/releases/latest)

This is a DDEV addon for doing Drupal core development.
# DDEV Drupal Core Dev

This is a DDEV add-on for doing Drupal core development.

We're in #ddev-for-core-dev on [Drupal Slack](https://www.drupal.org/community/contributor-guide/reference-information/talk/tools/slack) (but please try and keep work
and feature requests in Issues where it's visible to all 🙏)

## Installation
```

```bash
git clone https://git.drupalcode.org/project/drupal.git drupal
cd drupal
ddev config --omit-containers=db --disable-settings-management
Expand All @@ -22,7 +28,8 @@ command. This allows you to perform some basic tasks without needing to install
`drush` which will alter your composer dependencies.

## Examples
```

```bash
# Install drupal
# Run "ddev drupal install" to see all available options
ddev drupal install standard
Expand All @@ -41,50 +48,58 @@ for Chrome and https://drupal.ddev.site:7901 for Firefox. The password is
"secret". YMMV using Firefox as core tests don't currently run on it.

Only core tests
```

```bash
ddev nightwatch --tag core
```

Skip running core tests
```

```bash
ddev nightwatch --skiptags core
```

Run a single test
```

```bash
ddev nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js
```

a11y tests for both the admin and default themes
```

```bash
ddev nightwatch --tag a11y
```

a11y tests for the admin theme only
```

```bash
ddev nightwatch --tag a11y:admin
```

a11y tests for the default theme only
```

```bash
ddev nightwatch --tag a11y:default
```

a11y test for a custom theme used as the default theme
```

```bash
ddev nightwatch --tag a11y:default --defaultTheme bartik
```

a11y test for a custom admin theme
```

```bash
ddev nightwatch --tag a11y:admin --adminTheme seven
```

## Core Linting

This will run static tests against core standards.

```
```bash
ddev drupal lint:phpstan
ddev drupal lint:phpcs
ddev drupal lint:js
Expand All @@ -96,3 +111,7 @@ ddev drupal lint:cspell --modified-only

You can run all linting with `ddev drupal lint`, or with fail-fast turned on:
`ddev drupal lint --stop-on-failure`

## Credits

**Contributed and maintained by [@justafish](https://github.com/justafish)**
2 changes: 1 addition & 1 deletion commands/web/nightwatch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#ddev-generated
## Description: Run Nightwatch
Expand Down
2 changes: 1 addition & 1 deletion commands/web/phpunit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#ddev-generated
## Description: Run PHPUnit
Expand Down
2 changes: 1 addition & 1 deletion config.ddev-drupal-core-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# #ddev-generated
# This file is placed by the justafish/ddev-drupal-core-dev addon.

ddev_version_constraint: '>=v1.23.1'
ddev_version_constraint: '>= v1.24.10'
omit_containers: ["db"]
upload_dirs:
# The install technique tries to remove all of sites/default/files
Expand Down
2 changes: 1 addition & 1 deletion core-dev/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/sites/simpletest
/sites/default/files
/vendor
test_output
test_output
8 changes: 2 additions & 6 deletions docker-compose.core-dev-selenium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
services:
chrome:
container_name: ddev-${DDEV_SITENAME}-chrome
image: selenium/standalone-chromium:137.0.7151.68
image: selenium/standalone-chromium:143.0.7499.169
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
com.ddev.approot: ${DDEV_APPROOT}
shm_size: 2gb
expose:
- 7900
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTPS_EXPOSE=7900:7900
- HTTP_EXPOSE=7910:7900
links:
- web:web
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
volumes:
- ".:/mnt/ddev_config:ro"
- ddev-global-cache:/mnt/ddev-global-cache
5 changes: 3 additions & 2 deletions install.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Details about the install.yaml file are at https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#sections-and-features-of-ddev-get-add-on-installyaml

name: ddev-drupal-core-dev

project_files:
Expand All @@ -26,12 +24,15 @@ project_files:
- core-dev/src/Command/LintCommand.php
- core-dev/src/Command/ModuleInstallCommand.php

ddev_version_constraint: '>= v1.24.10'

post_install_actions:
- cp core-dev/gitignore ../.gitignore
- mkdir -p ../test_output
- chmod +w ../test_output
- |
if ! ddev status | grep -q "chrome:4444"; then
echo "Starting the project..."
ddev start
fi
- |
Expand Down
5 changes: 4 additions & 1 deletion tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ setup() {
run ddev start -y
assert_success
run ddev composer install
run ddev composer require drupal/core-dev
assert_success
run ddev composer require drupal/core-dev -W
assert_success

git clone --depth=1 https://git.drupalcode.org/project/drupal.git ${TESTDIR_CHECKOUT}
cd "${TESTDIR_CHECKOUT}"
Expand All @@ -37,6 +39,7 @@ setup() {
run ddev start -y
assert_success
run ddev composer install
assert_success
}

health_checks() {
Expand Down
23 changes: 14 additions & 9 deletions web-build/Dockerfile.chromium
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#ddev-generated
RUN sudo apt update -y \
&& sudo apt remove chromium* -y \
&& ARCH=$(dpkg --print-architecture) \
&& wget https://snapshot.debian.org/archive/debian/20250612T023025Z/pool/main/c/chromium/chromium_137.0.7151.68-1~deb12u1_${ARCH}.deb \
&& wget https://snapshot.debian.org/archive/debian/20250612T023025Z/pool/main/c/chromium/chromium-common_137.0.7151.68-1~deb12u1_${ARCH}.deb \
&& wget https://snapshot.debian.org/archive/debian/20250612T023025Z/pool/main/c/chromium/chromium-driver_137.0.7151.68-1~deb12u1_${ARCH}.deb \
&& sudo apt install ./chromium*.deb -y \
&& sudo apt-mark hold chromium chromium-common chromium-driver \
&& rm -f chromium*.deb
RUN <<EOF
set -eu -o pipefail
apt-get update || true
apt-get remove -y chromium* || true
SNAPSHOT_URL="https://snapshot.debian.org/archive/debian/20260301T083349Z/pool/main/c/chromium"
CHROMIUM_VERSION="143.0.7499.169-1"
source /etc/os-release
for pkg in chromium chromium-common chromium-driver chromium-sandbox; do
wget ${SNAPSHOT_URL}/${pkg}_${CHROMIUM_VERSION}~deb${VERSION_ID}u1_${TARGETARCH}.deb
done
apt-get install -y --no-install-recommends ./*.deb
rm -f ./*.deb
rm -rf /var/lib/apt/lists/*
EOF