-
Notifications
You must be signed in to change notification settings - Fork 35
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
Consolidate and Automate tutorial testing #266
Comments
see discussion below |
I am worried that this issue will be understood as just test tutorials on ci When in reality, I want to solve the problem of constant copy-pasting and tutorial updates. If all tutorial is just one well commented contract code, then you don't need constant updates or maintenance E.g. recently Jan replaced Think a spike on this is necessary - maybe create a different issue? wdyt @critesjosh |
I like the suggestion of having all of the code / text for a tutorial in 1 file (right now it is spread across the source code and docs files). We could write the tutorial text directly in contract file and create a parser to extract text blocks from the code, similar to how the At the top of each tutorial page, we could have a button to open the tutorial in a Github codespace. The codespace would open with the relevant aztec contract, which would have all of the tutorial text directly embedded in it, so devs wouldnt have to leave the codespace to go through the tutorial. Alternatively, if someone was just using the page as a reference, all of the text and code from the Aztec contract file would be displayed to read on the docs. I like this idea. Is this what you are thinking Rahul? If yes, I don't think we need another issue, We can just use this one to pursue the path I described and I will updated my comments above. Taking this route would mean that the link I shared above is not a suitable path. That guide doesn't consider source code injection like we have with |
Yes exactly!! |
So talking with @critesjosh we concluded that we want it to be easily maintainable so it makes sense to pull as much as possible from source. But we also want a tutorial to be interactive, not a reading document. I'll have this in consideration, I'll also consider a third possibility which is to make it test-driven, sort of like a "game". The tutorial being essentially a codespace that has a number of tests already running, and as it proceeds on the tutorial, some tests will start passing. At the end the user has a bunch of green ticks, has learned, and has a boilerplate. This would make the tutorial both easy to maintain (we're reusing existing tests for these very same contracts), but also interactive. In any case I'll spike and share in a notion doc as usual hehe |
I have been receiving consistent feedback on how they don't want it to be interactive You can do both though - hyperlink the reading doc. And then tell people to read the interactive. Note that if you do interactive you have the exact same problems as today (where explanations are always out of date and engineers need to keep maintaining it) |
If the source code has comments that get injected into the tutorial, it should be clear when the explanations for the following/preceding function are out of date, since it's right next to the source. But I agree we could do both. There could be a link at the top of the tutorial to see the complete tutorial code in a codespace, if the reader just wants a reference, or they could proceed through the interactive tutorial to go through the motions and actively learn. |
Finally had some time to think about this. Short conclusion: I'm dropping the idea of keeping the tutorial text together with the code. Long conclusion: They have different goalsThis is the main reason.
In short, a tutorial is meant to be sound, not complete. The copy-pasting is a symptom that we're expecting completeness. Copy-pasting is the equivalent of making an amazing drawing, giving it to your kid to paint a little corner, and convincing him he drew the whole thing. Heck, I would play a full song in the piano so my students could play the only note they knew how to play and be like "look mom! I'm making music!". This is not easy to do with grown-up software developers. So we should give up copy-pasting. My proposalI made an ordered list of tutorial capital sins. You may disagree, but I had to start somewhere.
I believe we are focusing too much on the 4th instead of the other ones. We want to teach incredibly complex software as #1 prio and I believe that's a mistake. So going down the list, we start writing tutorials that are:
This means I would not have a tutorial for anything currently in our codebase. I would use those in how-to guides, which allow for a boilerplate and extensive pre-requisites. You can tell the reader "we assume you already finished the tutorial" in order to skip the copy-pasting, start from an arbitrary knowledge pre-requisite, and go straight to the point. I'll try refactoring one of the tutorials, and we can decide if this would be a good way forwards |
I chatted with @signorecello a bit about this this morning and he said it succinctly. If a tutorial is being used to refer to how to do something, it should be in the Guides section, not a Tutorial. Tutorials should be strictly for learning and should not be used as a reference. I think the feedback that @rahul-kothari received is an indication that devs couldn't find a section of the docs that showed them how to do the thing that they wanted to do, so they were going through the tutorial because they knew the info was in there. Hopefully the docs structure refactor makes the relevant information easier to find, and if not we should add the relevant how-tos to the Guides section. |
Playwright testing is working locally, not with earthly. Debugging |
The following is from Rahul:
There are several issues with our tutorials today:
Potential solution:
Document our contracts and relevant e2e tests very very well.
Tutorials will now
This does a few things:
there is an additional problem I am trying to solve for -> minimising the number of copy-pastes and instead having 1-2 files of really well documented code.
The text was updated successfully, but these errors were encountered: