Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for 3.0.0-beta1 #135

Merged
merged 22 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4eb1000
Update README.md with Gitpod instructions
finnlewis Jun 16, 2023
3cd40eb
Add ddev commands for phpcs, phpstan etc
finnlewis Jun 16, 2023
ebbf113
Merge branch '3.x' into feature/117-ddev-commands
finnlewis Sep 7, 2023
88a29b5
Add argument to pass command line arguments through from outside ddev.
finnlewis Sep 7, 2023
e31cf39
Add https://github.com/ddev/ddev-selenium-standalone-chrome for bette…
finnlewis Sep 7, 2023
872efcf
[3.x] Add on demand github test runner
andybroomfield Sep 15, 2023
814bf17
Merge pull request #128 from localgovdrupal/feature/3.x-on-demand-tests
finnlewis Sep 18, 2023
002b076
refactor: lando quality improvements
millnut Sep 23, 2023
3cc018f
Merge pull request #126 from localgovdrupal/feature/117-ddev-commands
finnlewis Sep 25, 2023
ed8e148
ci: add PHP 8.2 support
millnut Sep 25, 2023
0f91adc
ci: fix phpstan
millnut Sep 26, 2023
9a18c61
ci: fix phpstan
millnut Sep 26, 2023
ba31631
ci: fix phpstan
millnut Sep 26, 2023
dd8224b
ci: fail action on composer patch failure
millnut Sep 26, 2023
3054d99
Merge pull request #132 from localgovdrupal/feature/3.x/action-fail-o…
finnlewis Sep 29, 2023
da456c2
Merge pull request #130 from localgovdrupal/feature/3.x/add-php-8-2-t…
finnlewis Oct 2, 2023
12875ef
Merge pull request #129 from localgovdrupal/feature/3.x/lando-improve…
finnlewis Oct 2, 2023
1dbef7e
ci: fix phpstan
millnut Oct 2, 2023
a467a41
ci: fix phpstan
millnut Oct 2, 2023
9a4a06e
Install group modile for test dependencies.
FinnERLewis Oct 12, 2023
d0a9575
Fix composer working directory.
FinnERLewis Oct 12, 2023
9879c14
Merge pull request #131 from localgovdrupal/feature/3.x/fix-phpstan-c…
finnlewis Oct 16, 2023
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
2 changes: 1 addition & 1 deletion .ddev/commands/web/phix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
## Usage: phix
## Example: "ddev phix"

/var/www/html/bin/phpcbf
/var/www/html/bin/phpcbf $*
2 changes: 1 addition & 1 deletion .ddev/commands/web/phpcs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
## Usage: phpcs
## Example: "ddev phpcs"

/var/www/html/bin/phpcs -p
/var/www/html/bin/phpcs -p $*
2 changes: 1 addition & 1 deletion .ddev/commands/web/phpstan
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
## Usage: phpix
## Example: "ddev phix"

/var/www/html/bin/phpstan
/var/www/html/bin/phpstan $*
4 changes: 2 additions & 2 deletions .ddev/commands/web/phpunit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

## Description: Run phpunit in the web container to run phpunit tests.
## Description: Run phpunit in the web container to run phpunit tests.
## Usage: phpunit
## Example: "ddev phpunit"

/var/www/html/bin/phpunit
/var/www/html/bin/phpunit $*
25 changes: 25 additions & 0 deletions .ddev/config.selenium-standalone-chrome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome
#
web_environment:
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
- BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
- SIMPLETEST_BASE_URL=http://web
- SIMPLETEST_DB=mysql://db:db@db/db
# Use disable-dev-shm-usage instead of setting shm_usage
# https://developers.google.com/web/tools/puppeteer/troubleshooting#tips
# The format of chromeOptions is defined at https://chromedriver.chromium.org/capabilities
- MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
# Nightwatch
- DRUPAL_TEST_BASE_URL=http://web
- DRUPAL_TEST_DB_URL=mysql://db:db@db/db
- DRUPAL_TEST_WEBDRIVER_HOSTNAME=selenium-chrome
- DRUPAL_TEST_WEBDRIVER_PORT=4444
- DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
- DRUPAL_TEST_WEBDRIVER_CHROME_ARGS=--disable-gpu --headless --no-sandbox --disable-dev-shm-usage
- DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false
- DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../
- DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
- DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch
# DTT
- DTT_BASE_URL=http://web
- DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
30 changes: 30 additions & 0 deletions .ddev/docker-compose.selenium-chrome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome
#
version: '3.6'
services:
selenium-chrome:
image: seleniarm/standalone-chromium:4.1.4-20220429
container_name: ddev-${DDEV_SITENAME}-selenium-chrome
expose:
# The internal noVNC port, which operates over HTTP so it can be exposed
# through the router.
- 7900
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTPS_EXPOSE=7900:7900
- HTTP_EXPOSE=7910:7900
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
# To enable VNC access for traditional VNC clients like macOS "Screen Sharing",
# uncomment the following two lines.
#ports:
# - "5900:5900"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
volumes:
- ".:/mnt/ddev_config"

web:
links:
- selenium-chrome
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '3.x'
schedule:
- cron: "0 7 * * *"
workflow_dispatch:

env:
LOCALGOV_DRUPAL_PROJECT: localgovdrupal/localgov-project
Expand All @@ -22,6 +23,8 @@ jobs:
build:
name: Install LocalGov Drupal
runs-on: ubuntu-latest
env:
COMPOSER_EXIT_ON_PATCH_FAILURE: '1'

strategy:
fail-fast: false
Expand All @@ -32,6 +35,7 @@ jobs:
- '~10.0'
php-version:
- '8.1'
- '8.2'

