Skip to content

Commit

Permalink
Merge branch '4.0' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed May 10, 2024
2 parents dfdb69a + b8e4349 commit 8ae4321
Show file tree
Hide file tree
Showing 82 changed files with 1,023 additions and 167 deletions.
20 changes: 5 additions & 15 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
# include mime.types;
# }

upstream php-pimcore10 {
server coreshop-4-php:9000;
}

upstream php-pimcore10-debug {
server coreshop-4-php-debug:9000;
upstream php-pimcore11 {
server coreshop4-php:9000;
}

server {
Expand Down Expand Up @@ -121,7 +117,6 @@ server {
#try_files $fastcgi_script_name =404;
# include fastcgi.conf if needed
include fastcgi_params;

# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
Expand All @@ -134,12 +129,7 @@ server {
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";

# If Xdebug session is requested, pass it to the Xdebug enabled container
if ($http_cookie ~* "XDEBUG_SESSION") {
fastcgi_pass php-pimcore10-debug;
}

fastcgi_pass php-pimcore10;
fastcgi_pass php-pimcore11;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this
Expand All @@ -155,10 +145,10 @@ server {
allow 127.0.0.1;
# add additional IP's or Ranges
deny all;
fastcgi_pass php-pimcore10;
fastcgi_pass php-pimcore11;
}
location /fpm-ping {
fastcgi_pass php-pimcore10;
fastcgi_pass php-pimcore11;
}
}
# nginx Status
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/behat_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ jobs:
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p ui

- name: Upload Behat logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Behat logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.pimcore }})"
path: etc/build/
if-no-files-found: ignore

- name: Upload Pimcore logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Pimcore logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.pimcore }})"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ docs/build
docs/node_modules
docs/.docusaurus
node_modules
docker-compose.override.yaml
7 changes: 7 additions & 0 deletions CHANGELOG-3.2.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 3.2.7
* Fix store mail and store order mail collection entry type by @kkarkus in https://github.com/coreshop/CoreShop/pull/2586
* [NoteService] implement deadlock retry strategy by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2588
* always set default unit quantity in gift product action by @solverat in https://github.com/coreshop/CoreShop/pull/2590
* [CoreBundle] fix PaymentWorkflow Listener to trigger state transition conditions by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2601
* [CoreBundle] fix CartTextProcessor priority and CartManagers setParent for cart-item by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2602

# 3.2.6
* [Tests] add test for stock tracked products in checkout by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2560
* [Tests] test only latest pimcore with highest deps for 3.2 by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2559
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG-4.0.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 4.0.5

* [Core] Pimcore 11.1 and 11.2 compatibility and psalm update by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2584
* [NoteService] implement deadlock retry strategy by @dpfaffenbauer in https://github.com/coreshop/CoreShop/pull/2588

# 4.0.4

