-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove useless code samples and add missing ones #357
Conversation
@ahmednfwela @brunoocasali be careful before fixing this kind of issue: #340 -> the code samples were not implemented, so the full issue was not done 😊 But still a big thank for the PR @ahmednfwela of course 😄 |
yes my bad, sometimes I create 3/4 prs a day and forget to add the code samples 😅 |
bors try |
tryBuild succeeded: |
@curquiza I suggest also fixing the link at the top to |
I changed the description. Before a kind of documentation existed at this link. I removed it. Not all the code samples are present in https://github.com/meilisearch/documentation/blob/main/.code-samples.meilisearch.yaml Thank you! |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
=======================================
Coverage 82.03% 82.03%
=======================================
Files 57 57
Lines 1353 1353
=======================================
Hits 1110 1110
Misses 243 243 ☔ View full report in Codecov by Sentry. |
yes sure! we can merge this PR now, but is there a place that contains all the code samples ? |
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.
bors merge
357: Remove useless code samples and add missing ones r=ahmednfwela a=curquiza I created [scripts to manage code samples](https://github.com/meilisearch/integration-automations/pull/164) (internal only) 1. I found out the following code samples are still in this repo but not used by the documentation anymore, so I removed them: ```bash meilisearch-dart - 'faceted_search_2' not found in documentation - 'get_keys_1' not found in documentation - 'documents_guide_add_movie_1' not found in documentation - 'getting_started_communicating_with_a_protected_instance' not found in documentation - 'faceted_search_facets_1' not found in documentation ``` 2. I found the following code samples were missing: ```bash meilisearch-dart - 'get_typo_tolerance_1' not found - 'update_typo_tolerance_1' not found - 'reset_typo_tolerance_1' not found - 'typo_tolerance_guide_1' not found - 'typo_tolerance_guide_2' not found - 'typo_tolerance_guide_3' not found - 'typo_tolerance_guide_4' not found - 'async_guide_canceled_by_1' not found - 'facet_search_1' not found - 'facet_search_3' not found ``` All of them were missing, because the related features are implemented. Co-authored-by: curquiza <[email protected]>
Build failed:
|
Nope
I created a script that takes into account these exception to check everything is update to date 😊 |
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.
bors merge
Build succeeded:
|
358: Create code samples from code, a.k.a. code excerpts r=ahmednfwela a=ahmednfwela # Pull Request ## What does this PR do? This PR completely automates updating the code samples file [.code-samples.meilisearch.yaml](https://github.com/meilisearch/meilisearch-dart/blob/main/.code-samples.meilisearch.yaml) it creates a new PRIVATE `tool` that does 2 things 1. updates the sample file from source code (run by contributors) 2. check if the sample file is up to date with source code (run in CI) the private tool checks dart files in `lib/` and `test/` directory for lines that follow this pattern: ```dart // #docregion key anything() // #enddocregion ``` where `key` is a key in `.code-samples.meilisearch.yaml` [This run](https://github.com/meilisearch/meilisearch-dart/actions/runs/6259938891/job/16996958519?pr=358#step:4:158) shows CI fail in action, due to format mismatch for key `search_parameter_guide_show_ranking_score_1` between code file and yaml file. This commit f9109a0 shows how to fix the failed run, by running `dart run ./tool/bin/meili.dart update-samples` in the root directory of the repo. this should simplify adding samples, and avoid issues like #357 --- ## Update I have also added functionality to detect missing and useless keys, see this failing run for example: https://github.com/meilisearch/meilisearch-dart/actions/runs/6262599763/job/17005143489?pr=358#step:4:159 ## PR checklist WIP - [ ] remove unnecessary indentations from code. Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Ahmed Fwela <[email protected]> Co-authored-by: Ahmed Fwela <[email protected]>
I created scripts to manage code samples (internal only)
All of them were missing, because the related features are implemented.