Skip to content

Conversation

dwdougherty
Copy link
Collaborator

@dwdougherty dwdougherty commented Aug 26, 2025

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.

Copy link
Contributor

github-actions bot commented Aug 26, 2025

DOC-5630

Copy link
Contributor

@dwdougherty dwdougherty marked this pull request as draft August 26, 2025 17:15
Copy link
Contributor

@andy-stark-redis andy-stark-redis left a 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 in doctests", 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
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants