diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..70215be --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Exclude files from releases/tarballs +tests/ export-ignore +.github/ export-ignore +.gitattributes export-ignore diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..d35875f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..db21167 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -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 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f0c5b16 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +## The Issue + +- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER + + + +## How This PR Solves The Issue + + + +## Manual Testing Instructions + + + +```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 + + + +## Release/Deployment Notes + + diff --git a/README.md b/README.md index b6c63fa..7259ca5 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -41,42 +48,50 @@ 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 ``` @@ -84,7 +99,7 @@ ddev nightwatch --tag a11y:admin --adminTheme seven This will run static tests against core standards. -``` +```bash ddev drupal lint:phpstan ddev drupal lint:phpcs ddev drupal lint:js @@ -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)** diff --git a/commands/web/nightwatch b/commands/web/nightwatch index 9558132..2a7fae0 100644 --- a/commands/web/nightwatch +++ b/commands/web/nightwatch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #ddev-generated ## Description: Run Nightwatch diff --git a/commands/web/phpunit b/commands/web/phpunit index e6cbffe..b2cc675 100644 --- a/commands/web/phpunit +++ b/commands/web/phpunit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #ddev-generated ## Description: Run PHPUnit diff --git a/config.ddev-drupal-core-dev.yaml b/config.ddev-drupal-core-dev.yaml index 892bded..186a183 100644 --- a/config.ddev-drupal-core-dev.yaml +++ b/config.ddev-drupal-core-dev.yaml @@ -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 diff --git a/core-dev/gitignore b/core-dev/gitignore index 478bb7d..40c1dc5 100644 --- a/core-dev/gitignore +++ b/core-dev/gitignore @@ -6,4 +6,4 @@ /sites/simpletest /sites/default/files /vendor -test_output \ No newline at end of file +test_output diff --git a/docker-compose.core-dev-selenium.yaml b/docker-compose.core-dev-selenium.yaml index 7da90d4..82b743e 100644 --- a/docker-compose.core-dev-selenium.yaml +++ b/docker-compose.core-dev-selenium.yaml @@ -2,10 +2,10 @@ 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 @@ -13,10 +13,6 @@ services: - 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 diff --git a/install.yaml b/install.yaml index 13e6f88..cbb4e3a 100644 --- a/install.yaml +++ b/install.yaml @@ -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: @@ -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 - | diff --git a/tests/test.bats b/tests/test.bats index 0d9a612..be5eddf 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -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}" @@ -37,6 +39,7 @@ setup() { run ddev start -y assert_success run ddev composer install + assert_success } health_checks() { diff --git a/web-build/Dockerfile.chromium b/web-build/Dockerfile.chromium index 96cfe0a..1ca6c71 100644 --- a/web-build/Dockerfile.chromium +++ b/web-build/Dockerfile.chromium @@ -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 <