* [Docs] Improve resource bundle docs a bit by @jdreesen in https://github.com/coreshop/CoreShop/pull/2554
Expand Down
95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,101 @@ your PR (if one is not already open), and your approach to solving it (not neces
* [Fork us!](https://help.github.com/articles/fork-a-repo/) Code! Follow the coding standards PSR-1 and PSR-2
* [Send a pull request](https://help.github.com/articles/using-pull-requests/) from your fork’s branch to our `master` branch.

## Set up local development environment
This guide outlines the steps to set up CoreShop for development on your local machine.
### Prerequisites:
* Docker Desktop: Ensure you have Docker Desktop installed and running on your system. You can find download and installation instructions for Windows, Mac and Linux here: https://docs.docker.com/desktop/ or
* OrbStack (macOS only): Ensure you have OrbStack installed on your system. You can find download and installation instructions here: https://orbstack.dev/

### Step 1: Build docker images
Navigate to the cloned CoreShop directory in your terminal, and run the following command to build the Docker images:

```shell
docker compose build --build-arg uid=$(id -u) --pull
```

### Step 2: Full Install
Run the following command to install Pimcore and CoreShop:
```shell
docker compose run --rm php bin/install
````

#### Step 3: Handle permissions
```shell
docker compose run --rm php chown www-data:www-data public/var/* var/*
```
For Linux Native systems we also need to execute:
```shell
sudo chown -R $(id -u):$(id -g)
```

### Manual Installation
Optionally you can run the single steps:

#### Step 1: Install Dependencies
Navigate to the cloned CoreShop directory in your terminal.

Run the following command to install all the required dependencies using Composer:
```shell
docker compose run --rm php composer install
```

#### Step 2: Install Pimcore
Run the following command to install Pimcore using the provided Docker image:
```shell
docker compose run --rm php vendor/bin/pimcore-install --no-interaction --ignore-existing-config
```

#### Step 3: Install CoreShop
Run the following command to install CoreShop:
```shell
docker compose run --rm php bin/console coreshop:install
```

#### Step 4: Install Demo Data (Optional)
CoreShop offers a demo dataset for testing purposes. To install the demo data, run the following command:
```shell
docker compose run --rm php bin/console coreshop:install:demo
```

## Running Code Analysis
CoreShop provides options for running code analysis tools like Psalm and PHPStan. These tools help identify potential errors and improve code quality.
Run the following command to execute Psalm within a Docker container:

```shell
docker compose run --rm php vendor/bin/psalm
```

Run the following command to run PHPStan with specific configuration options:
```shell
docker compose run --env SYMFONY_ENV=test --rm php vendor/bin/phpstan analyse -c phpstan.neon src -l 3 --memory-limit=-1
```

## Running Tests

Setup the behat container first by building the image and installing the dependencies:

```shell
docker compose build --build-arg behat
```

### BEHAT Domain

Run the following command to execute the domain tests:

```shell
docker compose run --rm behat vendor/bin/behat -c behat.yml.dist -p default
```

### BEHAT UI

UI tests require a running coreshop instance and a browser. Use the following command to run the UI tests
in a container:

```shell
docker compose run --rm behat
```

### Contributor License Agreement
The following terms are used throughout this agreement:

Expand Down
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM pimcore/pimcore:php8.2-debug-latest as dev
RUN set -eux; \
apt-get update; \
apt-get install -y $PHPIZE_DEPS libxslt1-dev; \
docker-php-ext-install xsl; \
sync; \
apt-get purge -y $PHPIZE_DEPS; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
ARG uid=1000
RUN usermod -u $uid www-data && chown -R www-data:www-data /var/www

FROM dev as behat
RUN apt update && \
apt install -y chromium chromium-driver

# Install Symfony, Pimcore and CoreShop inside Tests container
# RUN wget https://get.symfony.com/cli/installer -O - | bash
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash
RUN apt install symfony-cli

ENV PANTHER_NO_SANDBOX=1
ENV PANTHER_CHROME_ARGUMENTS='--disable-dev-shm-usage'
ENV CORESHOP_SKIP_DB_SETUP=1
ENV PANTHER_NO_HEADLESS=0
ENV APP_ENV="test"

6 changes: 6 additions & 0 deletions bin/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

composer install
vendor/bin/pimcore-install --no-interaction
bin/console coreshop:install
bin/console coreshop:install:demo
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"require": {
"php": "^8.0",
"ext-json": "*",
"dachcom-digital/emailizr": "^2.0 || ^3.0",
"dachcom-digital/emailizr": "^3.0",
"doctrine/data-fixtures": "^1.5",
"doctrine/doctrine-bundle": "^2.4",
"doctrine/doctrine-fixtures-bundle": "^3.4",
Expand Down Expand Up @@ -139,7 +139,8 @@
"vimeo/psalm": "^5.23"
},
"conflict": {
"jms/serializer-bundle": "4.1.0"
"jms/serializer-bundle": "4.1.0",
"twig/twig": "^3.9.0"
},
"suggest": {
"dpfaffenbauer/process-manager": "Allows to start Processes from within Pimcore UI and also tracks the status."
Expand Down
121 changes: 72 additions & 49 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,99 @@
version: '3.4'
name: 'coreshop-4'

networks:
cors_dev:
external: true
coreshop_4:
external: false
x-php: &php
volumes:
- .:/var/www/html
# Reset xdebug configuration to default
- /dev/null:/usr/local/etc/php/conf.d/20-xdebug.ini:ro
environment:
PHP_IDE_CONFIG: serverName=localhost
# Enable step debugging and development helpers by default.
# `debug`-mode in conjuction with `trigger` (default) in `xdebug.start_with_request` enables step-debugging
# only if a "trigger" (i.e. `XDEBUG_TRIGGER`) is present. Refer to
# [start_with_request](https://xdebug.org/docs/all_settings#start_with_request) documentation of how to trigger
# step debugging with `trigger`.
# To configure PhpStorm for step-debugging with xdebug see: https://www.jetbrains.com/help/phpstorm/2021.3/zero-configuration-debugging.html#start-debugging-session
# See: https://xdebug.org/docs/all_settings#mode
XDEBUG_MODE: debug
# This forces xdebug to always connect to the debug client running on docker host (host.docker.internal).
# It will work without further configuration with [Docker Desktop](https://www.docker.com/products/docker-desktop).
# See: https://xdebug.org/docs/all_settings#client_host
XDEBUG_CONFIG: client_host=host.docker.internal
COMPOSER_HOME: /var/www/html
PIMCORE_DB_DSN: "mysql://pimcore:pimcore@db:3306/pimcore"
PIMCORE_INSTALL_ADMIN_USERNAME: "admin"
PIMCORE_INSTALL_ADMIN_PASSWORD: "admin"
PIMCORE_INSTALL_MYSQL_HOST_SOCKET: "db"
PIMCORE_INSTALL_MYSQL_USERNAME: "pimcore"
PIMCORE_INSTALL_MYSQL_PASSWORD: "pimcore"
PIMCORE_INSTALL_MYSQL_DATABASE: "pimcore"
PIMCORE_INSTALL_MYSQL_PORT: "3306"
PIMCORE_INSTALL_INSTALL_BUNDLES: "PimcoreApplicationLoggerBundle,PimcoreCustomReportsBundle,PimcoreGlossaryBundle,PimcoreSeoBundle,PimcoreSimpleBackendSearchBundle,PimcoreStaticRoutesBundle,PimcoreTinymceBundle,PimcoreUuidBundle,PimcoreWordExportBundle,PimcoreXliffBundle"
extra_hosts:
- "host.docker.internal:host-gateway"

services:
db:
image: mysql:8
container_name: coreshop-4
networks:
- cors_dev
- coreshop_4
container_name: coreshop4-db
image: mariadb:10.5
working_dir: /application
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_general_ci]
ports:
- "3306:3306"
command: [ mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_general_ci ]
volumes:
- coreshop-4:/var/lib/mysql
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=ROOT
- MYSQL_DATABASE=pimcore
- MYSQL_USER=pimcore
- MYSQL_PASSWORD=pimcore
expose:
- "3306"

nginx:
container_name: coreshop4-nginx
image: nginx:stable-alpine
container_name: coreshop-4-nginx
volumes:
- .:/var/www/html:cached
- ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- .:/var/www/html
- ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
- php-debug
networks:
- cors_dev
- coreshop_4
labels:
- traefik.enable=true
- traefik.http.routers.coreshop_4.rule=Host(`coreshop-4.localhost`)
- traefik.http.routers.coreshop_4.entrypoints=cors_dev
- traefik.http.routers.coreshop_4.tls=true
- traefik.http.services.coreshop_4.loadbalancer.server.port=80
- traefik.docker.network=cors_dev
ports:
- "80:80"

php:
image: pimcore/pimcore:php8.2-latest
container_name: coreshop-4-php
networks:
- coreshop_4
environment:
COMPOSER_HOME: /var/www/html
<<: *php
container_name: coreshop4-php
image: coreshop/coreshop:PHP8.1-fpm-debug
build:
target: dev
args:
uid: ${USER_ID:-1000}
depends_on:
- db
volumes:
- .:/var/www/html:cached

php-debug:
image: pimcore/pimcore:php8.2-debug-latest
container_name: coreshop-4-php-debug
networks:
- coreshop_4
behat:
<<: *php
container_name: coreshop4-behat
image: coreshop/coreshop:PHP8.1-fpm-debug-behat
build:
target: behat
args:
uid: ${USER_ID:-1000}
profiles:
- behat
depends_on:
- db
volumes:
- .:/var/www/html:cached
environment:
PHP_IDE_CONFIG: serverName=localhost
XDEBUG_TRIGGER: PHPSTORM
COMPOSER_HOME: /var/www/html
XDEBUG_HOST: 198.19.248.254
PIMCORE_TEST_DB_DSN: "mysql://pimcore:pimcore@db:3306/pimcore"
PIMCORE_KERNEL_CLASS: 'Kernel'
PIMCORE_CLASS_DIRECTORY: 'var/tmp/behat/var/classes'
command:
- bash
- -c
- |
set -e;
vendor/bin/bdi detect drivers;
symfony server:start --port=9080 --dir=public --no-tls -d;
CORESHOP_SKIP_DB_SETUP=1 PANTHER_EXTERNAL_BASE_URI=http://127.0.0.1:9080/index_test.php PANTHER_NO_HEADLESS=0 php -d memory_limit=-1 vendor/bin/behat -c behat.yml.dist -p ui
volumes:
coreshop-4:
db:

0 comments on commit 8ae4321

Please sign in to comment.