-
Notifications
You must be signed in to change notification settings - Fork 96
Refresh theme-liquid-docs on theme-check startup #671
Refresh theme-liquid-docs on theme-check startup #671
Conversation
95f2009
to
b33d541
Compare
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.
Thank you, @mgmanzella! Excellent stuff 🔥 🚀
I've left just some minor comments, please, let me know what you think about them :)
b33d541
to
d2de385
Compare
…ourceIndex liquid schema is out of date
941f704
to
3857702
Compare
3857702
to
249a66b
Compare
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.
Thank you, @mgmanzella! Great stuff! It's very rewarding to check it in action 🚀
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.
🎩 ing passed ✅
I just have some nitpicks/remarks :)
… syntax of filename const
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.
Thanks for your changes and feedback, LGTM!
* Define the domain for the `theme-liquid-docs` files (#643) * Introduce the `ObjectAttributeCompletionProvider` module (#654) * Download theme-liquid-docs on package deploy or while running theme-check (#661) * Download theme-liquid-docs on package deploy * Add data fixtures to test downloading theme-liquid-docs * Introduce the `AssignmentsCompletionProvider` to suggest variables (#667) * Refresh theme-liquid-docs on theme-check startup (#671) * Add async download in SourceManager#refresh and mechanism to notify SourceIndex liquid schema is out of date * Tests for SourceIndex state classes and SourceManager#refresh, create helper for shared stubs * Cleanup -- fix test dir name to source_index, aggr requires * Remove class method mock (Net::HTTP.any_instance), affects other tests * Change SourceIndex#local_path to #local_path! to indicate danger, fix syntax of filename const * Suggest filters compatible with the object type (#669) ### WHY are these changes introduced? Fixes #658 ### WHAT is this pull request doing? 1. Adds logic to `FilterCompletionProvider` to… - determine the type of the variable/literal (string, number, array, …) sitting before the filter separator ("input type") - suggest filters that match the specific input type, and filters whose input type is _variable_ (i.e. for more than 1 specific type, e.g. ` | default`) 2. Displays deprecated filters too, so that users can still see the filter they wanted to use. Co-authored-by: Morisa Manzella <[email protected]> Co-authored-by: Julien Poitrin <[email protected]> Co-authored-by: Julien Poitrin <[email protected]>
Summary
Closes #651
Refreshes docs async on theme-check startup, after discussing with @karreiro we decided it's out of scope to periodically refresh while theme-check is running
Since this is a medium size PR, I broke this down into 4 commits:
SourceManager#refresh
and mechanism to notifySourceIndex
liquid schema is out of dateSourceManager#download_or_refresh
is called inon_initialized
to download docs async while theme-check loads the existing outdated docsSourceManager#refresh
downloads updated docs to a temp directory in case the download failsSourceIndex::FilterState
,SourceIndex::ObjectState
, andSourceIndex::TagState
are used to notifySourceIndex
if a schema is out of date after refreshSourceManager
marks each liquid schema variable's respective state to "out of date" when updated docs are successfully downloadedSourceIndex
marks each liquid schema variable's respective state "up to date" when it finishes loading ittest/shopify_liquid/scope_index
totest/shopify_liquid/source_index/
Tophatting Steps
rake download_theme_liquid_docs
if you dont have the version of theme-liquid-docs with a revision filesleep(30)
in the threaddata/shopify_liquid/documentation/latest.json
to change the revision key to "out_of_date_sha"collections
documentation)