Skip to content

Commit

Permalink
Merge branch 'main' into feature/GH-420
Browse files Browse the repository at this point in the history
  • Loading branch information
tormi committed Dec 6, 2024
2 parents e1cafd1 + 87264e5 commit ab11024
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 72 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ orbs:
silta: silta/silta@1

executors:
cicd82:
silta:
docker:
- image: wunderio/silta-cicd:circleci-php8.2-node20-composer2-v1
- image: wunderio/silta-cicd:circleci-php8.3-node22-composer2-v1

workflows:
commit:
Expand All @@ -23,7 +23,7 @@ workflows:

- silta/drupal-validate:
name: validate
executor: cicd82
executor: silta
post-validation:
- run: echo "You can add additional validation here!"

Expand All @@ -36,7 +36,7 @@ workflows:
# Other jobs defined below extend this job.
- silta/drupal-build: &build
name: build
executor: cicd82
executor: silta
codebase-build:
- silta/drupal-composer-install
- silta/npm-install-build
Expand All @@ -56,7 +56,7 @@ workflows:
# Other jobs defined below extend this job.
- silta/drupal-deploy: &deploy
name: deploy
executor: cicd82
executor: silta
silta_config: silta/silta.yml,silta/silta.secret
pre-release:
- silta/decrypt-files:
Expand All @@ -65,6 +65,10 @@ workflows:
# This is stored in CircleCI as an environment variable and also in LastPass.
secret_key_env: SEC_DRUPAL_PROJECT_SILTA_DEV
context: silta_dev
# Make sure that `requires` is always set to override the default value in `main` and `production` build jobs.
# This is to avoid requiring the `approve-deployment` job which breaks the deployment.
# This is because the `main` and `production` environments are filtered out from the default `build` job.
# Use `requires: []` to override the default value when no other jobs are required.
requires:
- build
filters:
Expand Down
53 changes: 8 additions & 45 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,15 @@
# Link to ticket:
## Ticket QAG-XXX

[Add link to ticket] (if automatic linking is not used)
## Changes

# Changes proposed in this PR:
- [Explain what changes were made in this PR]

[Explain what was done and why. You can also add screenshots here if it helps.]
## Testing

# How to test
Enviroment: [Feature environment URL]

## Testing in feature environment:
Login: [`drush uli` command]

[Add link to feature environment]
https://[BRANCH-NAME].[PROJECT-NAME].dev.wdr.io/
Instructions:

[Add command how to get admin login url to the feature environment]
`ssh www-admin@[BRANCH-name]-shell.[PROJECT-NAME] -J [email protected] "drush uli"`

## Local testing

_Detail custom setup instructions if any - any drush commands, content reindexing, specific user to use, etc._

git fetch && git checkout <branch>
lando composer install
lando drush cim -y
lando drush cr

## Testing steps

_Testing scenario goes here._

1. Do this.
2. Go there.
3. Validate that xyz is working.

# Best practices:

<details>
<summary><h3>Accessibility:</h3></summary>
<p>
This project must support WCAG accessibility level AA <em>(edit this according to the requirements of your project)</em>. To ensure this standard is met, remember to:

- Perform automated checks using a tool such as Wave or SiteImprove.
- Test keyboard navigation: are all parts of the UI navigable using only the keyboard? Is the tab order logical? Can popups, menus etc be dismissed with the escape key?
- Test responsiveness, scaling and text reflow.
- Make sure no accessibility issues exist on either desktop or mobile views.
- If you have time, test with a screen reader such as VoiceOver (macOS), NVDA (Windows), or Orca (Linux).

