Skip to content

Commit

Permalink
Merge branch '4.6' into 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
glye committed Nov 28, 2024
2 parents da5710e + 1bf4267 commit dcd6b7a
Show file tree
Hide file tree
Showing 75 changed files with 491 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
- [ ] Provided PR description.
- [ ] Tested the solution manually.
- [ ] Provided automated test coverage.
- [ ] Checked that target branch is set correctly (master for features, the oldest supported for bugs).
- [ ] Checked that target branch is set correctly (`main` for features, the oldest supported for bugs).
- [ ] Ran PHP CS Fixer for new PHP code (use `$ composer fix-cs`).
- [ ] Asked for a review (ping `@ibexa/engineering`).
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pr-assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Assign Pull Request to maintainers

on:
pull_request_target:

jobs:
assign:
uses: ibexa/gh-workflows/.github/workflows/pr-assign.yml@main
secrets:
robot-token: ${{ secrets.EZROBOT_PAT }}
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Automatic Changelog Generator for tag

on:
push:
tags:
- 'v*'
- '!v*-alpha*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set Environment
run: |
echo "BUILD_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Get previous release tag based on type
id: prevrelease
uses: ibexa/version-logic-action@master
with:
currentTag: ${{ env.BUILD_TAG }}

- name: Generate changelog
id: changelog
uses: ibexa/changelog-generator-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
jira_token: ${{ secrets.JIRA_TOKEN }}
currentTag: ${{ env.BUILD_TAG }}
previousTag: ${{ steps.prevrelease.outputs.previousTag }}

- name: Print the changelog
run: echo "${{ steps.changelog.outputs.changelog }}"

- name: Create Release
id: create_release
uses: zendesk/action-create-release@v1
with:
tag_name: ${{ env.BUILD_TAG }}
body: |
${{ steps.changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

10 changes: 10 additions & 0 deletions .github/workflows/upmerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Upmerge (caller)

on:
push:

jobs:
merge:
uses: ibexa/gh-workflows/.github/workflows/upmerge.yml@main
secrets:
robot-token: ${{ secrets.EZROBOT_PAT }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/vendor/
composer.lock
/components/
.php_cs.cache
.php-cs-fixer.cache
27 changes: 27 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in(
array_filter([
__DIR__ . '/src',
__DIR__ . '/tests',
], 'is_dir')
)
->files()->name('*.php')
);
15 changes: 0 additions & 15 deletions .php_cs

This file was deleted.

2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

This source code is available separately under the following licenses:

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

This source code is available separately under the following licenses:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Ibexa Post Install Tool

## COPYRIGHT

Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

## LICENSE

Expand Down
28 changes: 16 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,45 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"composer-plugin-api": "^2.0",
"composer/semver": "^3.2"
},
"require-dev": {
"composer/composer": "^2.0.8",
"phpstan/phpstan": "0.12.92",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpstan/phpstan-webmozart-assert": "^0.12.7",
"phpstan/phpstan": "^1",
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-webmozart-assert": "^1",
"symfony/console": "^5.2",
"symfony/dotenv": "^5.2",
"symfony/finder": "^5.2",
"symfony/filesystem": "^5.2",
"symfony/phpunit-bridge": "^5.2",
"symfony/process": "^5.2",
"ezsystems/ezplatform-code-style": "^0.2.0"
"ibexa/code-style": "^1.0"
},
"autoload": {
"psr-4": {
"Ibexa\\PostInstall\\": "src/lib/",
"Ibexa\\Platform\\PostInstall\\": "src/lib/"
}
},
"autoload-dev": {
"psr-4": {
"Ibexa\\Tests\\PostInstall\\": "tests/lib/",
"Ibexa\\Platform\\Tests\\PostInstall\\": "tests/lib/"
}
},
"scripts": {
"fix-cs": "php-cs-fixer fix -v --config=.php_cs --show-progress=estimating",
"fix-cs-changed": "php-cs-fixer fix -v --config=.php_cs --show-progress=estimating $(git diff ${GIT_DIFF_BASE:-origin/main} --diff-filter=ACMR --name-only \"*.php\"|paste -sd ' ')",
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"fix-cs-changed": "php-cs-fixer fix --config=.php_cs -v --show-progress=dots $(git diff ${GIT_DIFF_BASE:-origin/main} --diff-filter=ACMR --name-only \"*.php\"|paste -sd ' ')",
"test": "phpunit -c phpunit.xml",
"phpstan": "phpstan analyse -c phpstan.neon",
"check-cs-changed": "php-cs-fixer fix -v --diff --config=.php_cs --dry-run --show-progress=estimating $(git diff ${GIT_DIFF_BASE:-origin/main} --diff-filter=ACMR --name-only \"*.php\"|paste -sd ' ')",
"check-cs": "php-cs-fixer fix -v --diff --config=.php_cs --dry-run --show-progress=estimating"
"check-cs-changed": "php-cs-fixer fix --diff --config=.php-cs-fixer.php --dry-run -v --show-progress=dots $(git diff ${GIT_DIFF_BASE:-origin/main} --diff-filter=ACMR --name-only \"*.php\"|paste -sd ' ')",
"check-cs": "php-cs-fixer fix --diff --config=.php-cs-fixer.php --dry-run -v --show-progress=dots"
},
"scripts-descriptions": {
"fix-cs": "Automatically fixes code style in all files",
"fix-cs": "Fix Coding standard issues in current checkout.",
"fix-cs-changed": "Automatically fixes code style in changed files only, compared to branch in GIT_DIFF_BASE env variable, defaults to origin/main",
"test": "Run automatic tests",
"phpstan": "Run static code analysis",
Expand All @@ -56,8 +60,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
"dev-main": "4.6.x-dev"
},
"class": "Ibexa\\Platform\\PostInstall\\PostInstall"
"class": "Ibexa\\PostInstall\\PostInstall"
}
}
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ includes:
- phpstan-baseline.neon

parameters:
level: max
level: 8
paths:
- src
1 change: 1 addition & 0 deletions resources/platformsh/common/4.6/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.19.0
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rediscache:
# type: elasticsearch:7.7
# disk: 512

# Due to logic in EzSystems\EzPlatformCoreBundle\DependencyInjection\EzPlatformCoreExtension, do not change the service name to something different from 'varnish'
# Due to logic in app/config/env/platformsh.php, do not change the service name to something different than 'varnish'
varnish:
type: 'varnish:6.0'
relationships:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sub vcl_recv {
set req.http.cookie = ";" + req.http.cookie;
set req.http.cookie = regsuball(req.http.cookie, "; +", ";");
set req.http.cookie = regsuball(req.http.cookie, ";(eZSESSID[^=]*)=", "; \1=");
set req.http.cookie = regsuball(req.http.cookie, ";(ibexa-[^=]*)=", "; \1=");
set req.http.cookie = regsuball(req.http.cookie, ";[^ ][^;]*", "");
set req.http.cookie = regsuball(req.http.cookie, "^[; ]+|[; ]+$", "");

Expand Down Expand Up @@ -257,7 +258,7 @@ sub ez_invalidate_token {
set req.http.x-fos-token-url = req.url;
set req.http.x-fos-token-method = req.method;

set req.url = "/_ez_http_invalidatetoken";
set req.url = "/_ibexa_http_invalidatetoken";

// Force the lookup
return (hash);
Expand Down
2 changes: 2 additions & 0 deletions resources/platformsh/common/4.6/config/packages/http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
framework:
trusted_proxies: '%env(TRUSTED_PROXIES)%'
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# This file describes an application. You can have multiple applications
# in the same project.

# Please see doc/platformsh/README.md and doc/platformsh/INSTALL.md for eZ specific getting started instructions.
# Please see https://doc.ibexa.co/en/latest/getting_started/install_on_ibexa_cloud/ for Ibexa DXP specific getting started instructions.
# Full documentation: https://docs.platform.sh
# eZ requirements: https://doc.ezplatform.com/en/latest/getting_started/requirements/#ez-platform-cloud-requirements-and-setup
# Ibexa DXP requirements: https://doc.ibexa.co/en/latest/getting_started/requirements/#ibexa-cloud-requirements-and-setup

# The name of this app. Must be unique within a project.
name: app

dependencies:
nodejs:
yarn: "*"
n: "*"
php:
composer/composer: '^2.0'

Expand Down Expand Up @@ -57,6 +58,8 @@ variables:
realpath_cache_size: 4096K
realpath_cache_ttl: 600
env:
# Location for N to store node versions
N_PREFIX: /app/.global
# We disable Symfony Proxy (CacheKernel), as we rather use Varnish
APP_HTTP_CACHE: 0
# Warning: Only for Varnish on Platform.sh to workaround missing IP. Disable if you use Fastly or Symfony Proxy where this would be a security issue!
Expand Down Expand Up @@ -128,12 +131,9 @@ mounts:
'src/Migrations/Ibexa':
source: local
source_path: migrations
'config/graphql/types/ezplatform':
'config/graphql/types/ibexa':
source: local
source_path: graphql_types
'config/packages/ezcommerce/autogenerated':
source: local
source_path: packages_commerce_autogenerated_config
# Uncomment if you need to use Kaliop Migrations on your setup and not able to get it to write to "var" dir.
# 'src/AppBundle/MigrationVersions/References':
# source: local
Expand All @@ -150,16 +150,15 @@ hooks:
build: |
set -e
# Install newer version of Node.js, as current default (v6LTS) does not play well with WebpackEncore
unset NPM_CONFIG_PREFIX
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | dash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm current
nvm install 14.18.3
# Install the version specified in the .nvmrc file
# but only if N command exists
hash n && n auto
# Reset the location hash to recognize the newly installed version
hash -r
if [ -z "$COMPOSER_AUTH" ]; then
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ez.no, use COMPOSER_AUTH env variable"
echo "TIP: If you need to authenticate against Github/Gitlab/updates.ibexa.co, use COMPOSER_AUTH env variable"
echo "See: https://docs.platform.sh/guides/general/composer-auth.html#set-the-envcomposer_auth-project-variable"
fi
Expand All @@ -170,16 +169,13 @@ hooks:
deploy: |
set -e
unset NPM_CONFIG_PREFIX
command -v nvm && nvm use 14.18.3
if [ ! -f public/var/.platform.installed ]; then
# Configure ElasticSearch mappings
##php bin/console ibexa:elasticsearch:put-index-template
# To workaround issues with p.sh Varnish we clear container cache & temporary set Symfony Proxy
export SKIP_HTTPCACHE_PURGE="1"
rm -Rf var/cache/$APP_ENV/*.*
rm -Rf var/cache/$APP_ENV/*
php bin/console cache:pool:clear cache.redis
sh bin/platformsh_prestart_cacheclear.sh
SKIP_HTTPCACHE_PURGE="1" php -d memory_limit=-1 bin/console ibexa:install
Expand Down Expand Up @@ -209,10 +205,16 @@ hooks:
# When using Varnish/Fastly, HttpCache is not cleared when clearing Symfony Cache folder above, you need to
# clear cache yourself when for instance templates or config affecting responses change, for instance with:
##php bin/console fos:httpcache:invalidate:tag ez-all
##bin/console fos:httpcache:invalidate:tag ez-all
# Depending on your VCL, buy default this would trigger a soft purge (expiry) and allow grace period, however
# even so if your change only affected certain subset of content, ideally you should only clear specific tags:
##php bin/console fos:httpcache:invalidate:tag l44 c33 ct2 ...
##bin/console fos:httpcache:invalidate:tag l44 c33 ct2 ...
# It is possible to manipulate your Fastly VCL configuration directly from command line using Fastly CLI.
# Official documentation on how to install: https://developer.fastly.com/learning/tools/cli#installing
# Example VCL snippet upload using vcl_recv hook (remember about FASTLY_SERVICE_ID and FASTLY_KEY environmental variables):
##fastly vcl custom create --name="Ibexa VCL" --main --version=latest --autoclone --content=vendor/ibexa/fastly/fastly/ez_main.vcl
##fastly vcl snippet create --name="Shielding" --version=active --autoclone --type recv --content=vendor/ibexa/fastly/fastly/snippet_re_enable_shielding.vcl
# Post deploy hook, like deploy but after being deployed and live, for deploy tasks we can do asynchronously
# Tip: As this is running while web is running, and it's async, avoid doing anything like cache clearing that affects web requests here.
Expand All @@ -232,22 +234,6 @@ crons:
# So if you are not on PE please change specs to "*/5 * * * *" to avoid warning on each deploy.
spec: "* * * * *"
cmd: "php bin/console ibexa:cron:run"
refresh:
# Checks for changes and refresh cache
spec: "*/5 * * * *"
cmd: "php bin/console ibexa:commerce:refresh-cache"
lostorders:
# Send lost orders to the ERP
spec: "*/5 * * * *"
cmd: "php bin/console ibexa:commerce:process-lost-orders"
writestat:
# Calculate statistical data for active sessions
spec: "*/5 * * * *"
cmd: "php bin/console ibexa:commerce:sessions --env=prod write_stat"
jobsrun:
# Run background jobs
spec: "*/5 * * * *"
cmd: "php bin/console jms-job-queue:run -r 180"
weekly:
spec: "0 0 * * 0"
cmd: "php bin/console ibexa:check-urls --quiet"
Expand Down
Loading

0 comments on commit dcd6b7a

Please sign in to comment.