etcd-io / website

etcd.io
https://etcd.io
Other
148 stars 297 forks source link

Add Example of Multiple Writes in a Single Transaction to 'How to make multiple writes in a transaction' Tutorial #901

Open romainwg opened 1 month ago

romainwg commented 1 month ago

Current Title of the Web Page: How to make multiple writes in a transaction

Feedback:

I noticed that the current example on the page primarily demonstrates the structure of transactions using if, then, else, and commit statements. However, it does not include an example of making multiple writes within a single transaction.

To enhance the technical clarity and usefulness of this tutorial, I suggest adding an example (or modifying the existing one) to explicitly show how to perform multiple writes in a single transaction. Demonstrating a batch of operations would be particularly beneficial for users looking to understand this functionality better. For instance, an example that includes multiple Put operations within a single transaction would be very helpful.

Thank you for considering this improvement.

jmhbnz commented 1 month ago

Thanks for raising this @romainwg - I agree that page could certainly have some more comprehensive examples.

We should also replicate the change across to the 3.6 version page https://etcd.io/docs/v3.6/tutorials/how-to-transactional-write.

If you have time to propose a pull request please give it a try. I am happy to answer any questions and provide feedback 🙏🏻

NavinShrinivas commented 1 month ago

I'll give this a go! I will make a pr today or tmrw. I wanted to know how the gifs are uploaded to google store. @jmhbnz

NavinShrinivas commented 1 month ago

https://github.com/user-attachments/assets/b599e16e-b1a8-401f-a4e4-262f294f0e5e

I have this gif showing two examples, one with updating/writing to multiple keys

and the second trying two writes to the same transaction and failing

ivanvc commented 1 month ago

I'll give this a go! I will make a pr today or tmrw. I wanted to know how the gifs are uploaded to google store. @jmhbnz

Hi, @NavinShrinivas. The images from the website are embedded in the repository. You can

  1. add it to static/img, and reference it by doing
    {{< figure src="/img/you-file.gif" >}}
  2. or create an img directory in the directory the page you're editing is, then call
    <img src="../img/your-file.gif alt="..." />

After surveying the repository, I don't think there's a standard, so either way should work.

NavinShrinivas commented 1 month ago

Noted! Did the changes in the pr. handled lint too.

awaiting your feedback :)

romainwg commented 1 month ago

Thanks for raising this @romainwg - I agree that page could certainly have some more comprehensive examples.

We should also replicate the change across to the 3.6 version page https://etcd.io/docs/v3.6/tutorials/how-to-transactional-write.

If you have time to propose a pull request please give it a try. I am happy to answer any questions and provide feedback 🙏🏻

Sorry for the delay, here's what I did: https://github.com/etcd-io/website/pull/908

ivanvc commented 3 weeks ago

Hi @romainwg and @NavinShrinivas. I reviewed both of your pull requests. I wouldn't say that one is correct (or better than the other one). But it definitely adds contention to resolve this issue. Given that technically this wasn't assigned to anybody, and that @romainwg originally opened the issue, I would suggest to:

  1. Work together and co-author the commits in a single pull request (ref: GitHub documentation).
  2. We work on the pull requests in a chronological order, and if there are any improvements to @NavinShrinivas, @romainwg works on top of it.

Ideally, I would prefer a single pull request (1). But let me know your thoughts.

romainwg commented 3 weeks ago

Hi @romainwg and @NavinShrinivas. I reviewed both of your pull requests. I wouldn't say that one is correct (or better than the other one). But it definitely adds contention to resolve this issue. Given that technically this wasn't assigned to anybody, and that @romainwg originally opened the issue, I would suggest to:

  1. Work together and co-author the commits in a single pull request (ref: GitHub documentation).
  2. We work on the pull requests in a chronological order, and if there are any improvements to @NavinShrinivas, @romainwg works on top of it.

Ideally, I would prefer a single pull request (1). But let me know your thoughts.

Thank you @ivanvc

I don't want to sound pretentious, but I think our proposals are orthogonal.

On #908:

(And it may be too big for just one PR, but it's simpler for me.)

Also, when I posted the issue I had already started thinking about the best way to illustrate the transaction documentation. Due to lack of time, I wasn't able to propose it straight away.


If it makes things easier for the maintainers, I'll commit to the first PR, but my changes are quite different...