cob: Include head in initial patch entry in DAG

This change ensures that we include as a parent to the initial commit
of a patch COB, the head of the branch we are proposing as a patch.

This was already happening for patch updates, but we forgot to also
include it for the initial patch revision.

This ensures that the code is always fetched alongside the patch.
This commit is contained in:
Alexis Sellier 2023-04-28 20:47:18 +02:00
parent 76eb7c08a1
commit 649d59f143
No known key found for this signature in database
11 changed files with 88 additions and 79 deletions

View File

@ -6,7 +6,7 @@ delegates creating proposals concurrently.
```
$ rad id edit --title "Add Alice" --description "Add Alice as a delegate" --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm
✓ Identity proposal '04603c0d3ea4d137487024a51c9360adfc511114' created
✓ Identity proposal 'f4579d0a9a068453cb24da1ad048ca1bfdcb6d98' created
title: Add Alice
description: Add Alice as a delegate
status: open
@ -48,7 +48,7 @@ Quorum Reached
```
$ rad id edit --title "Add Bob" --description "Add Bob as a delegate" --delegates did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG --no-confirm
✓ Identity proposal '3f6ae4f8645c8b0cbcd35ea924df7b13aca52774' created
✓ Identity proposal '5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f' created
title: Add Bob
description: Add Bob as a delegate
status: open
@ -93,7 +93,7 @@ second proposal, then the identity would be out of date. So let's run
through that and see what happens.
```
$ rad id accept 04603c0d3ea4d137487024a51c9360adfc511114 --no-confirm
$ rad id accept f4579d0a9a068453cb24da1ad048ca1bfdcb6d98 --no-confirm
✓ Accepted proposal ✓
title: Add Alice
description: Add Alice as a delegate
@ -137,7 +137,7 @@ Quorum Reached
```
```
$ rad id commit 04603c0d3ea4d137487024a51c9360adfc511114 --no-confirm
$ rad id commit f4579d0a9a068453cb24da1ad048ca1bfdcb6d98 --no-confirm
✓ Committed new identity '29ae4b72f5a315328f06fbd68dc1c396a2d5c45e'
title: Add Alice
description: Add Alice as a delegate
@ -183,7 +183,7 @@ Quorum Reached
Now, when we go to accept the second proposal:
```
$ rad id accept 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --no-confirm
$ rad id accept 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --no-confirm
! Warning: Revision is out of date
! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f
👉 Consider using 'rad id rebase' to update the proposal to the latest identity
@ -238,19 +238,19 @@ Note that a warning was emitted:
If we attempt to commit this revision, the command will fail:
```
$ rad id commit 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --no-confirm
$ rad id commit 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --no-confirm
! Warning: Revision is out of date
! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f
👉 Consider using 'rad id rebase' to update the proposal to the latest identity
✗ Id failed: the identity hashes do match 'd96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f' for the revision '3f6ae4f8645c8b0cbcd35ea924df7b13aca52774'
✗ Id failed: the identity hashes do match 'd96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f' for the revision '5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f'
```
So, let's fix this by running a rebase on the proposal's revision:
```
$ rad id rebase 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --no-confirm
✓ Identity proposal '3f6ae4f8645c8b0cbcd35ea924df7b13aca52774' rebased
✓ Revision 'a6db848f8dba4ef2a9c16301e7d21ad87b707f1e'
$ rad id rebase 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --no-confirm
✓ Identity proposal '5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f' rebased
✓ Revision '45477572abd02ea6fc3d3e710e034bb60c74038b'
title: Add Bob
description: Add Bob as a delegate
status: open
@ -293,9 +293,9 @@ Quorum Reached
We can now update the proposal to have both keys in the delegates set:
```
$ rad id update 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --rev a6db848f8dba4ef2a9c16301e7d21ad87b707f1e --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm
✓ Identity proposal '3f6ae4f8645c8b0cbcd35ea924df7b13aca52774' updated
✓ Revision '4bac5e3ef20e412e9421886fbb76dc7a64d6b5dc'
$ rad id update 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --rev 45477572abd02ea6fc3d3e710e034bb60c74038b --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm
✓ Identity proposal '5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f' updated
✓ Revision '66f68597d031f9678e704204bea5ce7f020c98e7'
title: Add Bob
description: Add Bob as a delegate
status: open
@ -338,10 +338,10 @@ Quorum Reached
Finally, we can accept and commit this proposal, creating the final
state of our new Radicle identity:
$ rad id show 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --revisions
$ rad id show 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --revisions
```
$ rad id accept 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --rev 4bac5e3ef20e412e9421886fbb76dc7a64d6b5dc --no-confirm
$ rad id accept 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --rev 66f68597d031f9678e704204bea5ce7f020c98e7 --no-confirm
✓ Accepted proposal ✓
title: Add Bob
description: Add Bob as a delegate
@ -385,7 +385,7 @@ Quorum Reached
```
```
$ rad id commit 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --rev 4bac5e3ef20e412e9421886fbb76dc7a64d6b5dc --no-confirm
$ rad id commit 5d6c0faeeb5ed5e0d66c72d853a6131a35228d3f --rev 66f68597d031f9678e704204bea5ce7f020c98e7 --no-confirm
✓ Committed new identity '60de897bc24898f6908fd1272633c0b15aa4096f'
title: Add Bob
description: Add Bob as a delegate

View File

@ -14,7 +14,7 @@ Let's add Bob as a delegate using their DID
```
$ rad id edit --title "Add Bob" --description "Add Bob as a delegate" --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm
✓ Identity proposal '0d396a83a5e1dda2b8929f7dc401d19dd1a79fb8' created
✓ Identity proposal 'c2fe23ff387d5e040d0ed8eb2651942f5d0c2aa5' created
title: Add Bob
description: Add Bob as a delegate
status: open
@ -89,7 +89,7 @@ Finally, we can see whether the `Quorum` was reached:
Let's see what happens when we reject the change:
```
$ rad id reject 0d396a83a5e1dda2b8929f7dc401d19dd1a79fb8 --no-confirm
$ rad id reject c2fe23ff387d5e040d0ed8eb2651942f5d0c2aa5 --no-confirm
✓ Rejected proposal 👎
title: Add Bob
description: Add Bob as a delegate
@ -145,7 +145,7 @@ increased to `1`.
Instead, let's accept the proposal:
```
$ rad id accept 0d396a --no-confirm
$ rad id accept c2fe23f --no-confirm
✓ Accepted proposal ✓
title: Add Bob
description: Add Bob as a delegate
@ -207,7 +207,7 @@ As well as that, the `Quorum` has now been reached:
At this point, we can commit the proposal and update the identity:
```
$ rad id commit 0d396a83a5e1dda2b8929f7dc401d19dd1a79fb8 --no-confirm
$ rad id commit c2fe23ff387d5e040d0ed8eb2651942f5d0c2aa5 --no-confirm
✓ Committed new identity 'c96e764965aaeff1c6ea3e5b97e2b9828773c8b0'
title: Add Bob
description: Add Bob as a delegate
@ -255,7 +255,7 @@ the `--threshold` option:
```
$ rad id edit --title "Update threshold" --description "Update to safer threshold" --threshold 2 --no-confirm
✓ Identity proposal 'f435d6e89c8f922ede691287c0d8b7f82afa591e' created
✓ Identity proposal '27864167e392d63e77df2a7413c988857bd32839' created
title: Update threshold
description: Update to safer threshold
status: open
@ -298,8 +298,8 @@ Quorum Reached
But we change our minds and decide to close the proposal instead:
```
$ rad id close f435d6e89c8f922ede691287c0d8b7f82afa591e --no-confirm
✓ Closed identity proposal 'f435d6e89c8f922ede691287c0d8b7f82afa591e'
$ rad id close 27864167e392d63e77df2a7413c988857bd32839 --no-confirm
✓ Closed identity proposal '27864167e392d63e77df2a7413c988857bd32839'
title: Update threshold
description: Update to safer threshold
status: closed
@ -348,15 +348,15 @@ Radicle identity, then we can use the list command:
```
$ rad id list
0d396a83a5e1dda2b8929f7dc401d19dd1a79fb8 "Add Bob" committed
f435d6e89c8f922ede691287c0d8b7f82afa591e "Update threshold" closed
27864167e392d63e77df2a7413c988857bd32839 "Update threshold" closed
c2fe23ff387d5e040d0ed8eb2651942f5d0c2aa5 "Add Bob" committed
```
And if we want to view the latest state of any proposal we can use the
show command:
```
$ rad id show f435d6e89c8f922ede691287c0d8b7f82afa591e
$ rad id show 27864167e392d63e77df2a7413c988857bd32839
title: Update threshold
description: Update to safer threshold
status: closed

