Skip to content
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

(GH-245) Use object cache for fact data #246

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

glennsarti
Copy link
Contributor

Fixes #245

This commit adds an acceptance test for the puppet/getFacts request. Previously
this message was added to the message handler, but not to the test suite.


Previously the puppet/getFacts request would call out to Facter directly however
this can be very slow, particularly with Facter v2 in the PDK. This commit
changes the request to instead use the object cache which already has all of the
available facter information.

This commit also moves the method from the PuppetHelper to the FacterHelper
where it would make more sense. This is tested as part of the acceptance suite.


Now that the language server no longer calls the facts_all action, the
supporting code can be removed.

This commit adds an acceptance test for the puppet/getFacts request. Previously
this message was added to the message handler, but not to the test suite.
Previously the puppet/getFacts request would call out to Facter directly however
this can be very slow, particularly with Facter v2 in the PDK.  This commit
changes the request to instead use the object cache which already has all of the
available facter information.

This commit also moves the method from the PuppetHelper to the FacterHelper
where it would make more sense.  This is tested as part of the acceptance suite.
Now that the language server no longer calls the facts_all action, the
supporting code can be removed.
@glennsarti glennsarti added this to the 0.26.0 milestone Apr 29, 2020
@glennsarti glennsarti requested a review from jpogran April 29, 2020 11:30
@glennsarti glennsarti self-assigned this Apr 29, 2020
@jpogran
Copy link
Contributor

jpogran commented Apr 29, 2020

The primary reason I had not pulled from cache was that it means waiting for the language server to start and for the language server to run before querying, but I was able to set the promises in the client to wait. It works, and is slightly faster start because there isn't a second wait for the facts to be queried.

So it all works with cached facts. However, hitting refresh doesn't 'refresh' anymore. It pulls from teh cache. How does a user get a 'fresh' run?

@jpogran jpogran merged commit 73e2615 into puppetlabs:master Apr 29, 2020
@jpogran jpogran added the enhancement New feature or request label Apr 29, 2020
@jpogran
Copy link
Contributor

jpogran commented Apr 29, 2020

Created new issue to addressed refreshing facts. It is sufficient for the first version of this feature to simply have it refresh from cache

@glennsarti glennsarti deleted the gh245refactorfacts branch May 9, 2020 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor facts request
2 participants