Detecting and fixing incorrect YAML samples#3165
Conversation
32845fd to
b144d93
Compare
| @@ -1,13 +0,0 @@ | |||
| ibexa: | |||
There was a problem hiding this comment.
Not used - but it should be toolbar, not toolbars
| security: | ||
| firewalls: | ||
| # ... | ||
| ibexa_cdp: |
There was a problem hiding this comment.
Was outdated - the new config was stolen from configuration provided when installing the project
| # Raptor Recommendations API URL, optional, set by default | ||
| recommendations_api_url: '%ibexa.connector.raptor.recommendations.api_url%' | ||
| # Raptor Recommendations API URI, optional, set by default | ||
| recommendations_api_uri: '%ibexa.connector.raptor.recommendations.api_uri%' |
| http: | ||
| enabled: true | ||
| batch_size: 64 | ||
| enabled: true |
There was a problem hiding this comment.
This sample had mixed tabs and spaces
| - | ||
| path: docs/users/user_authentication.md | ||
| line: 41 | ||
| message: '~Unrecognized option "encoders" under "security"\. Available options are "access_control", "access_decision_manager", "access_denied_url", "erase_credentials", "expose_security_errors", "firewalls", "hide_user_not_found", "password_hashers", "providers", "role_hierarchy", "session_fixation_strategy"\.~' |
There was a problem hiding this comment.
This one is valid (incorrect code sample), but I want to tackle this in a follow-up
adriendupuis
left a comment
There was a problem hiding this comment.
I focused on everything not in docs/ dir for this first pass
| content: | ||
| tree_root: | ||
| location_id: location_id_of_customer_portals_root_folder | ||
| location_id: 9999 # location_id_of_customer_portals_root_folder |
There was a problem hiding this comment.
Consistency with the changes above and below:
location_id_of_customer_portal = 9999
location_id_of_customer_portals_root_folder = 999
| location_id: 9999 # location_id_of_customer_portals_root_folder | |
| location_id: 999 # location_id_of_customer_portals_root_folder |
| run: | | ||
| curl -H "Authorization: token $TOKEN" -L https://github.com/ibexa/vale-styles/archive/refs/heads/main.zip -o vale.zip | ||
| rm -rf tests | ||
| unzip vale.zip |
There was a problem hiding this comment.
Keep archive removal
| unzip vale.zip | |
| unzip vale.zip | |
| rm vale.zip |
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
code_samples/ change report
|
| if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' | ||
| run: | | ||
| git fetch origin | ||
| git fetch origin --depth=1 ${{ github.head_ref }} |
There was a problem hiding this comment.
Added after I've noticed that this step takes 11 minutes in one of the runs:
https://github.com/ibexa/documentation-developer/actions/runs/25958230826/job/76308753865
with this change it's reduced to 36 seconds:
https://github.com/ibexa/documentation-developer/actions/runs/25958591368/job/76309740366?pr=3165
|
| if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' | ||
| run: | | ||
| git fetch origin | ||
| git fetch origin --depth=1 ${{ github.head_ref }} |




This PR allows us to test the YAML code samples in the doc - both in the code_samples directory (.yaml files) and the ones embedded directly in Markdown (by extracting the ``` yaml code blocks).
There are two checks:
ibexa,security,ibexa_migrationsconfiguration keysNot everything is checked - for example, Ibexa Migration files are not validated.
Running the tests
To run the tests, execute:
Example output:
Either fix the code sample, or add the error to the list of ignored lists by running:
Thats a baseline for samples that should be ignored - to put something in the baseline, run
composer yaml-update-baselineand commit the modifiedtests/yaml-validation-baseline.yamlBaseline
Baseline depends on a hash of the code sample (SHA-256), not the line number itself - the line number is there just for us to locate the code sample easily. This prevent raising the same issue every time the line numbers of the code sample changes (for example, when it's modified).