Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 0 additions & 19 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@ jobs:
run: |
task --yes api:test

coding-standards-yaml:
name: Coding standards YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# https://taskfile.dev/installation/#github-actions
- uses: arduino/setup-task@v2

- run: |
docker network create frontend

- name: Check YAML coding standards
run: |
task --yes coding-standards:yaml:check

- name: Check that nothing has changed
run: git diff --exit-code

code-analysis-phpstan:
runs-on: ubuntu-latest
name: PHPStan static analysis
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/symfony/yaml.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### Symfony YAML
###
### Validates Symfony YAML files.
###
### #### Assumptions
###
### 1. A docker compose service named `prettier` for running
### [Prettier](https://prettier.io/) exists.

name: YAML

on:
pull_request:
push:
branches:
- main
- develop

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: |
docker network create frontend

- run: |
docker compose run --rm prettier '.github/workflows/*.{yml,yaml}' 'config/**/*.{yml,yaml}' --check
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log.

## [Unreleased]

- [PR-21](https://github.com/itk-dev/event-database-api/pull/21)
Linted YAML
- [PR-18](https://github.com/itk-dev/event-database-api/pull/18)
- Updated docker compose setup
- Added simple API tests and resolved some deprecations
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vars:
DOCKER_COMPOSE: '{{.TASK_DOCKER_COMPOSE | default "docker compose"}}'

# We're not yet ready to normalize config files …
YAML_FILES_GLOB: "Taskfile.yml .github/workflows/**.{yml,yaml} phpstan.dist.neon"
YAML_FILES_GLOB: "'.github/workflows/*.{yml,yaml}' 'config/**/*.{yml,yaml}' Taskfile.yml phpstan.dist.neon"

tasks:
site:update:
Expand Down
114 changes: 57 additions & 57 deletions config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
api_platform:
title: '%env(OPENAPI_TITLE)%'
description: '%env(OPENAPI_DESCRIPTION)%'
version: 2.0.0
show_webby: false

openapi:
contact:
name: '%env(OPENAPI_CONTACT_NAME)%'
url: '%env(OPENAPI_CONTACT_URL)%'
email: '%env(OPENAPI_CONTACT_EMAIL)%'
termsOfService: '%env(OPENAPI_TERMS_OF_SERVICE)%'

formats:
jsonld: ['application/ld+json']

docs_formats:
jsonld: ['application/ld+json']
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']

mapping:
paths:
- '%kernel.project_dir%/src/Api/Dto'

doctrine:
enabled: false

swagger:
api_keys:
ApiKeyAuth:
name: 'X-Api-Key'
type: header

elasticsearch:
hosts: ['%env(INDEX_URL)%']

defaults:
stateless: true
pagination_items_per_page: '%env(int:PAGINATION_ITEMS_PER_PAGE)%'
pagination_maximum_items_per_page: '%env(int:PAGINATION_MAXIMUM_ITEMS_PER_PAGE)%'
cache_headers:
max_age: 3600
shared_max_age: 3600
vary: ['Content-Type', 'Authorization', 'Origin']
extra_properties:
# Note: The api-platform/core 3.4 recipe sets `standard_put` eventhough
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
# (probably) tells us to remove it
# standard_put: true
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
rfc_7807_compliant_errors: true
# Note: The api-platform/core 3.4 recipe wants `use_symfony_listeners` to be true
use_symfony_listeners: false

# https://api-platform.com/docs/core/upgrade-guide/#upgrade-guide
serializer:
hydra_prefix: true
title: "%env(OPENAPI_TITLE)%"
description: "%env(OPENAPI_DESCRIPTION)%"
version: 2.0.0
show_webby: false

openapi:
contact:
name: "%env(OPENAPI_CONTACT_NAME)%"
url: "%env(OPENAPI_CONTACT_URL)%"
email: "%env(OPENAPI_CONTACT_EMAIL)%"
termsOfService: "%env(OPENAPI_TERMS_OF_SERVICE)%"

formats:
jsonld: ["application/ld+json"]

docs_formats:
jsonld: ["application/ld+json"]
jsonopenapi: ["application/vnd.openapi+json"]
html: ["text/html"]

mapping:
paths:
- "%kernel.project_dir%/src/Api/Dto"

doctrine:
enabled: false

swagger:
api_keys:
ApiKeyAuth:
name: "X-Api-Key"
type: header

elasticsearch:
hosts: ["%env(INDEX_URL)%"]

defaults:
stateless: true
pagination_items_per_page: "%env(int:PAGINATION_ITEMS_PER_PAGE)%"
pagination_maximum_items_per_page: "%env(int:PAGINATION_MAXIMUM_ITEMS_PER_PAGE)%"
cache_headers:
max_age: 3600
shared_max_age: 3600
vary: ["Content-Type", "Authorization", "Origin"]
extra_properties:
# Note: The api-platform/core 3.4 recipe sets `standard_put` eventhough
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
# (probably) tells us to remove it
# standard_put: true
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
rfc_7807_compliant_errors: true
# Note: The api-platform/core 3.4 recipe wants `use_symfony_listeners` to be true
use_symfony_listeners: false

# https://api-platform.com/docs/core/upgrade-guide/#upgrade-guide
serializer:
hydra_prefix: true
28 changes: 14 additions & 14 deletions config/packages/cache.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name

# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:

# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost

# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu

# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
40 changes: 20 additions & 20 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
annotations: false
http_method_override: false
handle_all_throwables: true
secret: "%env(APP_SECRET)%"
annotations: false
http_method_override: false
handle_all_throwables: true

# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax

#esi: true
#fragments: true
php_errors:
log: true
#esi: true
#fragments: true
php_errors:
log: true

assets:
base_path: '%env(APP_PATH_PREFIX)%'
assets:
base_path: "%env(APP_PATH_PREFIX)%"

when@test:
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file
16 changes: 8 additions & 8 deletions config/packages/http_discovery.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\RequestFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\ResponseFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\ServerRequestFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\StreamFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\UploadedFileFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\UriFactoryInterface: "@http_discovery.psr17_factory"

http_discovery.psr17_factory:
class: Http\Discovery\Psr17Factory
http_discovery.psr17_factory:
class: Http\Discovery\Psr17Factory
18 changes: 9 additions & 9 deletions config/packages/nelmio_cors.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS']
allow_headers: ['Content-Type', 'X-Api-Key']
expose_headers: ['Link']
max_age: 3600
paths:
'^/': null
defaults:
origin_regex: true
allow_origin: ["%env(CORS_ALLOW_ORIGIN)%"]
allow_methods: ["GET", "OPTIONS"]
allow_headers: ["Content-Type", "X-Api-Key"]
expose_headers: ["Link"]
max_age: 3600
paths:
"^/": null
16 changes: 8 additions & 8 deletions config/packages/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
framework:
router:
utf8: true
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost

when@prod:
framework:
router:
strict_requirements: null
framework:
router:
strict_requirements: null
Loading