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

Added configurable prefixes for Redis Tracker and Lock stores #6500

Merged
merged 36 commits into from
Nov 4, 2020

Conversation

bjbredis
Copy link
Contributor

@bjbredis bjbredis commented Aug 27, 2020

Proposed changes:
Adding configurable prefixes to Redis Tracker and Lock stores so that a single Redis instance (and logical DB) can support multiple conversation trackers and lock.
All conversation keys will be prefixed with tracker:... and all locks prefixed with lock:.... Additionally, you can specify alphanumeric-only prefix: value in endpoints.yml such that keys in redis will take the form value:tracker:... and value:lock:... respectively.
#6498

Status (please check what you already did):

  • [y] added some tests for the functionality
  • [y] updated the documentation
  • [y] updated the changelog
  • [y] reformat files using black

@CLAassistant
Copy link

CLAassistant commented Aug 27, 2020

CLA assistant check
All committers have signed the CLA.

@sara-tagger
Copy link
Collaborator

Thanks for submitting a pull request 🚀 @rgstephens will take a look at it as soon as possible ✨

@rgstephens rgstephens requested review from ricwo and removed request for rgstephens September 4, 2020 15:15
Copy link
Contributor

@ricwo ricwo left a comment

Choose a reason for hiding this comment

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

Thanks a lot for creating this PR! The change looks good overall. I'm not sure adding lock: (tracker:) is necessary if a prefix is provided

changelog/6498.improvement.md Outdated Show resolved Hide resolved
changelog/6498.improvement.md Outdated Show resolved Hide resolved
docs/docs/lock-stores.mdx Outdated Show resolved Hide resolved
data/test_endpoints/example_endpoints.yml Outdated Show resolved Hide resolved
docs/docs/lock-stores.mdx Outdated Show resolved Hide resolved
rasa/core/tracker_store.py Outdated Show resolved Hide resolved
rasa/core/tracker_store.py Outdated Show resolved Hide resolved
rasa/core/lock_store.py Outdated Show resolved Hide resolved
rasa/core/tracker_store.py Outdated Show resolved Hide resolved
rasa/core/lock_store.py Outdated Show resolved Hide resolved
bjbredis and others added 3 commits September 8, 2020 15:44
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
@ricwo
Copy link
Contributor

ricwo commented Sep 11, 2020

@bjbredis please let me know once this is ready for another review

@sbkv
Copy link

sbkv commented Sep 30, 2020

@bjbredis Bump

bjbredis and others added 8 commits October 7, 2020 12:56
Testing fixes

Docs and test fix

Docs

Formatting

Changelog added.

Cleanup validation logic.

Formatting

Post-linting changes.

Fixed a test.

Comments only

Update changelog/6498.improvement.md

Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>

Update docs/docs/lock-stores.mdx

Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>

Update data/test_endpoints/example_endpoints.yml

Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Fix typo.

Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
bjbredis and others added 7 commits October 7, 2020 13:46
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com>
@bjbredis
Copy link
Contributor Author

bjbredis commented Nov 2, 2020

@ricwo I tried to up-version my master to the rasa master in order to resubmit. in the process there are conflicts in my feature branch from my master. Can you have a look and let me know if the conflicts make sense and I should attempt to resolve, or alternatively the conflicts don't make sense and something else is needed. Thanks.

@ricwo
Copy link
Contributor

ricwo commented Nov 3, 2020

hi @bjbredis, yes, the two conflicts in tracker_store.py need to be resolved. for the first one, you can keep your version and simply add the **kwargs parameter to the super() init call. for the second one, please also use the master version, but change

stored = self.red.get(sender_id)

to

stored = self.red.get(self.prefix + sender_id)

@bjbredis bjbredis requested a review from ricwo November 3, 2020 16:46
@sbkv
Copy link

sbkv commented Nov 4, 2020

@bjbredis @ricwo Fantastic to see the changes approved! Can't wait for them to be merged in.

@ricwo ricwo merged commit 899be2b into RasaHQ:master Nov 4, 2020
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.

5 participants