Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a5cccf1
chore(env): add .envrc file with flake usage configuration
UseTheFork Jul 31, 2024
d72a895
chore(git): add .gitignore file to exclude environment and configurat…
UseTheFork Jul 31, 2024
59ff0a0
chore: add PHP CS Fixer configuration file for Laravel Pint standards
UseTheFork Jul 31, 2024
60adfc2
docs: add CONTRIBUTING.md with setup and development instructions
UseTheFork Jul 31, 2024
59b1c4a
feat(flakes): add flake.nix for project setup with PHP, JS, and servi…
UseTheFork Jul 31, 2024
f8ef15b
chore(build): add justfile for task management
UseTheFork Jul 31, 2024
989c05f
refactor(config): add comments for PHP setup, Elasticsearch service, …
UseTheFork Jul 31, 2024
f04fc47
chore(gitignore): add vendor directory to .gitignore
UseTheFork Aug 1, 2024
1c975fc
feat(flakes): add new testbench commands for a and artisan execution
UseTheFork Aug 1, 2024
ecb2c12
fix(build): pass arguments to testbench command
UseTheFork Aug 1, 2024
572e2d0
test(add): integrate Pest and PHPUnit configuration
UseTheFork Aug 1, 2024
b426d70
test(architecture): add safety tests to prevent usage of debug functions
UseTheFork Aug 1, 2024
adb51cd
test(environment): add unit test to confirm environment is set to tes…
UseTheFork Aug 1, 2024
80a12b5
test(database): add unit tests for Product model
UseTheFork Aug 1, 2024
c33a618
feat(database): add product factory, migration, seeder, and model for…
UseTheFork Aug 1, 2024
426b2d3
test: add base TestCase for Elasticsearch integration tests
UseTheFork Aug 1, 2024
19f725e
feat(models): add new Eloquent models and their corresponding factori…
UseTheFork Aug 1, 2024
98e19c3
refactor(tests): relocate and enhance ArchitectureTest for debugging …
UseTheFork Aug 1, 2024
e37eda1
chore(composer): update autoload paths, scripts, and config plugins i…
UseTheFork Aug 1, 2024
e754048
test(tests): update TestCase to use new seeding approach and remove o…
UseTheFork Aug 1, 2024
61b02ee
feat(migrations): add users and photos tables creation
UseTheFork Aug 1, 2024
ecfba2d
chore(nix): enable php-cs-fixer with Laravel standards
UseTheFork Aug 1, 2024
72bd1e7
feat(dependencies): add geo-math-php and pest packages
UseTheFork Aug 1, 2024
fe8474c
test(config): consolidate testsuites and update environment variables…
UseTheFork Aug 1, 2024
da366a7
chore(database): remove obsolete migration and related tests
UseTheFork Aug 2, 2024
cdb501f
chore(config): remove obsolete ES_INDEX_PREFIX from phpunit.xml
UseTheFork Aug 2, 2024
8a4f722
refactor(tests): clean up TestCase by removing unused code and imports
UseTheFork Aug 2, 2024
f0c62de
test(schema): add reindex test for products and holding_products
UseTheFork Aug 2, 2024
a23d39d
feat(models): add PageHit model and factory
UseTheFork Aug 2, 2024
fccd436
feat(routes, models): add route configurations and PageHit model with…
UseTheFork Aug 2, 2024
960b4cd
refactor(seeders): rename ProductsSeeder to DatabaseSeeder
UseTheFork Aug 2, 2024
38b1e9d
refactor(seeders): rename ProductsSeeder to DatabaseSeeder
UseTheFork Aug 2, 2024
db4c8e9
feat(models): add soft deletes to Product model
UseTheFork Aug 3, 2024
60d36ae
test(aggregation): add tests for product status and grouping
UseTheFork Aug 3, 2024
afe82a7
test(Eloquent): add deletion tests
UseTheFork Aug 3, 2024
45841d9
test(Eloquent): add order and pagination tests
UseTheFork Aug 3, 2024
522f743
test(Eloquent): add querying tests
UseTheFork Aug 3, 2024
2963702
test(Eloquent): add tests for various save and update scenarios
UseTheFork Aug 3, 2024
e216274
test(query): add exception handling for product not found
UseTheFork Aug 3, 2024
9abb372
test(ChunkingTest): add tests for processing large datasets using chu…
UseTheFork Aug 3, 2024
a9a90c7
test(elasticsearch): add unit tests for es specific queries and filters
UseTheFork Aug 3, 2024
4d3cf16
refactor(tests/migrations): move schema setup to migration, update te…
UseTheFork Aug 3, 2024
ff069f4
feat(blog_posts): add blog posts table migration and nested tests
UseTheFork Aug 3, 2024
2b48ea9
test(eloquent): add full-text search tests for Product model
UseTheFork Aug 3, 2024
dcb76f8
feat(elasticsearch): integrate Elasticsearch model and add dynamic in…
UseTheFork Aug 3, 2024
5a60070
feat(relationships): add polymorphic and one-to-many relationships wi…
UseTheFork Aug 3, 2024
fd0c729
test(schema): add tests for Elasticsearch schema management
UseTheFork Aug 3, 2024
a5d519c
test(schema): add tests for index field types
UseTheFork Aug 3, 2024
f5cb0b1
chore(git): update .gitignore to exclude PHPUnit cache files
UseTheFork Aug 3, 2024
892368a
feat(ci): add coverage execution to flake.nix for pest tests
UseTheFork Aug 3, 2024
022dc25
ci(workflows): add GitHub Actions workflow for CI
UseTheFork Aug 3, 2024
2b3f361
ci(workflows): add manual trigger with branch input in CI configuration
UseTheFork Aug 3, 2024
8ae0e56
feat(pagination): add search_after pagination for Elasticsearch
greg-assa Aug 6, 2024
0fd56d8
feat(pagination): add search_after pagination for Elasticsearch
greg-assa Aug 6, 2024
9cac600
refactor(pagination): rename and implement `searchAfter` for paginate…
greg-assa Aug 7, 2024
c7dab04
Merge branch 'main' into refract/cleanup
pdphilip Aug 26, 2024
025815e
Merge remote-tracking branch 'origin/refract/cleanup' into bug/pagina…
UseTheFork Aug 26, 2024
a4243cf
Refactor setup
pdphilip Aug 27, 2024
63d55e8
Types defined (mostly)
pdphilip Aug 27, 2024
689f4cf
PHPStan refractor
pdphilip Aug 28, 2024
6817269
Bug fix and small update on Delete & Order test
pdphilip Aug 28, 2024
735f9bb
EsSpecific Test
pdphilip Aug 28, 2024
b8f61d2
removed unused dependency
pdphilip Aug 28, 2024
ed7bb73
cursor pagination - 80%
pdphilip Aug 29, 2024
94763ad
searchAfterPaginate - as found
pdphilip Aug 29, 2024
023fca0
Tie-breaker and no sort infer
pdphilip Aug 29, 2024
8389b46
Merge branch 'cursor-pagination' into pr/32
pdphilip Aug 29, 2024
aff8865
style(docs): update type hint in cursorPaginate method signature
UseTheFork Aug 30, 2024
63417b5
fix(pagination): mark placeholder logic with FIXME comment in SearchA…
UseTheFork Aug 30, 2024
e18c8e0
feat(static-pages): add StaticPage model, factory, and migration
UseTheFork Aug 30, 2024
150de1e
feat(ds/bridge, query/builder): add bulk processing support
UseTheFork Aug 30, 2024
85c0edc
Settings for index create
pdphilip Aug 30, 2024
851b7e6
Merge branch 'refract/cleanup' of https://github.com/use-the-fork/lar…
pdphilip Aug 30, 2024
22bf221
feat(core): add bulk method to Connection, debug bulk operation in Bu…
UseTheFork Aug 30, 2024
b87f01e
Merge remote-tracking branch 'origin/refract/cleanup' into refract/cl…
UseTheFork Aug 30, 2024
e5bea21
clean ups
pdphilip Aug 30, 2024
86fd05a
fix(query, tests, dsl): streamline bulk processing, fix tests, and co…
greg-assa Aug 30, 2024
d774f16
refactor(tests): remove redundant code and enhance insertion logic in…
greg-assa Aug 30, 2024
ec42697
feat(models): add new `Soft` and `Guarded` models, implement product …
greg-assa Aug 30, 2024
a164438
Merge branch 'refract/cleanup' of https://github.com/use-the-fork/lar…
pdphilip Aug 30, 2024
85091d8
chore(ci): enable PHPStan for code linting in CI configuration
UseTheFork Aug 30, 2024
e9ec751
Abstracted Meta objects, ES Collections
pdphilip Sep 1, 2024
1bb578d
Update Builder.php
pdphilip Sep 1, 2024
ba3ab05
PHPstan qualified + ElasticResult
pdphilip Sep 2, 2024
d5b59f1
Merge branch 'refract/cleanup' of https://github.com/use-the-fork/lar…
pdphilip Sep 2, 2024
1d3ac81
Final changes to bulk
pdphilip Sep 2, 2024
4a9c208
feat(elastic): add optional refresh parameter to insertBulk
UseTheFork Sep 2, 2024
afe4a70
refactor(build): update code formatting and linting tools configuration
UseTheFork Sep 2, 2024
7270056
insertWithoutRefresh
pdphilip Sep 3, 2024
812ddcc
Update ci.yml
pdphilip Sep 3, 2024
9e8a64d
Update ci.yml
pdphilip Sep 3, 2024
e090e63
phpstan and tests
pdphilip Sep 3, 2024
8bd1650
ES PHP dependency update to latest - some final clean ups
pdphilip Sep 3, 2024
8ba1679
Last few edits
pdphilip Sep 4, 2024
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake . --impure
31 changes: 31 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHPStan

on:
push:
branches:
- main
- github-actions
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
69 changes: 69 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: run-tests

on:
push:
branches:
- main
- github-actions
jobs:
test:
runs-on: ubuntu-22.04
env:
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
DB_CONNECTION: testing
APP_KEY: base64:2fl+Ktvkfl+Fuz3Qp/A76G2RTiGVA/ZjKZaz6fiiM10=
APP_ENV: testing
BCRYPT_ROUNDS: 10
MAIL_MAILER: array
TELESCOPE_ENABLED: false

# Docs: https://docs.github.com/en/actions/using-containerized-services
services:
elasticsearch:
image: elasticsearch:7.17.3
env:
discovery.type: single-node
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
ports:
- 9200:9200
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5

redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout 🛎
uses: actions/checkout@v4

- name: Verify Elasticsearch connection 🧩
run: |
curl -X GET "localhost:${{ job.services.elasticsearch.ports['9200'] }}/_cluster/health?pretty=true"

- name: Setup PHP 🏗
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
coverage: xdebug
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, mysql

- name: Install Project Dependencies 💻
run: |
composer install --no-interaction --prefer-dist --optimize-autoloader

- name: List Installed Dependencies 📦
run: composer show -D

- name: Run tests 🧪
run: |
./vendor/bin/pest --version
./vendor/bin/pest
env:
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
ELASTICSEARCH_PORT: ${{ job.services.elasticsearch.ports['9200'] }}
32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
/vendor
/.phpunit.cache
.env
.env.*

#composer
vendor

# Snow-blower
!secrets/.env*
.sb*
secrets.nix

# pre-commit
.pre-commit-config.yaml

# direnv
.direnv

.phpunit*


.idea
.phpunit.cache
build
composer.lock
coverage
docs
phpunit.xml
phpstan.neon
testbench.yaml
node_modules
239 changes: 239 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
<?php
# PHPCS Fixer modified for Laravel Pint standards

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => [
'continue',
'return',
],
],
'blank_line_between_import_groups' => true,
'blank_lines_before_namespace' => true,
'braces_position' => [
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'allow_single_line_empty_anonymous_classes' => false,
'allow_single_line_anonymous_functions' => false,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
],
],
'class_definition' => [
'multi_line_extends_each_single_line' => true,
'single_item_single_line' => true,
'single_line' => true,
],
'class_reference_name_casing' => true,
'clean_namespace' => true,
'compact_nullable_type_declaration' => true,
'concat_space' => [
'spacing' => 'none',
],
'constant_case' => ['case' => 'lower'],
'control_structure_braces' => true,
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'declare_equal_normalize' => true,
'declare_parentheses' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => false,
'function_declaration' => true,
'general_phpdoc_tag_rename' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
'indentation_type' => true,
'integer_literal_case' => true,
'lambda_not_used_import' => true,
'line_ending' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'method_chaining_indentation' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'native_function_casing' => true,
'native_type_declaration_casing' => true,
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
],
],
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiple_statements_per_line' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_space_around_double_colon' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => [
'positions' => ['inside', 'outside'],
],
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => true,
],
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => [
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
],
'no_unneeded_braces' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_cast' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'nullable_type_declaration' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']],
'ordered_interfaces' => true,
'ordered_traits' => true,
'phpdoc_align' => [
'align' => 'left',
'spacing' => [
'param' => 2,
],
],
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_scalar' => true,
'phpdoc_separation' => [
'groups' => [
['deprecated', 'link', 'see', 'since'],
['author', 'copyright', 'license'],
['category', 'package', 'subpackage'],
['property', 'property-read', 'property-write'],
['param', 'return'],
],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => false,
'phpdoc_tag_type' => [
'tags' => [
'inheritdoc' => 'inline',
],
],
'phpdoc_to_comment' => false,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'psr_autoloading' => false,
'return_type_declaration' => ['space_before' => 'none'],
'self_accessor' => false,
'self_static_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false,
'single_blank_line_at_eof' => true,
'single_class_element_per_statement' => [
'elements' => ['const', 'property'],
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_line_empty_body' => true,
'single_quote' => true,
'single_space_around_construct' => true,
'space_after_semicolon' => true,
'spaces_inside_parentheses' => true,
'standardize_not_equals' => true,
'statement_indentation' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'trim_array_spaces' => true,
'type_declaration_spaces' => true,
'types_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['method', 'property'],
],
'whitespace_after_comma_in_array' => true,
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
'declare_strict_types' => true,
'explicit_string_variable' => true,
];

$finder = Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new Config();

return $config->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true);
Loading