Use the [Accessibility Testing Cheat Sheet](https://intra.wunder.io/info/accessibility-group/accessibility-testing-cheat-sheet) for information on how to run these tests.

</p>
</details>
- [Step by step instructions to test the changes]
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@

# Ignore node modules
node_modules

# Ignore Lando data volumes
/.lando/data-*
33 changes: 26 additions & 7 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: drupal-project
recipe: drupal10

config:
php: "8.2"
php: "8.3"
via: nginx
webroot: web
xdebug: off
Expand All @@ -15,6 +15,10 @@ tooling:
description: "Runs Composer commands"
cmd:
- appserver: /usr/local/bin/composer
drupal:
description: "Runs Drupal core script with provided arguments"
cmd:
- appserver: /app/.lando/drupal.sh
grumphp:
description: "Runs grumphp commands"
cmd:
Expand Down Expand Up @@ -71,6 +75,7 @@ services:
# Database credentials are defined in the .lando/.env file
# to be available in both the adminer and appserver containers.
DRUSH_OPTIONS_URI: https://drupal-project.lndo.site
SMTP_ADDRESS: mailpit:1025
ENVIRONMENT_NAME: lando
EXEC_GRUMPHP_COMMAND: "lando php"
HASH_SALT: notsosecurehash
Expand Down Expand Up @@ -125,10 +130,24 @@ services:
# user: kibana
# ports:
# - "5601:5601"
mailhog:
type: mailhog
hogfrom:
- appserver
mailpit:
type: lando
api: 3
ssl: true
sslExpose: false
services:
image: axllent/mailpit
volumes:
- .lando/data-mailpit:/data
ports:
- "8025" # Web UI
- "1025" # SMTP
environment:
MP_MAX_MESSAGES: 5000
MP_DATA_FILE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
command: "/mailpit"
node:
type: "node:20"
build:
Expand All @@ -148,8 +167,8 @@ services:
proxy:
adminer:
- adminer.drupal-project.lndo.site
mailhog:
- mail.lndo.site
mailpit:
- mail.lndo.site:8025
# elasticsearch:
# - elasticsearch.lndo.site:9200
# kibana:
Expand Down
9 changes: 9 additions & 0 deletions .lando/drupal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

## Description: run the Drupal core script with provided arguments
## Usage: drupal <arguments>
## Example: lando drupal generate-theme my-theme

cd ${LANDO_WEBROOT}

php core/scripts/drupal "$@"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See the section about DDEV below.
- Adminer: <http://adminer.drupal-project.lndo.site>
- Elasticsearch: <http://localhost:9200>, <http://elasticsearch.lndo.site>
- Kibana: <http://localhost:5601>, <http://kibana.lndo.site>
- Mailhog: <http://mail.lndo.site>
- Mailpit: <http://mail.lndo.site>
- Varnish: <https://varnish.drupal-project.lndo.site>
- Drush alias: `lando drush @local st`
- SSH: `lando ssh (-s <service>)`
Expand All @@ -56,13 +56,14 @@ See the section about DDEV below.
- `chrome` - uses [selenium/standalone-chrome](https://hub.docker.com/r/selenium/standalone-chrome/) image, uncomment the service definition at `.lando.yml` to enable.
- `elasticsearch` - uses official [Elasticsearch image](https://hub.docker.com/r/elastic/elasticsearch), uncomment the service definition at `.lando.yml` to enable. Requires [at least 4GiB of memory](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html).
- `kibana` - uses official [Kibana image](https://hub.docker.com/r/elastic/kibana), uncomment the service definition at `.lando.yml` to enable.
- `mailhog` - uses Lando [MailHog service](https://docs.lando.dev/mailhog/).
- `mailpit` - uses custom [Mailpit service](https://mailpit.axllent.org/).
- `node` - uses Lando [Node service](https://docs.lando.dev/node/).
- `varnish` - uses Lando [Varnish service](https://docs.lando.dev/varnish/), uncomment the service definition at `.lando.yml` to enable.

### [Tools](https://docs.lando.dev/core/v3/tooling.html)

- `lando` - tools / commands overview.
- `lando drupal <arguments>` - run the Drupal core script with provided arguments.
- `lando grumphp <commands>` - run [GrumPHP](https://github.com/phpro/grumphp) code quality checks. Modified or new files are checked on git commit, see more at `lando grumphp -h` or [wunderio/code-quality](https://github.com/wunderio/code-quality).
- `lando npm <commands>` - run [npm](https://www.npmjs.com/) commands.
- `lando phpunit <commands>` - run [PHPUnit](https://phpunit.de/) commands.
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
}
],
"require": {
"php": ">=8.2",
"composer/installers": "^2.2",
"php": ">=8.3",
"composer/installers": "^2.3",
"cweagans/composer-patches": "^1.7",
"drupal/admin_toolbar": "^3.4",
"drupal/core-composer-scaffold": "^10.2",
"drupal/core-recommended": "^10.2",
"drupal/admin_toolbar": "^3.5",
"drupal/core-composer-scaffold": "^10.3",
"drupal/core-recommended": "^10.3",
"drupal/monolog": "^3.0",
"drupal/purge": "^3.5",
"drupal/purge": "^3.6",
"drupal/simplei": "^2.1",
"drupal/varnish_purge": "^2.2",
"drush/drush": "^12.5",
"vlucas/phpdotenv": "^5.6",
"wunderio/drupal-ping": "^2.5"
},
"require-dev": {
"drupal/core-dev": "^10.2",
"drupal/core-dev": "^10.3",
"wunderio/code-quality": "^3.0"
},
"conflict": {
Expand All @@ -45,9 +45,10 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"koodimonni/composer-dropin-installer": true,
"php-http/discovery": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true,
"php-http/discovery": true
"tbachert/spi": true
},
"discard-changes": true,
"process-timeout": 0,
Expand Down
2 changes: 1 addition & 1 deletion silta/nginx.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile for the Nginx container.
FROM wunderio/silta-nginx:1.24-v1
FROM wunderio/silta-nginx:1.26-v1

COPY . /app/web
2 changes: 1 addition & 1 deletion silta/php.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile for the PHP container.
FROM wunderio/silta-php-fpm:8.2-fpm-v1
FROM wunderio/silta-php-fpm:8.3-fpm-v1

COPY --chown=www-data:www-data . /app

Expand Down
2 changes: 1 addition & 1 deletion silta/shell.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile for the Shell container.
FROM wunderio/silta-php-shell:php8.2-v1
FROM wunderio/silta-php-shell:php8.3-v1

COPY --chown=www-data:www-data . /app
3 changes: 3 additions & 0 deletions silta/silta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ referenceData:
# The name of the environment from which reference data will be copied.
referenceEnvironment: 'main'

mailhog:
enabled: true

mariadb:
master:
persistence:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Drupal\Tests\phpunit_example\Unit;

use Drupal\phpunit_example\AddClass;
// phpcs:ignore SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses
use Drupal\Tests\UnitTestCase;

/**
Expand Down
19 changes: 17 additions & 2 deletions web/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
$settings['config_sync_directory'] = '../config/sync';

// Load services definition file.
// Note: settings.silta.php defines Monolog services override via silta.services.yml.
// @see: https://github.com/wunderio/charts/blob/master/drupal/files/silta.services.yml
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/services.yml';

// The default list of directories that will be ignored by Drupal's file API.
Expand All @@ -42,13 +44,25 @@
$config['varnish_purger.settings.f94540554c']['port'] = '80';
}

// Symfony Mailer configuration.
// @see: https://www.drupal.org/node/3369935
$config['system.mail']['interface'] = [ 'default' => 'symfony_mailer' ];

// Default SMTP settings.
$smtp_address_parts = explode(':', getenv('SMTP_ADDRESS'));
if (!empty($smtp_address_parts[0]) && !empty($smtp_address_parts[1])) {
$config['system.mail']['mailer_dsn'] = [
'scheme' => 'smtp',
'host' => $smtp_address_parts[0],
'port' => $smtp_address_parts[1],
];
}

// Environment-specific settings.
$env = getenv('ENVIRONMENT_NAME');
switch ($env) {
case 'production':
$settings['simple_environment_indicator'] = 'DarkRed Production';
// Warden settings.
$config['warden.settings']['warden_token'] = getenv('WARDEN_TOKEN');
break;

case 'main':
Expand Down Expand Up @@ -96,6 +110,7 @@
}

// Silta cluster configuration overrides.
// @see: https://github.com/wunderio/charts/blob/master/drupal/files/settings.silta.php
if (getenv('SILTA_CLUSTER') && file_exists(DRUPAL_ROOT . '/sites/default/settings.silta.php')) {
include DRUPAL_ROOT . '/sites/default/settings.silta.php';
}

0 comments on commit ab11024

Please sign in to comment.