Skip to content

Commit b693d5b

Browse files
committed
Merge branch '4.6' into tmp-enh-phpdoc
2 parents 88b0645 + b5ea60f commit b693d5b

File tree

81 files changed

+541
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+541
-450
lines changed

.github/workflows/build.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,19 @@ jobs:
182182
- name: Convert code_samples usages for comment
183183
if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0'
184184
run: |
185-
echo '# code_samples/ change report' >> code_samples_usage.diff.md
185+
title='# code_samples/ change report'
186+
link='<a href="${{ steps.artifact.outputs.artifact-url }}">Download colorized diff</a>'
187+
echo "$title" > code_samples_usage.diff.md
186188
echo '' >> code_samples_usage.diff.md
187189
php tools/code_samples/code_samples_usage_diff2html.php $HOME/code_samples_usage.diff >> code_samples_usage.diff.md
188-
echo '<a href="${{ steps.artifact.outputs.artifact-url }}">Download colorized diff</a>' >> code_samples_usage.diff.md
190+
echo "$link" >> code_samples_usage.diff.md
191+
if [[ `wc -m < code_samples_usage.diff.md | xargs` -ge $((2**16)) ]]; then
192+
echo "$title" > code_samples_usage.diff.md
193+
echo '' >> code_samples_usage.diff.md
194+
echo "Report's diff is too long to be displayed in a comment." >> code_samples_usage.diff.md
195+
echo '' >> code_samples_usage.diff.md
196+
echo "$link" >> code_samples_usage.diff.md
197+
fi
189198
- name: Find Comment
190199
id: find-comment
191200
uses: peter-evans/find-comment@v3
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Post preview links for changed files"
2+
3+
on:
4+
pull_request: ~
5+
workflow_call:
6+
inputs:
7+
project:
8+
description: 'The project to build (dev doc, user doc)'
9+
default: ''
10+
required: false
11+
type: string
12+
13+
jobs:
14+
post-preview-links:
15+
name: Post preview links for changed files
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# Needed to manage the comment
19+
pull-requests: write
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Create comment for changed files
27+
run: |
28+
file_limit=100
29+
build_url="https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/${{inputs.project}}en/${{ github.event.pull_request.number }}/"
30+
31+
change_list=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|")
32+
change_count=$(echo "$change_list" | wc -l)
33+
34+
if [[ $change_list -eq '' ]] ; then
35+
comment="Preview of modified Markdown: no Markdown change to preview."
36+
elif [[ $change_count -gt $file_limit ]] ; then
37+
comment="Preview of modified Markdown: Too many files modified in a single PR, preview link list is skipped. ($change_count files &gth; $file_limit)"
38+
else
39+
comment="Preview of modified Markdown:\n\n$change_list"
40+
fi
41+
42+
echo -e "$comment" > comment.md
43+
44+
- name: Find comment
45+
id: find-comment
46+
uses: peter-evans/find-comment@v3
47+
with:
48+
issue-number: ${{ github.event.pull_request.number }}
49+
comment-author: 'github-actions[bot]'
50+
body-includes: 'Preview of modified Markdown'
51+
52+
- name: Create or update comment
53+
uses: peter-evans/create-or-update-comment@v4
54+
with:
55+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
56+
issue-number: ${{ github.event.pull_request.number }}
57+
body-path: comment.md
58+
edit-mode: replace
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
services:
2+
app.search.solr.query.aggregation_visitor.priority_range_aggregation:
3+
class: Ibexa\Solr\Query\Common\AggregationVisitor\RangeAggregationVisitor
4+
factory: [ '@Ibexa\Solr\Query\Common\AggregationVisitor\Factory\SearchFieldAggregationVisitorFactory', 'createRangeAggregationVisitor' ]
5+
arguments:
6+
$aggregationClass: 'App\Query\Aggregation\Solr\PriorityRangeAggregation'
7+
$searchIndexFieldName: 'priority_i'
8+
tags:
9+
- { name: ibexa.search.solr.query.location.aggregation.visitor }
10+
11+
app.search.elasticsearch.query.aggregation_visitor.priority_range_aggregation:
12+
class: Ibexa\Elasticsearch\Query\AggregationVisitor\RangeAggregationVisitor
13+
factory: [ '@Ibexa\Elasticsearch\Query\AggregationVisitor\Factory\SearchFieldAggregationVisitorFactory', 'createRangeAggregationVisitor' ]
14+
arguments:
15+
$aggregationClass: 'App\Query\Aggregation\Elasticsearch\PriorityRangeAggregation'
16+
$searchIndexFieldName: 'priority_i'
17+
tags:
18+
- { name: ibexa.search.elasticsearch.query.location.aggregation.visitor }
19+
20+
app.search.solr.query.aggregation_result_extractor.priority_range_aggregation:
21+
class: Ibexa\Solr\ResultExtractor\AggregationResultExtractor\RangeAggregationResultExtractor
22+
arguments:
23+
$aggregationClass: 'App\Query\Aggregation\Solr\PriorityRangeAggregation'
24+
$keyMapper: 'Ibexa\Solr\ResultExtractor\AggregationResultExtractor\RangeAggregationKeyMapper\IntRangeAggregationKeyMapper'
25+
tags:
26+
- { name: ibexa.search.solr.query.location.aggregation.result.extractor }
27+
28+
app.search.elasticsearch.query.aggregation_result_extractor.priority_range_aggregation:
29+
class: Ibexa\Elasticsearch\Query\ResultExtractor\AggregationResultExtractor\RangeAggregationResultExtractor
30+
arguments:
31+
$aggregationClass: 'App\Query\Aggregation\Elasticsearch\PriorityRangeAggregation'
32+
tags:
33+
- { name: ibexa.search.elasticsearch.query.location.aggregation.result.extractor }
34+
35+
App\Query\Aggregation\Solr\PriorityRangeAggregationVisitor:
36+
tags:
37+
- { name: ibexa.search.solr.query.location.aggregation.visitor }
38+
39+
App\Query\Aggregation\Solr\PriorityRangeAggregationResultExtractor:
40+
tags:
41+
- { name: ibexa.search.solr.query.location.aggregation.result.extractor }
42+
43+
App\Query\Aggregation\Elasticsearch\PriorityRangeAggregationVisitor:
44+
tags:
45+
- { name: ibexa.search.elasticsearch.query.location.aggregation.visitor }
46+
47+
App\Query\Aggregation\Elasticsearch\PriorityRangeAggregationResultExtractor:
48+
tags:
49+
- { name: ibexa.search.elasticsearch.query.location.aggregation.result.extractor }

