-
Notifications
You must be signed in to change notification settings - Fork 247
DEV: add TCEs to EXISTS command #2036
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
base: main
Are you sure you want to change the base?
Conversation
Staging links: |
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.
This is shaping up really well! The code basically looks OK and I compiled and ran a few of the files and they worked fine. The main issue is the test suite stuff that appears in the original sources, but gets extracted from the examples.
A few thoughts:
- Just out of interest, did you refer
Augi...Augment to the examples on the website or to the examples in the client repos for the languages? I've found it tends to do better when you explicitly say "look at the examples indoctests
", but the downside is that you might have to do this separately for each language, which I guess is not the goal here. - I'd be interested to know if you selected Claude or GPT5 for this. I'm still trying to get an impression of both but Claude seems faster and tries to be "fun" (emojis and 'You're absolutely right!", etc), while GPT is slower and boring but seems to think more deeply about what it's doing. Claude might actually be better for short snippets like the ones in the command pages.
- I don't know if you are using Enhance Prompt, but when you do, it usually gives you a list of requirements for the conversion. It's then quite easy to add your own short directions and reminders to the list ("convert all the examples, not just some of them", "translate the tests as well as the snippets", etc).
Really good, though - great bit of exploration here :-)
@@ -0,0 +1,156 @@ | |||
// EXAMPLE: cmds_generic |
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.
There is actually quite a bit of extra crap that is needed for the testing suite but gets removed by the build script (eg, see this file that includes the test namespace and some other class derivations, etc, that enable testing).
long existsResult5 = db.KeyExists(["key1", "key2", "nosuchkey"]); | ||
Console.WriteLine(existsResult5); // >>> 2 | ||
|
||
// Tests for 'exists' step. |
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.
This comment shouldn't be in the example itself (probably not really necessary at all, with hindsight). Also, there are no tests - the asserts should appear in a REMOVE_...
section after the example.
// 2 | ||
} | ||
|
||
// STEP_START exists |
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.
We don't generally include the whole function in the example, so the STEP_...
markers should appear just around the relevant snippet.
@@ -0,0 +1,94 @@ | |||
// EXAMPLE: cmds_generic |
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.
As with NRedisStack, it needs more boilerplate than you actually see in the example tab. Also, the test comment appears in the snippet and there are no tests.
@@ -0,0 +1,64 @@ | |||
// EXAMPLE: cmds_generic |
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.
The Lettuce ones need an examples package declaration and a @Test
marker on the test method (like this file).
@@ -0,0 +1,74 @@ | |||
// EXAMPLE: cmds_generic |
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.
We don't submit PHP examples to the client repo, but for the local test, the code should appear inside a test class (see this file). Also, no actual tests.
Hi @andy-stark-redis. This PR is an experiment to see if Augment can successfully create TCEs in all currently supported languages. At some point, the examples in the local_examples/new_tces/LANG directories can become PRs for each LANG's repo.
I don't have the correct system setup to test each of these; hoping you help here (at some point--no rush). Maybe you can just advise on setup so I can test new examples myself.