-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-10494: Refactored location filtering logic #682
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
Draft
mikadamczyk
wants to merge
19
commits into
4.6
Choose a base branch
from
sort-fix
base: 4.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1b5d477
IBX-10494: Included Postgres 18 on CI
micszo 01bbfc6
Fixed inconsistent test
Steveb-p 30915f9
Postgres 14 & 18 setup
micszo d6ead1c
Image in matrix for Postgres int tests
micszo babf6e9
Image in matrix for MySQL int tests
micszo 52c10b3
Dedicated action for installation of composer packages
micszo 468a9ae
reformat code
micszo 6fe6167
fixup! reformat code
micszo 8df9df8
Refactored location sorting logic in query builders and enhance filte…
mikadamczyk c289838
Refactored sorting field names in query builders for consistency
mikadamczyk b4b2d21
Enhanced query wrapping to include dynamic select columns based on or…
mikadamczyk 3f4071a
Refactored location filtering logic and removed redundant query wrapping
mikadamczyk e3fc8e9
Refactored ContentFilteringTest to use getContentInfo() for mainLocat…
mikadamczyk 2b45e8c
Refactored sorting expression methods for location query builders
mikadamczyk 3822fa9
Added unit test for BaseLocationSortClauseQueryBuilder
mikadamczyk f95eaad
Added legacy location sort clause and query builder for filtering
mikadamczyk 7201d35
Refactored legacy filtering setup and improved type handling in tests
mikadamczyk 8c8e690
Rebuilt service container to ensure test-only services are loaded
mikadamczyk 89af2c8
Refactored LegacyContentFilteringTest to use RepositoryTestCase and i…
mikadamczyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,22 +16,17 @@ jobs: | |
| php: | ||
| - '8.1' | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| extensions: 'pdo_sqlite, gd' | ||
| tools: cs2pr | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
| - uses: ibexa/gh-workflows/actions/composer-install@main | ||
| with: | ||
| gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} | ||
| gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} | ||
| satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} | ||
| satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} | ||
|
|
||
| - name: Run code style check | ||
| run: composer run-script check-cs -- --format=checkstyle | cs2pr | ||
| - name: Run code style check | ||
| run: composer run-script check-cs -- --format=checkstyle | cs2pr | ||
|
|
||
| tests: | ||
| name: Unit tests & SQLite integration tests | ||
|
|
@@ -47,38 +42,33 @@ jobs: | |
| - '8.1' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| extensions: pdo_sqlite, gd | ||
| tools: cs2pr | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
| - uses: ibexa/gh-workflows/actions/composer-install@main | ||
| with: | ||
| gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} | ||
| gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} | ||
| satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} | ||
| satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} | ||
|
|
||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
|
||
| - name: Run PHPStan analysis | ||
| run: composer run-script phpstan | ||
| - name: Run PHPStan analysis | ||
| run: composer run-script phpstan | ||
|
|
||
| - name: Run unit test suite | ||
| run: composer run-script unit | ||
| - name: Run unit test suite | ||
| run: composer run-script unit | ||
|
|
||
| - name: Run integration test suite | ||
| run: composer run-script integration | ||
| - name: Run integration test suite | ||
| run: composer run-script integration | ||
|
|
||
| integration-tests-postgres: | ||
| name: PostgreSQL integration tests | ||
| needs: tests | ||
| services: | ||
| postgres: | ||
| image: postgres:14 | ||
| image: ${{ matrix.image }} | ||
| ports: | ||
| - 5432 | ||
| env: | ||
|
|
@@ -100,21 +90,19 @@ jobs: | |
| - '7.4' | ||
| - '8.0' | ||
| - '8.1' | ||
| image: | ||
| - 'postgres:14' | ||
| - 'postgres:18' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| extensions: pdo_pgsql, gd | ||
| tools: cs2pr | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| - uses: ibexa/gh-workflows/actions/composer-install@main | ||
| with: | ||
| dependency-versions: "highest" | ||
| gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} | ||
| gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} | ||
| satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} | ||
| satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} | ||
|
|
||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
|
@@ -126,12 +114,12 @@ jobs: | |
| # Required by old repository tests | ||
| DATABASE: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb" | ||
|
|
||
| integration-tests-mysql-80: | ||
| name: MySQL integration tests (8.0) | ||
| integration-tests-mysql: | ||
| name: MySQL integration tests | ||
| needs: tests | ||
| services: | ||
| mysql: | ||
| image: mysql:8.0 | ||
| image: ${{ matrix.image }} | ||
| ports: | ||
| - 3306/tcp | ||
| env: | ||
|
|
@@ -155,75 +143,19 @@ jobs: | |
| - '7.4' | ||
| - '8.0' | ||
| - '8.1' | ||
| image: | ||
| - 'mysql:8.0' | ||
| - 'mysql:8.4' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| - uses: ibexa/gh-workflows/actions/composer-install@main | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| extensions: pdo_mysql, gd, redis | ||
| tools: cs2pr | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
|
|
||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
|
||
| - name: Run integration test suite vs MySQL | ||
| run: composer run-script integration | ||
| env: | ||
| DATABASE_URL: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" | ||
| DATABASE: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" | ||
|
|
||
| integration-tests-mysql-84: | ||
| name: MySQL integration tests (8.4) | ||
| needs: tests | ||
| services: | ||
| mysql: | ||
| image: mysql:8.4 | ||
| ports: | ||
| - 3306/tcp | ||
| env: | ||
| MYSQL_RANDOM_ROOT_PASSWORD: true | ||
| MYSQL_USER: mysql | ||
| MYSQL_PASSWORD: mysql | ||
| MYSQL_DATABASE: testdb | ||
| options: >- | ||
| --health-cmd="mysqladmin ping" | ||
| --health-interval=10s | ||
| --health-timeout=5s | ||
| --health-retries=5 | ||
| --tmpfs=/var/lib/mysql | ||
| runs-on: "ubuntu-24.04" | ||
| timeout-minutes: 60 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php: | ||
| - '7.4' | ||
| - '8.0' | ||
| - '8.1' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| extensions: pdo_mysql, gd, redis | ||
| tools: cs2pr | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
| gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} | ||
| gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} | ||
| satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} | ||
| satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} | ||
|
|
||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
|
@@ -265,28 +197,28 @@ jobs: | |
| - '8.0' | ||
| - '8.1' | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
| - name: Setup PHP Action | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| coverage: none | ||
|
|
||
| - name: Add solr dependency | ||
| run: | | ||
| VERSION=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json) | ||
| composer require --no-update "ibexa/solr:$VERSION" | ||
| - name: Add solr dependency | ||
| run: | | ||
| VERSION=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json) | ||
| composer require --no-update "ibexa/solr:$VERSION" | ||
|
|
||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
| - uses: ramsey/composer-install@v3 | ||
| with: | ||
| dependency-versions: "highest" | ||
|
|
||
| - name: Run integration test suite | ||
| run: composer test-integration-solr | ||
| env: | ||
| - name: Run integration test suite | ||
| run: composer test-integration-solr | ||
| env: | ||
| CUSTOM_CACHE_POOL: singleredis | ||
| CACHE_HOST: 127.0.0.1 | ||
| CORES_SETUP: single | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is kind of unexpected if you got rid of the wrapped query. AFAIR this notation was used by the wrapped query, wasn't it? How does the SQL look like after the changes?
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.
and
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.
@mikadamczyk but that means that any custom sort clause will stop working because we've changed field name format from
alias.fieldtoalias_field, doesn't it? Which makes it a BC break.