Skip to content

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Sep 25, 2025

Question Answer
JIRA Ticket
Versions
Edition
  • Make all criterion pages looking the same using GitHub Copilot PhpStorm plugin
  • Test their contents

Prompts:

  • Create a template

In mkdocs.yaml, below "Search Criteria reference:", there is a list of markdown files. Not all files from docs/search/criteria_reference/ are below "Search Criteria reference:". Please use only the ones below "Search Criteria reference:" and not the whole directory.
All those files should look the same and have the same structure. Can you extract from all those files except search/criteria_reference/search_criteria_reference.md a template and save it as _template.md

  • Apply the template

Can you apply this template to all the files from previous list? Don’t make batches, treat all the files in one go.
Make sure there is always an empty new line after a section heading.
Please, don’t add optional "Supported syntax" section if it’s not already there.
If there isn’t a "Limitations" section, add one with the sentence "<criterion> can be used on all search engines." where is the name of the criterion documented in the file surrounded with backticks.
If the PHP example is missing, create one looking like the existing ones. You can find the PHP class corresponding to the documented criterion in vendor/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion directory’s files.

image
  • Resume after error and creating a new conversation

In mkdocs.yaml, below "Search Criteria reference:", there is a list of markdown files. Not all files from docs/search/criteria_reference/ are below "Search Criteria reference: ». Please use only the ones below "Search Criteria reference:" and not the whole directory.
All those files should look the same and have the same structure.
Can you apply the template from _template.md to all the files from this list starting at search/criteria_reference/sectionidentifier_criterion.md
? Don’t make batches, treat all the files in one go.
Make sure there is always an empty new line after a section heading.
Please, don’t add optional "Supported syntax" section if it’s not already there.
If there isn’t a "Limitations" section, add one with the sentence "<criterion> can be used on all search engines." where is the name of the criterion documented in the file surrounded with backticks.
If the PHP example is missing, create one looking like the existing ones. You can find the PHP class corresponding to the documented criterion in vendor/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion directory’s files.

  • Recover example deleted by AI mistake

In docs/search/criteria_reference/isuserbased_criterion.md there was a REST example, can you add it back from 5.0 branch, please?

  • Fix JSON examples (bad lazy prompt, it's not just about braquets, see latter prompt)

Can you fix json examples in all files modified on current branch compared to 5.0 branch?

  • Find undocumented criteria

Find in vendor/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion directory, criteria which aren't documented in docs/search/criteria_reference files.

A lot of noise in the output due to abstract classes but yet there is a listed interesting missing criterion.

  • Document IsContainer

Create in docs/search/criteria_reference a markdown files structured like other files from this same directory to document the criterion implemented in vendor/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion/IsContainer.php
In mkdocs.yml, below "Search Criteria reference:", add an "IsContainer" entry respecting the alphabetic order and the format of other entries.

  • Fix JSON examples (good)

In mkdocs.yaml, below "Search Criteria reference:", there is a list of markdown files. Not all files from docs/search/criteria_reference/ are below "Search Criteria reference:". Please use only the ones below "Search Criteria reference:" and not the whole directory.
In those files, there are REST JSON Examples which are incomplete. You will complete them by adding the wrapping around the missing part, and make the JSON valide. The JSON template is the following:

{
"ViewInput": {
"identifier": "Test",
"Query": {
"Filter": {
"Criterion": …
}
}
}
}

where is the criterion documented in the file you are working on, and … its argument. The middle part below "Filter" is always already in the existing example.
Please, edit the files to complete the JSON examples. Never create a new section in the file your working on. If the JSON section exists, just complete it. If the JSON section doesn't exist, skip the file without modifying it.

For some reason, I didn't manage to have it treat all the files and I gave up.

  • Test JSON

In mkdocs.yaml, below "Search Criteria reference:", there is a list of markdown files. Not all files from docs/search/criteria_reference/ are below "Search Criteria reference:". Please use only the ones below "Search Criteria reference:" and not the whole directory.
In those files, there might be a "REST API" section and its "JSON" subsection with an example. Test each example when available with the following curl command pattern:

curl -i -X 'POST'
'http://hackathon.ddev.site:8080/api/ibexa/v2/views'
-H 'accept: application/vnd.ibexa.api.View+json; version=1.1'
-H 'Content-Type: application/vnd.ibexa.api.ViewInput+json'
-d '{
"ViewInput": {
"identifier": "test",
"Query": {
"Filter": {
"": …
}
}
}
}' > curl.tmp.txt