View File

@ -9,16 +9,16 @@ To open a patch in draft mode, we use the `--draft` option:
```
$ rad patch open --draft -m "Nothing yet" --quiet
3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
```
We can confirm it's a draft by running `show`:
```
$ rad patch show 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
$ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
│ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │
│ Branches cloudhead/draft │
@ -32,14 +32,14 @@ $ rad patch show 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
Once the patch is ready for review, we can use the `ready` command:
```
$ rad patch ready 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
$ rad patch ready 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
```
```
$ rad patch show 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
$ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
│ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │
│ Branches cloudhead/draft │
@ -54,11 +54,11 @@ If for whatever reason, it needed to go back into draft mode, we could use
the `--undo` flag:
```
$ rad patch ready --undo 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
$ rad patch show 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
$ rad patch ready --undo 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
$ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch 3bdbfc4f85b942293ba7adb8e47bf3202a602e8b
│ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │
│ Branches cloudhead/draft │

View File

@ -31,7 +31,7 @@ master <- z6MknSL…StBU8Vi/flux-capacitor-power (3e674d1)
3e674d1 Define power requirements
✓ Patch 191a14e520f2eeff7c0e3ee0a5523c5217eecb89 created
✓ Patch de3096d5cc422136016ac210b870bfa9d0f11481 created
To publish your patch to the network, run:
git push rad
@ -44,14 +44,14 @@ $ rad patch
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Opened │
├──────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 191a14e Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 4 months ago │
│ ● de3096d Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 4 months ago │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
```
```
$ rad patch show 191a14e520f2eeff7c0e3ee0a5523c5217eecb89 -p
$ rad patch show de3096d5cc422136016ac210b870bfa9d0f11481 -p
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 191a14e520f2eeff7c0e3ee0a5523c5217eecb89
│ Patch de3096d5cc422136016ac210b870bfa9d0f11481
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │
│ Branches flux-capacitor-power │
@ -91,52 +91,52 @@ $ git commit --message "Add README, just for the fun"
[flux-capacitor-power 27857ec] Add README, just for the fun
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
$ rad patch update --message "Add README, just for the fun" 191a14e520f2eeff7c0e3ee0a5523c5217eecb89
$ rad patch update --message "Add README, just for the fun" de3096d5cc422136016ac210b870bfa9d0f11481
Updating 3e674d1 -> 27857ec
1 commit(s) ahead, 0 commit(s) behind
✓ Patch updated to revision b8f7bfbbb3c6a207b349e9f45bf535c706805871
✓ Patch updated to revision d00f978a43a255c7f2f9f23d39b555d103900c6d
```
And let's leave a quick comment for our team:
```
$ rad comment 191a14e520f2eeff7c0e3ee0a5523c5217eecb89 --message 'I cannot wait to get back to the 90s!'
16cb902f2657dc6ff9cf0f2c1a6ec4dc63340d23
$ rad comment 191a14e520f2eeff7c0e3ee0a5523c5217eecb89 --message 'I cannot wait to get back to the 90s!' --reply-to 16cb902f2657dc6ff9cf0f2c1a6ec4dc63340d23
16363eca043df797de835fca477848ee37513084
$ rad comment de3096d5cc422136016ac210b870bfa9d0f11481 --message 'I cannot wait to get back to the 90s!'
225353d1b9195f6cf4cfe098ce7935d4c933c36e
$ rad comment de3096d5cc422136016ac210b870bfa9d0f11481 --message 'I cannot wait to get back to the 90s!' --reply-to 225353d1b9195f6cf4cfe098ce7935d4c933c36e
089c2d74d18036c75b1b4d3a32770c720a6967e2
```
Now, let's checkout the patch that we just created:
```
$ rad patch checkout 191a14e52
✓ Switched to branch patch/191a14e
$ rad patch checkout de3096d
✓ Switched to branch patch/de3096d
```
We can also add a review verdict as such:
```
$ rad review 191a14e520f2eeff7c0e3ee0a5523c5217eecb89 --accept --no-message --no-sync
✓ Patch 191a14e accepted
$ rad review de3096d5cc422136016ac210b870bfa9d0f11481 --accept --no-message --no-sync
✓ Patch de3096d accepted
```
Showing the patch list now will reveal the favorable verdict:
```
$ rad patch show 191a14e
$ rad patch show de3096d
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 191a14e520f2eeff7c0e3ee0a5523c5217eecb89
│ Patch de3096d5cc422136016ac210b870bfa9d0f11481
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Branches flux-capacitor-power, patch/191a14e
│ Branches flux-capacitor-power, patch/de3096d
│ Commits ahead 2, behind 0 │
│ Status open │
│ │
│ See details. │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ]│
│ ↑ updated to b8f7bfbbb3c6a207b349e9f45bf535c706805871 (27857ec) [ ... ]│
│ ↑ updated to d00f978a43a255c7f2f9f23d39b555d103900c6d (27857ec) [ ... ]│
│ ✓ accepted by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ]│
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```

