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

[Maintenance] Configuration Reorganization #1029

Closed
wants to merge 8 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~

concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
Expand Down
15 changes: 0 additions & 15 deletions config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ imports:
parameters:
sylius_core.public_dir: '%kernel.project_dir%/public'

when@dev:
sylius_api:
enabled: true

sylius_addressing:
resources:
address:
Expand Down Expand Up @@ -258,14 +254,3 @@ sylius_user:
user:
classes:
model: App\Entity\User\UserOAuth

sylius_shop:
product_grid:
include_all_descendants: true

sylius_theme:
sources:
filesystem:
scan_depth: 1
directories:
- "%kernel.project_dir%/themes"
9 changes: 0 additions & 9 deletions config/packages/dev/monolog.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/dev/nelmio_alice.yaml

This file was deleted.

100 changes: 82 additions & 18 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,87 @@
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''

doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'

# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '16'

profiling_collect_backtrace: '%kernel.debug%'
use_savepoints: false
orm:
auto_generate_proxy_classes: '%kernel.debug%'
entity_managers:
default:
auto_mapping: true
mappings:
App:
is_bundle: false
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
auto_generate_proxy_classes: true
enable_lazy_ghost_objects: true
report_fields_where_declared: true
validate_xml_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
controller_resolver:
auto_mapping: false

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'

when@test_cached:
doctrine:
orm:
entity_managers:
default:
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider
services:
doctrine.result_cache_provider:
class: Doctrine\Common\Cache\Psr6\DoctrineProvider
public: false
factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Doctrine\Common\Cache\Psr6\DoctrineProvider
public: false
factory: [ 'Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap' ]
arguments:
- '@doctrine.system_cache_pool'
50 changes: 26 additions & 24 deletions config/packages/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@ monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

when@prod:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: php://stderr
formatter: monolog.formatter.json

when@dev:
monolog:
handlers:
Expand All @@ -23,7 +47,7 @@ when@dev:
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]

when@test:
when@test: &monolog_test
monolog:
handlers:
main:
Expand All @@ -36,26 +60,4 @@ when@test:
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

when@prod:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: php://stderr
formatter: monolog.formatter.json
when@test_cached: *monolog_test
4 changes: 2 additions & 2 deletions config/packages/nelmio_alice.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
when@dev: &dev
when@dev: &nelmio_alice_dev
nelmio_alice:
functions_blacklist:
- 'current'
Expand All @@ -9,4 +9,4 @@ when@dev: &dev
- 'md5'
- 'sha1'

when@test: *dev
when@test: *nelmio_alice_dev
11 changes: 0 additions & 11 deletions config/packages/nyholm_psr7.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/packages/payum.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions config/packages/prod/doctrine.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/packages/prod/monolog.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ security:
- { path: "%sylius.security.api_shop_account_regex%/.*", role: ROLE_USER }
- { path: "%sylius.security.api_shop_route%/customers/token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.api_shop_regex%/.*", role: PUBLIC_ACCESS }

when@test: &test
security:
password_hashers:
Sylius\Component\User\Model\UserInterface: plaintext

when@test_cached: *test
6 changes: 6 additions & 0 deletions config/packages/sylius_admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
when@test: &sylius_admin_test
sylius_admin:
notifications:
hub_enabled: false

when@test_cached: *sylius_admin_test
3 changes: 3 additions & 0 deletions config/packages/sylius_api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
when@dev:
sylius_api:
enabled: true
3 changes: 3 additions & 0 deletions config/packages/sylius_channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
when@test_cached:
sylius_channel:
debug: true
3 changes: 3 additions & 0 deletions config/packages/sylius_shop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sylius_shop:
product_grid:
include_all_descendants: true
13 changes: 13 additions & 0 deletions config/packages/sylius_theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sylius_theme:
sources:
filesystem:
scan_depth: 1
directories:
- "%kernel.project_dir%/themes"

when@test: &sylius_theme_test
sylius_theme:
sources:
test: ~

when@test_cached: *sylius_theme_test
6 changes: 6 additions & 0 deletions config/packages/sylius_uploader.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
when@test: &sylius_uploader_test
services:
sylius.generator.image_path:
class: Sylius\Behat\Service\Generator\UploadedImagePathGenerator

when@test_cached: *sylius_uploader_test
2 changes: 0 additions & 2 deletions config/packages/test/fidry_alice_data_fixtures.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions config/packages/test/monolog.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/packages/test/nelmio_alice.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions config/packages/test/security.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/test/sylius_admin.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/test/sylius_theme.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/test/sylius_uploader.yaml

This file was deleted.

Loading
Loading