steps:

Expand Down Expand Up @@ -75,7 +79,9 @@ jobs:
ref: php${{ matrix.php-version }}

- name: Create LocalGov Drupal project
run: composer create-project --stability dev localgovdrupal/localgov-project:${COMPOSER_REF} ./html
run: |
composer create-project --stability dev localgovdrupal/localgov-project:${COMPOSER_REF} ./html
composer --working-dir=./html require drupal/group

phpcs:
name: Coding standards checks
Expand All @@ -91,6 +97,7 @@ jobs:
- '~10.0'
php-version:
- '8.1'
- '8.2'

steps:

Expand Down Expand Up @@ -126,6 +133,7 @@ jobs:
- '~10.0'
php-version:
- '8.1'
- '8.2'

steps:

Expand Down Expand Up @@ -160,6 +168,7 @@ jobs:
- '~10.0'
php-version:
- '8.1'
- '8.2'

steps:

Expand Down
19 changes: 13 additions & 6 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: localgov
recipe: drupal10
config:
xdebug: false
webroot: web
php: '8.1'
proxy:
Expand All @@ -13,6 +12,11 @@ proxy:
- 'solr-sitewide.localgov.lndo.site:8983'
services:
appserver:
xdebug: true
build_as_root:
# This disables Xdebug during build, but puts all dependencies in place
# ready for the tooling to enable Xdebug.
- rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload
overrides:
environment:
DRUSH_OPTIONS_ROOT: '/app/web'
Expand All @@ -21,6 +25,9 @@ services:
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", { "chromeOptions": { "w3c": false } }, "http://chromedriver:4444/wd/hub"]'
BROWSERTEST_OUTPUT_DIRECTORY: '/app/web/sites/simpletest/browser_output'
BROWSERTEST_OUTPUT_BASE_URL: 'https://localgov.lndo.site'
# Support debugging CLI with Xdebug.
PHP_IDE_CONFIG: "serverName=appserver"
XDEBUG_SESSION: "lando"
build:
- mkdir -p web/sites/simpletest/browser_output
database:
Expand All @@ -40,7 +47,7 @@ services:
command: '/bin/s6-svscan /etc/services.d'
portforward: true
node:
type: 'node:16'
type: 'node:18'
globals:
gulp-cli: latest
overrides:
Expand Down Expand Up @@ -84,13 +91,13 @@ tooling:
cmd: '/app/bin/phpunit --testdox'
xdebug-on:
service: appserver
description: Enable xdebug for apache.
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
description: Enable Xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Xdebug enabled"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for apache.
cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
description: Disable Xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Xdebug disabled"
user: root
gulp:
service: node
Expand Down
11 changes: 10 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"configurations": [
{
"name": "Listen for Xdebug",
"name": "Listen for Xdebug (ddev)",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
},
{
"name": "Listen for Xdebug (lando)",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceRoot}"
}
}
]
}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ For guidance on installing see:
- [Installing LocalGov Drupal locally with composer](https://github.com/localgovdrupal/localgov/blob/2.x/README.md#installing-localgov-drupal-locally-with-composer)
- [Getting started on LocalGov Drupal docs](https://docs.localgovdrupal.org/devs/getting-started/)

## Gitpod

Gitpod allows you to run a virtual development environment in the cloud in your browser.

This can be very useful for testing functionality, reviewing pull requests, or working on features.

### Before you start

You will need an account on Gitpod.

If you authenticate with your Github account, you will be able to push commits back to the repository you are working on.

[Sign up for gitpod.io](https://gitpod.io/login), if you haven't already.

### Spin up LocalGov Drupal with

Click on the "Open in Gitpod" button below

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/localgovdrupal/localgov_project)

## Maintainers

This project is currently maintained by:
Expand Down
15 changes: 10 additions & 5 deletions assets/composer/settings.lando.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,20 @@
*/
$settings['skip_permissions_hardening'] = TRUE;

/**
* Get Lando info
*/
$lando_info = json_decode(getenv('LANDO_INFO'), TRUE);

/**
* Lando database credentials.
*/
$databases['default']['default'] = array (
'database' => 'database',
'username' => 'database',
'password' => 'database',
'host' => 'database',
'port' => '3306',
'database' => $lando_info['database']['creds']['database'],
'username' => $lando_info['database']['creds']['user'],
'password' => $lando_info['database']['creds']['password'],
'host' => $lando_info['database']['internal_connection']['host'],
'port' => $lando_info['database']['internal_connection']['port'],
'driver' => 'mysql',
'prefix' => '',
'collation' => 'utf8mb4_general_ci',
Expand Down
23 changes: 12 additions & 11 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
parameters:
customRulesetUsed: true
reportUnmatchedIgnoredErrors: false
# Ignore phpstan-drupal extension's rules.
ignoreErrors:
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
- '#Plugin definitions cannot be altered.#'
- '#Missing cache backend declaration for performance.#'
- '#Plugin manager has cache backend specified but does not declare cache tags.#'
#includes:
# - vendor/mglaman/phpstan-drupal/extension.neon
# - vendor/phpstan/phpstan-deprecation-rules/rules.neon
# we don't set a level so that we check deprecations only, and
# not to highlight unknown classes which are from composer suggestions
customRulesetUsed: true
reportUnmatchedIgnoredErrors: false
# Ignore phpstan-drupal extension's rules.
ignoreErrors:
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
- '#Plugin definitions cannot be altered.#'
- '#Missing cache backend declaration for performance.#'
- '#Plugin manager has cache backend specified but does not declare cache tags.#'
# new static() is a best practice in Drupal, so we cannot fix that.
- '#^Unsafe usage of new static#'
Loading