Choose between legacy/modern prefixes via prefix_style config (and trivial refactors)#276
Conversation
Less indentation needed.
And updated the README for revised logic
Dunno how the tests passed previously without this
contexts don't exist in "bacon", so use nested "describe" blocks instead.
- Only using a single class now named `UpgradeTest` - Class is deleted and recreated to switch between legacy & modern conventions
|
Hi Matthew, thanks for the PR for redis-objects key naming. Overall I like the approach. I noticed you submitted 3 PR's that seem to overlap. Should I just accept the latest one? Or are all 3 needed? Thanks. |
|
Hi @nateware I submitted 3 PRs because I wanted to keep the changes grouped in some logical way. That way each could be approved or rejected independently depending on your review and feedback. This PR restricts itself to the changes directly related to
Ideally all 3 would be merged |
|
HI @matthewhively I merged all 3 PRs and resolved one conflict. I believe I resolved it correctly. However, the new |
|
Hey @nateware Though that (probably) does not explain the failing tests you mentioned. |
|
@nateware well... apparently adding the deltas shown in the screenshot to my local copy of And line 411 is: So, apparently when scanning for the default number of ... More digging ... Turning on verbose logging So... thats odd the key found in a subsequent loop were not renamed properly. That would certainly explain the failure... but why? ... more digging ... Somehow during multiple loops |
|
Well, its definitely a good thing I dug in to figure out why the test was failing, because otherwise the migration wouldn't have been working properly in real life scenarios.. Patch PR is up. |
|
Nice - thanks for the deep dive @matthewhively! I merged that other PR and it seems like tests are all passing now. To verify, the new default behavior is one that is backwards compatible, is that correct? So somebody would elect to use the new full prefixes if needed, is that right? |
|
@nateware yes, that was my intention. |
|
Thanks so much for the help. I pushed 2.0.0.beta2 to rubygems. When you
have time, can you try installing it on your end?
…On Mon, Dec 8, 2025 at 11:15 AM Matthew Hively ***@***.***> wrote:
*matthewhively* left a comment (nateware/redis-objects#276)
<#276 (comment)>
@nateware <https://github.com/nateware> yes, that was my intention.
In theory in a future release the default behavior could be updated to
modern and then a far future release could drop support for the
deprecated legacy prefixes entirely.
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABZIGQ5SP4KMCAU5QIJ6T4AXE4TAVCNFSM6AAAAACMFF6NEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRYGYZTENRSGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|


This resolves the scary upgrade messaging. No one is forced to upgrade, but it is recommended.
Now instead of configuring on a class by class basis whether they should remain with a legacy prefix, you would configure all together whether this install of Redis::Objects will remain using legacy prefixes, or has transitioned to modern prefixes.
This allows the engineer to upgrade to version 2.0 without needing to make code changes to accomodate the new prefixes.
Spec tests in redis_key_naming_spec.rb were updated to follow the new configuration.
Also included:
shouldassertions that didn't make any sense(Trivial refactors are shared with other branches)