-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
upgrade recipe for patchlevel/event-sourcing 3.6 #1727
upgrade recipe for patchlevel/event-sourcing 3.6 #1727
Conversation
DavidBadura
commented
Dec 10, 2024
•
edited
Loading
edited
Q | A |
---|---|
License | MIT |
Packagist | https://packagist.org/packages/patchlevel/event-sourcing |
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. patchlevel/event-sourcing-bundle1.0 vs 1.2diff --git a/patchlevel/event-sourcing-bundle/1.0/config/packages/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/1.2/config/packages/patchlevel_event_sourcing.yaml
index 2f7f0824..c9d24221 100644
--- a/patchlevel/event-sourcing-bundle/1.0/config/packages/patchlevel_event_sourcing.yaml
+++ b/patchlevel/event-sourcing-bundle/1.2/config/packages/patchlevel_event_sourcing.yaml
@@ -1,3 +1,4 @@
patchlevel_event_sourcing:
+ aggregates_paths: '%kernel.project_dir%/src'
connection:
url: '%env(EVENTSTORE_URL)%' 1.2 vs 2.0diff --git a/patchlevel/event-sourcing-bundle/1.2/config/packages/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/2.0/config/packages/patchlevel_event_sourcing.yaml
index c9d24221..3460251c 100644
--- a/patchlevel/event-sourcing-bundle/1.2/config/packages/patchlevel_event_sourcing.yaml
+++ b/patchlevel/event-sourcing-bundle/2.0/config/packages/patchlevel_event_sourcing.yaml
@@ -1,4 +1,5 @@
patchlevel_event_sourcing:
- aggregates_paths: '%kernel.project_dir%/src'
+ aggregates: '%kernel.project_dir%/src'
+ events: '%kernel.project_dir%/src'
connection:
url: '%env(EVENTSTORE_URL)%' 2.0 vs 3.0diff --git a/patchlevel/event-sourcing-bundle/2.0/config/packages/dev/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/2.0/config/packages/dev/patchlevel_event_sourcing.yaml
deleted file mode 100644
index 8c7ccec8..00000000
--- a/patchlevel/event-sourcing-bundle/2.0/config/packages/dev/patchlevel_event_sourcing.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-patchlevel_event_sourcing:
- watch_server:
- enabled: true
diff --git a/patchlevel/event-sourcing-bundle/2.0/config/packages/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml
index 3460251c..961c9c4e 100644
--- a/patchlevel/event-sourcing-bundle/2.0/config/packages/patchlevel_event_sourcing.yaml
+++ b/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml
@@ -3,3 +3,19 @@ patchlevel_event_sourcing:
events: '%kernel.project_dir%/src'
connection:
url: '%env(EVENTSTORE_URL)%'
+
+when@dev:
+ patchlevel_event_sourcing:
+ subscription:
+ catch_up: true
+ throw_on_error: true
+ run_after_aggregate_save: true
+ rebuild_after_file_change: true
+ auto_setup: true
+
+when@test:
+ patchlevel_event_sourcing:
+ subscription:
+ catch_up: true
+ throw_on_error: true
+ run_after_aggregate_save: true
diff --git a/patchlevel/event-sourcing-bundle/2.0/manifest.json b/patchlevel/event-sourcing-bundle/3.0/manifest.json
index 763e21d9..7e41e9cb 100644
--- a/patchlevel/event-sourcing-bundle/2.0/manifest.json
+++ b/patchlevel/event-sourcing-bundle/3.0/manifest.json
@@ -8,8 +8,36 @@
"env": {
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
"#3": "",
- "#4": "EVENTSTORE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
- "#5": "EVENTSTORE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7\"",
- "EVENTSTORE_URL": "postgresql://symfony:[email protected]:5432/app?serverVersion=13&charset=utf8"
+ "#4": "EVENTSTORE_URL=\"pdo-sqlite:///%kernel.project_dir%/var/data.db\"",
+ "#5": "EVENTSTORE_URL=\"pdo-mysql://app:[email protected]:3306/app?serverVersion=8.2\"",
+ "EVENTSTORE_URL": "pdo-pgsql://app:[email protected]:5432/app?serverVersion=16&charset=utf8"
+ },
+ "dockerfile": [
+ "RUN install-php-extensions pdo_pgsql"
+ ],
+ "docker-compose": {
+ "docker-compose.yml": {
+ "services": [
+ "database:",
+ " image: postgres:${POSTGRES_VERSION:-16}-alpine",
+ " environment:",
+ " POSTGRES_DB: ${POSTGRES_DB:-app}",
+ " # You should definitely change the password in production",
+ " POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}",
+ " POSTGRES_USER: ${POSTGRES_USER:-app}",
+ " volumes:",
+ " - database_data:/var/lib/postgresql/data:rw",
+ " # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
+ " # - ./docker/db/data:/var/lib/postgresql/data:rw"
+ ],
+ "volumes": ["database_data:"]
+ },
+ "docker-compose.override.yml": {
+ "services": [
+ "database:",
+ " ports:",
+ " - \"5432\""
+ ]
+ }
}
}
diff --git a/patchlevel/event-sourcing-bundle/3.0/post-install.txt b/patchlevel/event-sourcing-bundle/3.0/post-install.txt
new file mode 100644
index 00000000..af47860c
--- /dev/null
+++ b/patchlevel/event-sourcing-bundle/3.0/post-install.txt
@@ -0,0 +1 @@
+ * Modify your EVENTSTORE_URL config in .env 3.0 vs 3.6diff --git a/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/3.6/config/packages/patchlevel_event_sourcing.yaml
index 961c9c4e..c5328f4a 100644
--- a/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml
+++ b/patchlevel/event-sourcing-bundle/3.6/config/packages/patchlevel_event_sourcing.yaml
@@ -3,6 +3,7 @@ patchlevel_event_sourcing:
events: '%kernel.project_dir%/src'
connection:
url: '%env(EVENTSTORE_URL)%'
+ provide_dedicated_connection: true
when@dev:
patchlevel_event_sourcing:
diff --git a/patchlevel/event-sourcing-bundle/3.0/manifest.json b/patchlevel/event-sourcing-bundle/3.6/manifest.json
index 7e41e9cb..5cb5b710 100644
--- a/patchlevel/event-sourcing-bundle/3.0/manifest.json
+++ b/patchlevel/event-sourcing-bundle/3.6/manifest.json
@@ -3,7 +3,8 @@
"Patchlevel\\EventSourcingBundle\\PatchlevelEventSourcingBundle": ["all"]
},
"copy-from-recipe": {
- "config/": "%CONFIG_DIR%/"
+ "config/": "%CONFIG_DIR%/",
+ "migrations/": "migrations/"
},
"env": {
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
@@ -18,7 +19,7 @@
"docker-compose": {
"docker-compose.yml": {
"services": [
- "database:",
+ "eventstore:",
" image: postgres:${POSTGRES_VERSION:-16}-alpine",
" environment:",
" POSTGRES_DB: ${POSTGRES_DB:-app}",
@@ -26,15 +27,15 @@
" POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}",
" POSTGRES_USER: ${POSTGRES_USER:-app}",
" volumes:",
- " - database_data:/var/lib/postgresql/data:rw",
+ " - eventstore_data:/var/lib/postgresql/data:rw",
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
" # - ./docker/db/data:/var/lib/postgresql/data:rw"
],
- "volumes": ["database_data:"]
+ "volumes": ["eventstore_data:"]
},
"docker-compose.override.yml": {
"services": [
- "database:",
+ "eventstore:",
" ports:",
" - \"5432\""
]
diff --git a/patchlevel/event-sourcing-bundle/3.6/migrations/.gitignore b/patchlevel/event-sourcing-bundle/3.6/migrations/.gitignore
new file mode 100644
index 00000000..e69de29b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request changes
is due migrations
dir.
Head branch was pushed to by a user without write access