Skip to content
Open
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
94 changes: 48 additions & 46 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,52 +122,54 @@ jobs:

- name: Run test suite
run: composer run-script tests
#
# prime_compatiblity:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# prime-versions: ['2.0']
# name: Prime version ${{ matrix.prime-versions }}
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Set Timezone
# uses: szenius/set-timezone@v1.0
# with:
# timezoneLinux: "Europe/Paris"
#
# - name: Install PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 7.2
# extensions: json
# ini-values: date.timezone=Europe/Paris
#
# - name: Configure sysctl limits
# run: |
# sudo swapoff -a
# sudo sysctl -w vm.swappiness=1
# sudo sysctl -w fs.file-max=262144
# sudo sysctl -w vm.max_map_count=262144
#
# - uses: nyaruka/elasticsearch-action@v1
# with:
# elastic version: 5.6
#
# - name: Install dependencies
# run: composer install --prefer-dist --no-progress
#
# - name: Install Prime ${{ matrix.prime-versions }}
# run: composer require --dev 'b2pweb/bdf-prime:~${{ matrix.prime-versions }}.0' --with-all-dependencies
#
# - name: Install ES Lib 5.0
# run: composer require --dev 'elasticsearch/elasticsearch:~5.0' --with-all-dependencies
#
# - name: Run test suite
# run: composer run-script tests

prime_compatiblity:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
prime-versions: ['2.2', '2.3', '3.0']
name: Prime version ${{ matrix.prime-versions }}

steps:
- uses: actions/checkout@v2

- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Paris"

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: json
ini-values: date.timezone=Europe/Paris

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Runs Elasticsearch ${{ matrix.versions.es }}
uses: elastic/elastic-github-actions/elasticsearch@dc110609b1cb3024477ead739ca23ab547b8b9ff
with:
stack-version: 8.19.12
security-enabled: false

- name: Install Prime ${{ matrix.prime-versions }}
run: composer require --no-update --dev 'b2pweb/bdf-prime:~${{ matrix.prime-versions }}.0'

- name: Install ES Lib 8.0
run: composer require --no-update --dev 'elasticsearch/elasticsearch:~8.0'

- name: Install dependencies
run: composer update --prefer-dist --no-progress --with-all-dependencies

- name: Run test suite
run: composer run-script tests

analysis:
name: Analysis
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
"prefer-stable": true,
"require": {
"php": "~7.4 | ~8.0.0 | ~8.1.0 | ~8.2.0 | ~8.3.0 | ~8.4.0 | ~8.5.0",
"b2pweb/bdf-prime": "~2.0",
"b2pweb/bdf-prime": "~2.2|~3.0",
"elasticsearch/elasticsearch": "~7.0|~8.0",
"b2pweb/bdf-collections": "^1.1.4"
},
"require-dev": {
"phpunit/phpunit": "~9.0",
"b2pweb/bdf-prime-bundle": "~1.0",
"symfony/framework-bundle": "~4.0|~5.0|~6.0|~7.0",
"symfony/messenger": "~4.0|~5.0|~6.0|~7.0",
"symfony/console": "~4.0|~5.0|~6.0|~7.0",
"symfony/yaml": "~4.0|~5.0|~6.0|~7.0",
"b2pweb/bdf-prime-bundle": "dev-feature-FRAM-233-prime-v3 as 1.11.0",
"symfony/framework-bundle": "~4.0|~5.0|~6.0|~7.0|~8.0",
"symfony/messenger": "~4.0|~5.0|~6.0|~7.0|~8.0",
"symfony/console": "~4.0|~5.0|~6.0|~7.0|~8.0",
"symfony/yaml": "~4.0|~5.0|~6.0|~7.0|~8.0",
"vimeo/psalm": "~5.22 | ~6.0",
"squizlabs/php_codesniffer": "~3.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class RegisterIndexConfigurationCompilerPass implements CompilerPassInterf
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$resolverDefinition = $container->findDefinition(MappingResolver::class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class RegisterIndexFactoryCompilerPass implements CompilerPassInterface
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$factory = $container->findDefinition(IndexFactory::class);
$factories = [];
Expand Down
12 changes: 11 additions & 1 deletion src/Bundle/DependencyInjection/PrimeIndexerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Bdf\Prime\Indexer\Bundle\DependencyInjection;

use Bdf\Prime\Indexer\Bundle\Factory\IndexFactoryInterface;
use Bdf\Prime\Indexer\Elasticsearch\Adapter\ClientInterface;
use Bdf\Prime\Indexer\IndexConfigurationInterface;
use Bdf\Prime\Indexer\IndexFactory;
use Symfony\Component\Config\FileLocator;
Expand All @@ -11,6 +12,8 @@
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;

use function class_exists;

/**
* Class PrimeIndexerExtension
*/
Expand All @@ -21,7 +24,7 @@ class PrimeIndexerExtension extends Extension
*
* @psalm-suppress PossiblyNullArgument
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
Expand All @@ -43,6 +46,13 @@ public function load(array $configs, ContainerBuilder $container)
;

$this->configureIndexes($config, $container);

$container->register('Elasticsearch\Client')
->setClass(class_exists('Elasticsearch\Client') ? 'Elasticsearch\Client' : 'Elastic\Elasticsearch\Client')
->setPublic(true)
->setFactory([new Reference(ClientInterface::class), 'getInternalClient'])
->setDeprecated('b2pweb/bdf-prime-indexer', '2.0', 'Direct usage of elasticsearch driver client using service "%service_id%" is deprecated since 2.0')
;
}

private function configureIndexes(array $config, ContainerBuilder $container): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class PrimeIndexerTestExtension extends Extension
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$container->register(TestingIndexer::class)
->setArguments([new Reference('service_container'), false])
Expand Down
Loading
Loading