Skip to content

Commit

Permalink
Merge pull request #324 from City-of-Helsinki/dev
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
juho-lehmonen authored Nov 23, 2023
2 parents cdb5aad + f11d31f commit 243a54b
Show file tree
Hide file tree
Showing 1,603 changed files with 20,588 additions and 14,193 deletions.
11 changes: 9 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ PROJECT_NAME=paatokset
# OpenShift project name
OC_PROJECT_NAME=hki-kanslia-paatokset-test

# Stage file proxy origin url and folder
STAGE_FILE_PROXY_ORIGIN=https://paatokset.hel.fi
STAGE_FILE_PROXY_ORIGIN_DIR=sites/default/files

# Local hostname
DRUPAL_HOSTNAME=helsinki-paatokset.docker.so

# Docker image
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.1
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.2

# Composer profiles, include Elasticsearch
COMPOSE_PROFILES=search

# Default source @alias where to sync database and files from
DRUPAL_SYNC_SOURCE=main

# Public webroot
DRUPAL_WEBROOT=public

# No prod environment yet, so don't sync files
# Do not sync files
DRUPAL_SYNC_FILES=no
15 changes: 13 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [PP-000](https://helsinkisolutionoffice.atlassian.net/browse/PP-000)
# [UHF-0000](https://helsinkisolutionoffice.atlassian.net/browse/UHF-0000)
<!-- What problem does this solve? -->

## What was done
Expand All @@ -9,7 +9,7 @@
## How to install

* Make sure your instance is up and running on correct branch.
* `git checkout PP-000-insert_correct_branch`
* `git checkout UHF-0000_insert_correct_branch`
* `make fresh`
* Run `make drush-cr`

Expand All @@ -18,3 +18,14 @@

* [ ] Check that this feature works
* [ ] Check that code follows our standards

## Designers review
<!-- One of the checkboxes below needs to be checked like this: `[x]` (or click when not in edit mode) -->

* [ ] This PR does not need designers review
* [ ] This PR has been visually reviewed by a designer (Name of the designer)

## Other PRs
<!-- For example an related PR in another repository -->

* Link to other PR
9 changes: 2 additions & 7 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ on:
schedule:
- cron: '0 0 * * 0'
name: Build artifacts
env:
DRUPAL_BUILD_FROM_SCRATCH: true
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
XDEBUG_MODE: off
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine

services:
db:
Expand All @@ -33,7 +28,7 @@ jobs:
fetch-depth: 1

- name: Build project
run: composer install
run: composer install --no-interaction

- name: Setup drupal and save database dump
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/auto-release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- develop
- dev
name: Automatic release PR
jobs:
release-pr:
Expand All @@ -14,8 +14,8 @@ jobs:
run: |
gh pr create \
--base main \
--head develop \
--title "Develop to main" \
--body "Develop to main" || true
--head dev \
--title "Dev to main" \
--body "Dev to main" || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on:
branches: ['main', 'dev']
name: CI
env:
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
SYMFONY_DEPRECATIONS_HELPER: disabled
XDEBUG_MODE: off
SIMPLETEST_BASE_URL: http://app:8888
jobs:
tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine
options: --hostname app

services:
db:
Expand All @@ -31,10 +30,10 @@ jobs:
fetch-depth: 1

- name: Build project
run: composer install
run: composer install --no-interaction

- name: Scan security updates
run: drush pm:security
run: composer audit

- name: Check that subtheme is not built with dev mode
run: if grep -q 'sourceMappingURL=' -R public/themes/custom/hdbt_subtheme/dist/css; then exit 1; fi
Expand All @@ -52,20 +51,17 @@ jobs:
- name: Install Drupal
run: |
mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql
drush cr && drush cim -y
drush deploy
- name: Start services
run: |
drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
chromedriver --port=4444 > /dev/null 2>&1 &
# Chromium browser is required to run 'functional-javascript' and
# 'existing-site-javascript' tests.
chromium-browser --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 &
drush runserver $SIMPLETEST_BASE_URL --dns > /dev/null 2>&1 &
# Wait for drush server to start.
for i in {1..5}; do RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done
- name: Run PHPUnit tests
run: |
composer test-php public/modules/custom
[ -d "tests/" ] && composer test-php tests/ || echo "No DTT tests found. Ignoring..."
if [ -d "tests/" ]; then composer test-php tests/; else echo "No DTT tests found. Ignoring..."; fi
12 changes: 4 additions & 8 deletions .github/workflows/update-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ on:
repository_dispatch:
types: [config_change]
name: Update config
env:
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
XDEBUG_MODE: off
jobs:
update-config:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine

services:
db:
Expand All @@ -37,10 +33,10 @@ jobs:
- name: Build project
run: |
composer install
composer install --no-interaction
$(drush sql:connect) < latest.sql
drush cr && drush cim -y
composer update drupal/helfi_* drupal/hdbt* -W
drush cim -y && drush updb -y && drush cr
composer update drupal/helfi_* drupal/hdbt* -W --no-interaction
drush cr && drush updb -y && drush cex -y
# Update platform
drush helfi:tools:update-platform
Expand Down
18 changes: 5 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@
drush/sites/
drush/Commands/*
node_modules
public/public:/
public/core
public/libraries
public/modules/contrib
public/modules/custom/paatokset_search/assets
public/themes/contrib
public/sites/default/files
vendor

# Ignore files that are only for the current local environment
public/sites/default/local.settings.php
public/sites/default/local.services.yml
.env.local
helfi-test-automation-python/
public/sites/simpletest/

# Ignore the folder created by PhpStorm
.idea/*
public/sites/default/local.settings.php

# Ignore test related files
.phpunit.*
helfi-test-automation-python/
public/sites/simpletest/

# Ignore local database dumps
*.sql
*.env.local

# Ignore OSX generated files
._*
.DS_Store

!*.gitkeep
!*.keepme
.phpunit.*
1 change: 1 addition & 0 deletions .platform/schema
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Drupal 9 Website for the Helsinki Päätökset project.

Env | Branch | Drush alias | URL | Notes
--- | ------ | ----------- | --- | -----
development | * | - | http://helsinki-paatokset.docker.so/ | Local development environment
dev | * | - | http://helsinki-paatokset.docker.so/ | Local development environment
production | tag based | - | https://paatokset.hel.fi | Production environment

## Requirements
Expand Down Expand Up @@ -146,11 +146,11 @@ Additional information can be added in a multiline message, where the first line
### Gitflow workflow
The Gitflow workflow is followed, with the following conventions:

**Main branch**: `develop`. All feature branches are created from `develop` and merged back with pull requests. All new code must be added with pull requests, not committed directly.
**Main branch**: `dev`. All feature branches are created from `dev` and merged back with pull requests. All new code must be added with pull requests, not committed directly.

**Feature branches**: For example, `PP-123-add-search-functionality`, Always created from and merged back to `develop` with pull requests after code review and testing. Should contain the Jira ticket ID or `PP-0` if a ticket doesn't exist.
**Feature branches**: For example, `PP-123-add-search-functionality`, Always created from and merged back to `dev` with pull requests after code review and testing. Should contain the Jira ticket ID or `PP-0` if a ticket doesn't exist.

**Release tags**: Code for future releases. For example: `release/1.1.0`. These tags should be created as Github releases so we can get full release not. Deploying releases happens manually in Azure.
**Release tags**: Code for future releases. For example: `2023-11-08.1`. These tags should be created as Github releases so we can get full release not. Deploying releases happens manually in Azure.

### Pull requests
The pull request should contain:
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trigger:
batch: true
branches:
include:
- develop
- dev
paths:
exclude:
- README.md
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pr:
branches:
include:
- main
- develop
- dev

# By default, use self-hosted agents
pool: Default
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
trigger:
branches:
include:
- develop
- dev
paths:
exclude:
- README.md
Expand Down
26 changes: 15 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"drupal/big_pipe_sessionless": "^2.0",
"drupal/core": "^9.5",
"drupal/core-composer-scaffold": "^9.1",
"drupal/hdbt": "4.3.4",
"drupal/hdbt_admin": "^1.8.6",
"drupal/hdbt": "^5.0",
"drupal/hdbt_admin": "^2.0",
"drupal/helfi_api_base": "^2.5.3",
"drupal/helfi_drupal_tools": "dev-main",
"drupal/helfi_platform_config": "2.18.7",
"drupal/helfi_platform_config": "^3.0",
"drupal/helfi_tpr": "^2.0.5",
"drupal/helfi_tunnistamo": "^2.0",
"drupal/json_field": "^1.0@RC",
Expand All @@ -25,23 +25,24 @@
"drupal/purge": "^3.0",
"drupal/search_api": "^1.20",
"drupal/varnish_purge": "^2.1",
"drush/drush": "^10.4",
"drush/drush": "^11",
"elasticsearch/elasticsearch": "^7.15",
"josdejong/jsoneditor": "^5.29",
"league/csv": "^9.8",
"paatokset/paatokset_search": "1.0.27"
"paatokset/paatokset_search": "1.0.29"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"dmore/chrome-mink-driver": "^2.8",
"drupal/coder": "^8.3",
"drupal/core-dev": "^9.3",
"drupal/migrate_tools": "^5.2",
"mglaman/phpstan-drupal": "^1.0",
"jangregor/phpstan-prophecy": "^1.0",
"mglaman/phpstan-drupal": "^1.2",
"phpspec/prophecy-phpunit": "^2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.6",
"weitzman/drupal-test-traits": "^2.0"
},
Expand All @@ -57,6 +58,9 @@
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"phpstan/extension-installer": true
},
"audit": {
"abandoned": "report"
}
},
"extra": {
Expand Down Expand Up @@ -135,9 +139,9 @@
"type": "package",
"package": {
"name": "paatokset/paatokset_search",
"version": "1.0.27",
"version": "1.0.29",
"dist": {
"url": "https://github.com/City-of-Helsinki/paatokset-search/releases/download/1.0.27/paatokset_search.zip",
"url": "https://github.com/City-of-Helsinki/paatokset-search/releases/download/1.0.29/paatokset_search.zip",
"type": "zip"
}
}
Expand Down
Loading

0 comments on commit 243a54b

Please sign in to comment.