View File

@ -31,7 +31,7 @@ master <- z6Mkt67…v4N1tRk/flux-capacitor-power (3e674d1)
3e674d1 Define power requirements
✓ Patch a07ef7743a32a2e902672ea3526d1db6ee08108a created
✓ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 created
To publish your patch to the network, run:
git push rad
@ -44,12 +44,12 @@ $ rad patch
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Opened │
├──────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● a07ef77 Define power requirements z6Mkt67…v4N1tRk (you) 3e674d1 +0 -0 4 months ago │
│ ● 5f0a547 Define power requirements z6Mkt67…v4N1tRk (you) 3e674d1 +0 -0 4 months ago │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
$ rad patch show a07ef7743a32a2e902672ea3526d1db6ee08108a
$ rad patch show 5f0a547f7a91bf002bb0542035a647fd5af134a5
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a07ef7743a32a2e902672ea3526d1db6ee08108a
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
│ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │
│ Branches flux-capacitor-power │
@ -71,15 +71,15 @@ $ git commit --message "Add README, just for the fun"
[flux-capacitor-power 27857ec] Add README, just for the fun
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
$ rad patch update --message "Add README, just for the fun" a07ef7743a32a2e902672ea3526d1db6ee08108a
$ rad patch update --message "Add README, just for the fun" 5f0a547f7a91bf002bb0542035a647fd5af134a5
Updating 3e674d1 -> 27857ec
1 commit(s) ahead, 0 commit(s) behind
✓ Patch updated to revision 11483929d8714a92992229f65433e06288f3b760
✓ Patch updated to revision b7e2356fb7e3981980b42603eea969851d17a40d
```
And let's leave a quick comment for our team:
```
$ rad comment a07ef7743a32a2e902672ea3526d1db6ee08108a --message 'I cannot wait to get back to the 90s!'
18987961eb5e5a8c7fb1fb58f514030d3ea69802
$ rad comment 5f0a547f7a91bf002bb0542035a647fd5af134a5 --message 'I cannot wait to get back to the 90s!'
a15e976e4273971d6695eff2e07a57a82133567f
```

View File

@ -26,10 +26,10 @@ $ git branch -r
bob/flux-capacitor-power
bob/master
rad/master
$ rad patch show a07ef77
$ rad patch show 5f0a547
╭───────────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a07ef7743a32a2e902672ea3526d1db6ee08108a
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Commits ahead 2, behind 0 │
@ -38,7 +38,7 @@ $ rad patch show a07ef77
│ See details. │
├───────────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk [ ... ] │
│ ↑ updated to 11483929d8714a92992229f65433e06288f3b760 (27857ec) [ ... ] │
│ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │
╰───────────────────────────────────────────────────────────────────────────────────╯
```
@ -55,10 +55,10 @@ $ git commit --fixup HEAD~
[flux-capacitor-power f6484e0] fixup! Define power requirements
1 file changed, 0 insertions(+), 0 deletions(-)
rename REQUIREMENTS => REQUIREMENTS.md (100%)
$ rad patch update --message "Define power requirements" --message "See details." a07ef7743a32a2e902672ea3526d1db6ee08108a
$ rad patch update --message "Define power requirements" --message "See details." 5f0a547f7a91bf002bb0542035a647fd5af134a5
Updating 27857ec -> f6484e0
1 commit(s) ahead, 0 commit(s) behind
✓ Patch updated to revision 0795d619232479e910f95bb9c873ee1ec305c43c
✓ Patch updated to revision 4486280d0dec743d6a1a0c05754f8e40426c681d
```
Great, all fixed up, lets merge the code.
@ -66,8 +66,8 @@ Great, all fixed up, lets merge the code.
```
$ git checkout master
Your branch is up to date with 'rad/master'.
$ rad merge 0795d619232479e910f95bb9c873ee1ec305c43c
Merging a07ef77 R2 (f6484e0) by z6Mkt67…v4N1tRk into master (f2de534) via fast-forward...
$ rad merge 4486280d0dec743d6a1a0c05754f8e40426c681d
Merging 5f0a547 R2 (f6484e0) by z6Mkt67…v4N1tRk into master (f2de534) via fast-forward...
Running `git merge --ff-only f6484e0f43e48a8983b9b39bf9bd4cd889f1d520`...
Updating f2de534..f6484e0
Fast-forward
@ -83,10 +83,10 @@ Fast-forward
The patch is now merged and closed :).
```
$ rad patch show a07ef77
$ rad patch show 5f0a547
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a07ef7743a32a2e902672ea3526d1db6ee08108a
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
│ Head f6484e0f43e48a8983b9b39bf9bd4cd889f1d520 │
│ Branches flux-capacitor-power, master │
@ -96,8 +96,8 @@ $ rad patch show a07ef77
│ See details. │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk [ ... ] │
│ ↑ updated to 11483929d8714a92992229f65433e06288f3b760 (27857ec) [ ... ] │
│ ↑ updated to 0795d619232479e910f95bb9c873ee1ec305c43c (f6484e0) [ ... ] │
│ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │
│ ↑ updated to 4486280d0dec743d6a1a0c05754f8e40426c681d (f6484e0) [ ... ] │
│ ✓ merged by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```