Please, after each curl command, append to a _report.txt file, the tested file name and the first line of curl.tmp.txt.

_report.txt

ancestor_criterion.md HTTP/1.1 200 OK
contentid_criterion.md HTTP/1.1 200 OK
contentname_criterion.md HTTP/1.1 200 OK
contenttypegroupid_criterion.md HTTP/1.1 200 OK
contenttypeid_criterion.md HTTP/1.1 200 OK
contenttypeidentifier_criterion.md HTTP/1.1 200 OK
datemetadata_criterion.md HTTP/1.1 200 OK
field_criterion.md HTTP/1.1 200 OK
fulltext_criterion.md HTTP/1.1 200 OK
image_criterion.md HTTP/1.1 200 OK
imagedimensions_criterion.md HTTP/1.1 200 OK
imagefilesize_criterion.md HTTP/1.1 501 Not Implemented
imagemimetype_criterion.md
imageorientation_criterion.md
isbookmarked_criterion.md HTTP/1.1 406 Not Acceptable
isuserbased_criterion.md HTTP/1.1 406 Not Acceptable
isuserenabled_criterion.md
languagecode_criterion.md HTTP/1.1 200 OK
locationid_criterion.md HTTP/1.1 200 OK
locationremoteid_criterion.md HTTP/1.1 200 OK
objectstateid_criterion.md HTTP/1.1 200 OK
objectstateidentifier_criterion.md
parentlocationid_criterion.md HTTP/1.1 500 Internal Server Error
parentlocationremoteId_criterion.md
remoteid_criterion.md HTTP/1.1 404 Not Found
sectionid_criterion.md
sectionidentifier_criterion.md
sibling_criterion.md HTTP/1.1 400 Bad Request
subtree_criterion.md HTTP/1.1 400 Bad Request
useremail_criterion.md HTTP/1.1 400 Bad Request
userid_criterion.md HTTP/1.1 400 Bad Request
userlogin_criterion.md HTTP/1.1 400 Bad Request
usermetadata_criterion.md HTTP/1.1 400 Bad Request
visibility_criterion.md HTTP/1.1 400 Bad Request

"400 Bad Request" are due to not completed JSON from previous task.
Some lines just have the file name and the answer is missing.

But there is genuinely something wrong with ImageFileSizeCriterion, testing it manually, I also have "501 Not Implemented".

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location:

``` php hl_lines="2"
```php hl_lines="2-4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add to add hl_lines back and update it.

$query->query = new Criterion\IsUserBased();
```

### REST API
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing this??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back using the prompt

In docs/search/criteria_reference/isuserbased_criterion.md there was a REST example, can you add it back from 5.0 branch, please?

"Query": {
"Filter": {
"ContentIdCriterion": "HIDDEN"
"VisibilityCriterion": "HIDDEN"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Copy link

github-actions bot commented Sep 25, 2025

Preview of modified files

Preview of modified Markdown:

@adriendupuis adriendupuis changed the title Hackathon: Unify criteria reference Hackathon: Unify & complete criteria reference Sep 26, 2025
@adriendupuis
Copy link
Contributor Author

AI is a motivated but stupid assistant who understands quickly but you may have to explain to it for a long time.
There is definitively something useful to it, especially with patterns and repetitions.
I close the PR mainly because I disagree with things I asked it for test purpose, like, for example, I'm not sure the "Limitations" section should be added everywhere with this placeholder.

@adriendupuis adriendupuis deleted the hackathon-ad-criteria-ref branch October 1, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant