Skip to content

Commit 24d8d02

Browse files
authored
Merge pull request #25 from itk-dev/release/1.2.0
Release 1.2.0
2 parents 1fb59bb + 85c5772 commit 24d8d02

File tree

91 files changed

+5821
-3599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5821
-3599
lines changed

.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

.docker/templates/default.conf.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ server {
44

55
root ${NGINX_WEB_ROOT};
66

7+
client_max_body_size ${NGINX_MAX_BODY_SIZE};
8+
9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
714
location / {
815
# We are co-hosting with the legacy EventDB, so this app is hosted under '/api/v2/' (.env::APP_PATH_PREFIX)
916
# This is configured for Symfony in both 'api_platform.prefix' and 'framework.assets.base_path'. However

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is copied from config/symfony/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker.
2+
# Feel free to edit the file, but consider making a pull request if you find a general issue with the file.
3+
4+
# EditorConfig is awesome: https://editorconfig.org
5+
6+
# top-most EditorConfig file
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = LF
12+
indent_size = 4
13+
indent_style = space
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true
16+
17+
[*.{js,css,scss}]
18+
indent_size = 2
19+
20+
[*.{yml,yaml}]
21+
indent_size = 2
22+
23+
[config/**/*.{yml,yaml}]
24+
indent_size = 4

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
COMPOSE_PROJECT_NAME=event-database-api-2
1818
COMPOSE_DOMAIN=event-database-api.local.itkdev.dk
19+
ITKDEV_TEMPLATE=symfony-6
1920

2021
###> symfony/framework-bundle ###
2122
APP_ENV=dev
22-
APP_SECRET=01324d73757787ffeba5f2f76cec1a28
23+
APP_SECRET=
2324
###< symfony/framework-bundle ###
2425

2526
###> app ###

.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
###> symfony/framework-bundle ###
3+
APP_SECRET=4610ac31018b4685674121ea39d8a4c8
4+
###< symfony/framework-bundle ###

.env.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ APP_SECRET='$ecretf0rt3st'
44
SYMFONY_DEPRECATIONS_HELPER=999999
55
PANTHER_APP_ENV=panther
66
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
7+
8+
APP_API_KEYS='[
9+
{"username": "test_user", "apikey": "test_api_key"}
10+
]'

.github/workflows/api-spec.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
on:
2+
pull_request:
3+
4+
name: API Spec review
5+
6+
env:
7+
COMPOSE_USER: root
8+
9+
jobs:
10+
api-spec:
11+
runs-on: ubuntu-latest
12+
name: Ensure committed API specification is up to date
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 2
18+
19+
# https://taskfile.dev/installation/#github-actions
20+
- uses: go-task/setup-task@v1
21+
22+
- run: |
23+
docker network create frontend
24+
task --yes site:update
25+
26+
- name: Export API specification
27+
run: |
28+
task --yes api:spec:export
29+
30+
- name: Check for changes in specification
31+
id: git-diff-spec
32+
continue-on-error: true
33+
run: git diff --diff-filter=ACMRT --exit-code public/spec.yaml
34+
35+
- name: Comment PR
36+
if: steps.git-diff-spec.outcome == 'failure'
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
echo '## 🛑 Exported API specification file not up to date' > var/comment.md
41+
echo '' >> var/comment.md
42+
echo 'Please run `task api:spec:export` to export the API specification. Then commit and push the changes.' >> var/comment.md
43+
gh pr comment ${{ github.event.pull_request.number }} --body-file var/comment.md --create-if-none --edit-last
44+
45+
- name: Fail job api spec is not up to date
46+
if: steps.git-diff-spec.outcome == 'failure'
47+
run: |
48+
exit 1
49+
50+
detect-breaking-changes:
51+
name: Detect breaking changes in API specification
52+
runs-on: ubuntu-latest
53+
needs: [api-spec]
54+
steps:
55+
- name: Check out BASE rev
56+
uses: actions/checkout@v5
57+
with:
58+
ref: ${{ github.base_ref }}
59+
path: base
60+
61+
- name: Check out HEAD rev
62+
uses: actions/checkout@v5
63+
with:
64+
ref: ${{ github.head_ref }}
65+
path: head
66+
67+
- name: Run OpenAPI Changed (from HEAD rev)
68+
id: api-changed
69+
continue-on-error: true
70+
uses: docker://openapitools/openapi-diff:latest
71+
with:
72+
args: --fail-on-changed base/public/spec.yaml head/public/spec.yaml --markdown api-spec-changed.md
73+
74+
- name: Run OpenAPI Incompatible (from HEAD rev)
75+
id: api-incompatible
76+
continue-on-error: true
77+
uses: docker://openapitools/openapi-diff:latest
78+
with:
79+
args: --fail-on-incompatible base/public/spec.yaml head/public/spec.yaml --markdown api-spec-incompatible.md
80+
81+
- name: Comment PR with no changes
82+
if: steps.api-changed.outcome == 'success' && steps.api-incompatible.outcome == 'success'
83+
working-directory: head
84+
env:
85+
GH_TOKEN: ${{ github.token }}
86+
run: |
87+
gh pr comment ${{ github.event.pull_request.number }} --body "✅ **No changes detected in API specification**" --create-if-none --edit-last
88+
89+
- name: Comment PR with non-breaking changes
90+
if: steps.api-changed.outcome == 'failure' && steps.api-incompatible.outcome == 'success'
91+
working-directory: head
92+
env:
93+
GH_TOKEN: ${{ github.token }}
94+
run: |
95+
echo "## ⚠️ Non-Breaking changes detected in API specification" > ../comment.md
96+
echo "" >> ../comment.md
97+
cat ../api-spec-changed.md >> ../comment.md
98+
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
99+
100+
- name: Comment PR with breaking changes
101+
if: steps.api-incompatible.outcome == 'failure'
102+
working-directory: head
103+
env:
104+
GH_TOKEN: ${{ github.token }}
105+
run: |
106+
echo "## 🛑 Breaking changes detected in API specification" > ../comment.md
107+
echo "" >> ../comment.md
108+
cat ../api-spec-incompatible.md >> ../comment.md
109+
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
110+
111+
- name: Fail if breaking changes detected
112+
if: steps.api-incompatible.outcome == 'failure'
113+
run: |
114+
exit 1

.github/workflows/build_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
tags:
4-
- '*.*.*'
4+
- "*.*.*"
55

66
name: Create Github Release
77

@@ -16,7 +16,7 @@ jobs:
1616
APP_ENV: prod
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020

2121
- name: Composer install
2222
run: |

.github/workflows/changelog.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/changelog.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Changelog
6+
###
7+
### Checks that changelog has been updated
8+
9+
name: Changelog
10+
11+
on:
12+
pull_request:
13+
14+
jobs:
15+
changelog:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 2
24+
25+
- name: Git fetch
26+
run: git fetch
27+
28+
- name: Check that changelog has been updated.
29+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.github/workflows/composer.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/composer.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Composer
6+
###
7+
### Validates composer.json and checks that it's normalized.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
12+
### run inside the `phpfpm` service.
13+
### 2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
14+
### is a dev requirement in `composer.json`:
15+
###
16+
### ``` shell
17+
### docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
18+
### ```
19+
###
20+
### Normalize `composer.json` by running
21+
###
22+
### ``` shell
23+
### docker compose run --rm phpfpm composer normalize
24+
### ```
25+
26+
name: Composer
27+
28+
env:
29+
COMPOSE_USER: root
30+
31+
on:
32+
pull_request:
33+
push:
34+
branches:
35+
- main
36+
- develop
37+
38+
jobs:
39+
composer-validate:
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
steps:
44+
- uses: actions/checkout@v5
45+
46+
- name: Create docker network
47+
run: |
48+
docker network create frontend
49+
50+
- run: |
51+
docker compose run --rm phpfpm composer validate --strict
52+
53+
composer-normalized:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
steps:
58+
- uses: actions/checkout@v5
59+
60+
- name: Create docker network
61+
run: |
62+
docker network create frontend
63+
64+
- run: |
65+
docker compose run --rm phpfpm composer install
66+
docker compose run --rm phpfpm composer normalize --dry-run
67+
68+
composer-audit:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
fail-fast: false
72+
steps:
73+
- uses: actions/checkout@v5
74+
75+
- name: Create docker network
76+
run: |
77+
docker network create frontend
78+
79+
- run: |
80+
docker compose run --rm phpfpm composer audit

0 commit comments

Comments
 (0)