View File

@ -52,6 +52,7 @@ pub fn create<S, G>(
storage: &S,
signer: &G,
resource: Oid,
parents: Vec<Oid>,
identifier: &S::Identifier,
args: Create,
) -> Result<CollaborativeObject, error::Create>
@ -61,7 +62,7 @@ where
{
let Create { ref typename, .. } = &args;
let init_change = storage
.store(resource, vec![], signer, args.template())
.store(resource, parents, signer, args.template())
.map_err(error::Create::from)?;
let object_id = init_change.id().into();

View File

@ -28,6 +28,7 @@ fn roundtrip() {
&storage,
&signer,
proj.project.content_id,
vec![],
&proj.identifier(),
Create {
history_type: "test".to_string(),
@ -60,6 +61,7 @@ fn list_cobs() {
&storage,
&signer,
proj.project.content_id,
vec![],
&proj.identifier(),
Create {
history_type: "test".to_string(),
@ -74,6 +76,7 @@ fn list_cobs() {
&storage,
&signer,
proj.project.content_id,
vec![],
&proj.identifier(),
Create {
history_type: "test".to_string(),
@ -108,6 +111,7 @@ fn update_cob() {
&storage,
&signer,
proj.project.content_id,
vec![],
&proj.identifier(),
Create {
history_type: "test".to_string(),
@ -167,6 +171,7 @@ fn traverse_cobs() {
&storage,
&terry_signer,
terry_proj.project.content_id,
vec![],
&terry_proj.identifier(),
Create {
contents: nonempty!(b"issue 1".to_vec()),

View File

@ -1784,7 +1784,7 @@ mod routes {
#[tokio::test]
async fn test_projects_create_patches() {
const CREATED_PATCH_ID: &str = "f69641cba6d7df2c22844d7f39225b5cda54d363";
const CREATED_PATCH_ID: &str = "198b7bc8d19ef2f09e9fbd30645a46e4cd520713";
let tmp = tempfile::tempdir().unwrap();
let ctx = contributor(tmp.path());
@ -1978,7 +1978,7 @@ mod routes {
"reviews": [],
},
{
"id": "b1a8c5b3e1686891808fcac0d795d0bad1e69709",
"id": "660ce23a54788d85d44a133357b53fc99f5d7a92",
"description": "This is a new revision",
"base": PARENT,
"oid": HEAD,

View File

@ -37,9 +37,9 @@ pub const CONTRIBUTOR_RID: &str = "rad:z4XaCmN3jLSeiMvW15YTDpNbDHFhG";
pub const CONTRIBUTOR_DID: &str = "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8";
pub const CONTRIBUTOR_NID: &str = "z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8";
pub const CONTRIBUTOR_ISSUE_ID: &str = "f1dff128a22e8183a23516dd9812e72e80914c92";
pub const CONTRIBUTOR_PATCH_ID: &str = "4b7ea91da1f551bc5ea5d2057125d7ba42d451cb";
pub const CONTRIBUTOR_COMMENT_1: &str = "8f6e72c20da0e6ee2af004f059ced23d409a285a";
pub const CONTRIBUTOR_COMMENT_2: &str = "c88ce78b17a705f389e72ec5c80da7360a675e51";
pub const CONTRIBUTOR_PATCH_ID: &str = "dcac7b6a320ce94e9a801ff9d766a04d24f63062";
pub const CONTRIBUTOR_COMMENT_1: &str = "ec1c721cb3f726c3c0455519034c3a8b1a6ebaef";
pub const CONTRIBUTOR_COMMENT_2: &str = "4458381a73ff68063311d440538aff4b48122b9c";
const PASSWORD: &str = "radicle";

View File

@ -181,11 +181,14 @@ where
actions: impl Into<NonEmpty<T::Action>>,
signer: &G,
) -> Result<(ObjectId, T, Lamport), Error> {
let contents = actions.into().try_map(encoding::encode)?;
let actions = actions.into();
let parents = actions.iter().flat_map(T::Action::parents).collect();
let contents = actions.try_map(encoding::encode)?;
let cob = cob::create(
self.repo,
signer,
self.identity,
parents,
signer.public_key(),
Create {
history_type: HISTORY_TYPE.to_owned(),