code_samples/search/elasticsearch/config/criterion_services.yaml renamed to code_samples/search/custom/config/criterion_services.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
services:
2+
App\Query\Criterion\Solr\CameraManufacturerVisitor:
3+
tags:
4+
- { name: ibexa.search.solr.query.content.criterion.visitor }
5+
- { name: ibexa.search.solr.query.location.criterion.visitor }
6+
27
App\Query\Criterion\Elasticsearch\CameraManufacturerVisitor:
38
tags:
49
- { name: ibexa.search.elasticsearch.query.content.criterion.visitor }

code_samples/search/elasticsearch/config/sort_clause_services.yaml renamed to code_samples/search/custom/config/sort_clause_services.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
services:
2+
App\Query\SortClause\Solr\ScoreVisitor:
3+
tags:
4+
- { name: ibexa.search.solr.query.content.sort_clause.visitor }
5+
- { name: ibexa.search.solr.query.location.sort_clause.visitor }
6+
27
App\Query\SortClause\Elasticsearch\ScoreVisitor:
38
tags:
49
- { name: ibexa.search.elasticsearch.query.content.sort_clause.visitor }
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\EventSubscriber;
6+
7+
use Ibexa\Contracts\Core\Search\Field;
8+
use Ibexa\Contracts\Core\Search\FieldType\StringField;
9+
use Ibexa\Contracts\Elasticsearch\Mapping\Event\ContentIndexCreateEvent;
10+
use Ibexa\Contracts\Elasticsearch\Mapping\Event\LocationIndexCreateEvent;
11+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
12+
13+
final class CustomIndexDataSubscriber implements EventSubscriberInterface
14+
{
15+
public function onContentDocumentCreate(ContentIndexCreateEvent $event): void
16+
{
17+
$document = $event->getDocument();
18+
$document->fields[] = new Field(
19+
'custom_field',
20+
'Custom field value',
21+
new StringField()
22+
);
23+
}
24+
25+
public function onLocationDocumentCreate(LocationIndexCreateEvent $event): void
26+
{
27+
$document = $event->getDocument();
28+
$document->fields[] = new Field(
29+
'custom_field',
30+
'Custom field value',
31+
new StringField()
32+
);
33+
}
34+
35+
public static function getSubscribedEvents(): array
36+
{
37+
return [
38+
ContentIndexCreateEvent::class => 'onContentDocumentCreate',
39+
LocationIndexCreateEvent::class => 'onLocationDocumentCreate',
40+
];
41+
}
42+
}

0 commit comments

Comments
 (0)