cli: Show alias on `rad issue` and `rad patch`

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
This commit is contained in:
xphoniex 2023-05-08 15:50:46 +00:00 committed by Alexis Sellier
parent 216f48b7f1
commit 95e3b9673d
No known key found for this signature in database
12 changed files with 297 additions and 222 deletions

View File

@ -17,11 +17,11 @@ The issue is now listed under our project.
``` ```
$ rad issue list $ rad issue list
╭───────────────────────────────────────────────────────────────────────────────────────────────╮ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● ID Title Author Tags Assignees Opened │ │ ● ID Title Author Tags Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────┤ ├───────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● 2e8c1bf flux capacitor underpowered z6MknSL…StBU8Vi [ .. ] │ │ ● 2e8c1bf flux capacitor underpowered z6MknSL…StBU8Vi (you) [ .. ] │
╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────
``` ```
Show the issue information issue. Show the issue information issue.
@ -52,11 +52,11 @@ It will now show in the list of issues assigned to us.
``` ```
$ rad issue list --assigned $ rad issue list --assigned
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● ID Title Author Tags Assignees Opened │ │ ● ID Title Author Tags Assignees Opened │
├─────────────────────────────────────────────────────────────────────────────────────────────────────┤ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● 2e8c1bf flux capacitor underpowered z6MknSL…StBU8Vi z6MknSL…StBU8Vi [ .. ] │ │ ● 2e8c1bf flux capacitor underpowered z6MknSL…StBU8Vi (you) z6MknSL…StBU8Vi [ .. ] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────
``` ```
Note: this can always be undone with the `unassign` subcommand. Note: this can always be undone with the `unassign` subcommand.

View File

@ -16,7 +16,7 @@ We can confirm it's a draft by running `show`:
``` ```
$ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e $ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
╭───────────────────────────────────────────────────────────────────────────────────────── ╭────────────────────────────────────────────────────────────────────╮
│ Title Nothing yet │ │ Title Nothing yet │
│ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e │ │ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -24,11 +24,11 @@ $ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
│ Branches cloudhead/draft │ │ Branches cloudhead/draft │
│ Commits ahead 1, behind 0 │ │ Commits ahead 1, behind 0 │
│ Status draft │ │ Status draft │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ 2a46583 Nothing to see here.. │ │ 2a46583 Nothing to see here.. │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰────────────────────────────────────────────────────────────────────╯
``` ```
Once the patch is ready for review, we can use the `ready` command: Once the patch is ready for review, we can use the `ready` command:
@ -39,7 +39,7 @@ $ rad patch ready 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
``` ```
$ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e $ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
╭───────────────────────────────────────────────────────────────────────────────────────── ╭────────────────────────────────────────────────────────────────────╮
│ Title Nothing yet │ │ Title Nothing yet │
│ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e │ │ Patch 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -47,11 +47,11 @@ $ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
│ Branches cloudhead/draft │ │ Branches cloudhead/draft │
│ Commits ahead 1, behind 0 │ │ Commits ahead 1, behind 0 │
│ Status open │ │ Status open │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ 2a46583 Nothing to see here.. │ │ 2a46583 Nothing to see here.. │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰────────────────────────────────────────────────────────────────────╯
``` ```
If for whatever reason, it needed to go back into draft mode, we could use If for whatever reason, it needed to go back into draft mode, we could use
@ -71,5 +71,5 @@ $ rad patch show 6d7793b859860db775fd8ff1d18ffb6de2b9ca0e
├─────────────────────────────────────────────────────────────────────────────────────────┤ ├─────────────────────────────────────────────────────────────────────────────────────────┤
│ 2a46583 Nothing to see here.. │ │ 2a46583 Nothing to see here.. │
├─────────────────────────────────────────────────────────────────────────────────────────┤ ├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╰─────────────────────────────────────────────────────────────────────────────────────────╯

View File

@ -17,7 +17,7 @@ We can see a patch was created:
``` ```
$ rad patch show 8f0e8ec $ rad patch show 8f0e8ec
╭───────────────────────────────────────────────────────────────────────────────────────── ╭────────────────────────────────────────────────────────────────────╮
│ Title Add things │ │ Title Add things │
│ Patch 8f0e8ecb47a17e8f3219f33150a4092d645e4875 │ │ Patch 8f0e8ecb47a17e8f3219f33150a4092d645e4875 │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -25,11 +25,11 @@ $ rad patch show 8f0e8ec
│ Branches feature/1 │ │ Branches feature/1 │
│ Commits ahead 1, behind 0 │ │ Commits ahead 1, behind 0 │
│ Status open │ │ Status open │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ 42d894a Add things │ │ 42d894a Add things │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ .. ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰────────────────────────────────────────────────────────────────────╯
``` ```
If we check our local branch, we can see its upstream is set to track a remote If we check our local branch, we can see its upstream is set to track a remote
@ -135,7 +135,7 @@ We can then see that the patch head has moved:
``` ```
$ rad patch show 8678aaf $ rad patch show 8678aaf
╭───────────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Add more things │ │ Title Add more things │
│ Patch 8678aafff1d1e28430952abf431e60b87e28023c │ │ Patch 8678aafff1d1e28430952abf431e60b87e28023c │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -143,14 +143,14 @@ $ rad patch show 8678aaf
│ Branches feature/2 │ │ Branches feature/2 │
│ Commits ahead 3, behind 0 │ │ Commits ahead 3, behind 0 │
│ Status open │ │ Status open │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ 662843e Improve code │ │ 662843e Improve code │
│ b94a835 Add more things │ │ b94a835 Add more things │
│ 42d894a Add things │ │ 42d894a Add things │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
│ ↑ updated to 4b6618a6ccb0b406659364a70a00bb60e4cd7cf0 (662843e) [ ... ] │ │ ↑ updated to 4b6618a6ccb0b406659364a70a00bb60e4cd7cf0 (662843e) [ ... ] │
╰───────────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```
And we can check that all the refs are properly updated in our repository: And we can check that all the refs are properly updated in our repository:
@ -212,7 +212,7 @@ That worked. We can see the new revision if we call `rad patch show`:
``` ```
$ rad patch show 8678aaf $ rad patch show 8678aaf
╭───────────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Add more things │ │ Title Add more things │
│ Patch 8678aafff1d1e28430952abf431e60b87e28023c │ │ Patch 8678aafff1d1e28430952abf431e60b87e28023c │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -220,13 +220,13 @@ $ rad patch show 8678aaf
│ Branches feature/2 │ │ Branches feature/2 │
│ Commits ahead 3, behind 0 │ │ Commits ahead 3, behind 0 │
│ Status open │ │ Status open │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ 3507cd5 Amended commit │ │ 3507cd5 Amended commit │
│ b94a835 Add more things │ │ b94a835 Add more things │
│ 42d894a Add things │ │ 42d894a Add things │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
│ ↑ updated to 4b6618a6ccb0b406659364a70a00bb60e4cd7cf0 (662843e) [ ... ] │ │ ↑ updated to 4b6618a6ccb0b406659364a70a00bb60e4cd7cf0 (662843e) [ ... ] │
│ ↑ updated to 983f2d21c9fbe91c21ddfbcd3e3d6cd13db0a944 (3507cd5) [ ... ] │ │ ↑ updated to 983f2d21c9fbe91c21ddfbcd3e3d6cd13db0a944 (3507cd5) [ ... ] │
╰───────────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```

View File

@ -49,7 +49,7 @@ $ rad patch
``` ```
``` ```
$ rad patch show de3096d5cc422136016ac210b870bfa9d0f11481 -p $ rad patch show de3096d5cc422136016ac210b870bfa9d0f11481 -p
╭───────────────────────────────────────────────────────────────────────────────────────── ╭────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │ │ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -59,11 +59,11 @@ $ rad patch show de3096d5cc422136016ac210b870bfa9d0f11481 -p
│ Status open │ │ Status open │
│ │ │ │
│ See details. │ │ See details. │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰────────────────────────────────────────────────────────────────────╯
commit 3e674d1a1df90807e934f9ae5da2591dd6848a33 commit 3e674d1a1df90807e934f9ae5da2591dd6848a33
Author: radicle <radicle@localhost> Author: radicle <radicle@localhost>
@ -126,7 +126,7 @@ Showing the patch list now will reveal the favorable verdict:
``` ```
$ rad patch show de3096d $ rad patch show de3096d
╭───────────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │ │ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -136,14 +136,14 @@ $ rad patch show de3096d
│ Status open │ │ Status open │
│ │ │ │
│ See details. │ │ See details. │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ 27857ec Add README, just for the fun │ │ 27857ec Add README, just for the fun │
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
│ ↑ updated to d00f978a43a255c7f2f9f23d39b555d103900c6d (27857ec) [ ... ]│ │ ↑ updated to d00f978a43a255c7f2f9f23d39b555d103900c6d (27857ec) [ ... ]
│ ✓ accepted by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ✓ accepted by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```
If you make a mistake on the patch description, you can always change it! If you make a mistake on the patch description, you can always change it!
@ -151,7 +151,7 @@ If you make a mistake on the patch description, you can always change it!
``` ```
$ rad patch edit de3096d --message "Define power requirements" --message "Add requirements file" $ rad patch edit de3096d --message "Define power requirements" --message "Add requirements file"
$ rad patch show de3096d $ rad patch show de3096d
╭───────────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │ │ Patch de3096d5cc422136016ac210b870bfa9d0f11481 │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ │ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
@ -161,12 +161,12 @@ $ rad patch show de3096d
│ Status open │ │ Status open │
│ │ │ │
│ Add requirements file │ │ Add requirements file │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ 27857ec Add README, just for the fun │ │ 27857ec Add README, just for the fun │
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ● opened by (you) (z6MknSL…StBU8Vi) [ ... ]
│ ↑ updated to d00f978a43a255c7f2f9f23d39b555d103900c6d (27857ec) [ ... ]│ │ ↑ updated to d00f978a43a255c7f2f9f23d39b555d103900c6d (27857ec) [ ... ]
│ ✓ accepted by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ✓ accepted by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```

View File

@ -17,11 +17,11 @@ The issue is now listed under our project.
``` ```
$ rad issue list $ rad issue list
╭───────────────────────────────────────────────────────────────────────────────────────────────╮ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● ID Title Author Tags Assignees Opened │ │ ● ID Title Author Tags Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────┤ ├───────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● b05e945 flux capacitor underpowered z6Mkt67…v4N1tRk [ .. ] │ │ ● b05e945 flux capacitor underpowered z6Mkt67…v4N1tRk (you) [ .. ] │
╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────
``` ```
Great! Now we've documented the issue for ourselves and others. Great! Now we've documented the issue for ourselves and others.
@ -39,11 +39,11 @@ It will now show in the list of issues assigned to us.
``` ```
$ rad issue list --assigned $ rad issue list --assigned
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● ID Title Author Tags Assignees Opened │ │ ● ID Title Author Tags Assignees Opened │
├─────────────────────────────────────────────────────────────────────────────────────────────────────┤ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ● b05e945 flux capacitor underpowered z6Mkt67…v4N1tRk z6Mkt67…v4N1tRk [ .. ] │ │ ● b05e945 flux capacitor underpowered z6Mkt67…v4N1tRk (you) z6Mkt67…v4N1tRk [ .. ] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────
``` ```
In addition, you can see that when you run `rad issue show` you are listed under the `Assignees`. In addition, you can see that when you run `rad issue show` you are listed under the `Assignees`.

View File

@ -47,7 +47,7 @@ $ rad patch
│ ● 5f0a547 Define power requirements z6Mkt67…v4N1tRk (you) 3e674d1 +0 -0 [ ... ] │ │ ● 5f0a547 Define power requirements z6Mkt67…v4N1tRk (you) 3e674d1 +0 -0 [ ... ] │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
$ rad patch show 5f0a547f7a91bf002bb0542035a647fd5af134a5 $ rad patch show 5f0a547f7a91bf002bb0542035a647fd5af134a5
╭───────────────────────────────────────────────────────────────────────────────────────── ╭────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │ │ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │ │ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
@ -57,11 +57,11 @@ $ rad patch show 5f0a547f7a91bf002bb0542035a647fd5af134a5
│ Status open │ │ Status open │
│ │ │ │
│ See details. │ │ See details. │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├───────────────────────────────────────────────────────────────────────────────────────── ├────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk (you) [ ... ] │ ● opened by (you) (z6Mkt67…v4N1tRk) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰────────────────────────────────────────────────────────────────────╯
``` ```
We can also confirm that the patch branch is in storage: We can also confirm that the patch branch is in storage:

View File

@ -33,7 +33,7 @@ $ git branch -r
bob/master bob/master
rad/master rad/master
$ rad patch show 5f0a547 $ rad patch show 5f0a547
╭─────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │ │ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │ │ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
@ -42,13 +42,13 @@ $ rad patch show 5f0a547
│ Status open │ │ Status open │
│ │ │ │
│ See details. │ │ See details. │
├─────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ 27857ec Add README, just for the fun │ │ 27857ec Add README, just for the fun │
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk [ ... ] │ ● opened by bob (z6Mkt67…v4N1tRk) [ ... ]
│ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │ │ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │
╰─────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```
Wait! There's a mistake. The REQUIREMENTS should be a markdown file. Let's Wait! There's a mistake. The REQUIREMENTS should be a markdown file. Let's
@ -93,7 +93,7 @@ The patch is now merged and closed :).
``` ```
$ rad patch show 5f0a547 $ rad patch show 5f0a547
╭───────────────────────────────────────────────────────────────────────────────────────── ╭──────────────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │ │ Title Define power requirements │
│ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │ │ Patch 5f0a547f7a91bf002bb0542035a647fd5af134a5 │
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │ │ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
@ -103,16 +103,16 @@ $ rad patch show 5f0a547
│ Status merged │ │ Status merged │
│ │ │ │
│ See details. │ │ See details. │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ f6484e0 fixup! Define power requirements │ │ f6484e0 fixup! Define power requirements │
│ 27857ec Add README, just for the fun │ │ 27857ec Add README, just for the fun │
│ 3e674d1 Define power requirements │ │ 3e674d1 Define power requirements │
├───────────────────────────────────────────────────────────────────────────────────────── ├──────────────────────────────────────────────────────────────────────────────┤
│ ● opened by did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk [ ... ] │ ● opened by bob (z6Mkt67…v4N1tRk) [ ... ]
│ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │ │ ↑ updated to b7e2356fb7e3981980b42603eea969851d17a40d (27857ec) [ ... ] │
│ ↑ updated to 4486280d0dec743d6a1a0c05754f8e40426c681d (f6484e0) [ ... ] │ │ ↑ updated to 4486280d0dec743d6a1a0c05754f8e40426c681d (f6484e0) [ ... ] │
│ ✓ merged by did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [ ... ] │ ✓ merged by (you) (z6MknSL…StBU8Vi) [ ... ]
╰───────────────────────────────────────────────────────────────────────────────────────── ╰──────────────────────────────────────────────────────────────────────────────╯
``` ```
To publish our new state to the network, we simply push: To publish our new state to the network, we simply push:

View File

@ -312,6 +312,8 @@ fn list(
profile: &profile::Profile, profile: &profile::Profile,
assigned: &Option<Assigned>, assigned: &Option<Assigned>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let me = *profile.id();
if issues.is_empty()? { if issues.is_empty()? {
term::print(term::format::italic("Nothing to show.")); term::print(term::format::italic("Nothing to show."));
return Ok(()); return Ok(());
@ -347,22 +349,35 @@ fn list(
term::format::bold(String::from("ID")), term::format::bold(String::from("ID")),
term::format::bold(String::from("Title")), term::format::bold(String::from("Title")),
term::format::bold(String::from("Author")), term::format::bold(String::from("Author")),
term::format::bold(String::new()),
term::format::bold(String::from("Tags")), term::format::bold(String::from("Tags")),
term::format::bold(String::from("Assignees")), term::format::bold(String::from("Assignees")),
term::format::bold(String::from("Opened")), term::format::bold(String::from("Opened")),
]); ]);
t.divider(); t.divider();
let store = profile.tracking()?;
for (id, issue) in all { for (id, issue) in all {
let assigned: String = issue let assigned: String = issue
.assigned() .assigned()
.map(|p| term::format::did(&p).to_string()) .map(|ref p| {
if let Ok(Some(alias)) = store.node_policy(p).map(|node| node.and_then(|n| n.alias))
{
format!("{alias} ({})", term::format::did(p))
} else {
term::format::did(p).to_string()
}
})
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "); .join(", ");
let mut tags = issue.tags().map(|t| t.to_string()).collect::<Vec<_>>(); let mut tags = issue.tags().map(|t| t.to_string()).collect::<Vec<_>>();
tags.sort(); tags.sort();
let author = issue.author().id;
let alias = store.node_policy(&author)?.and_then(|node| node.alias);
t.push([ t.push([
match issue.state() { match issue.state() {
State::Open => term::format::positive("").into(), State::Open => term::format::positive("").into(),
@ -371,6 +386,13 @@ fn list(
term::format::tertiary(term::format::cob(&id)).to_owned(), term::format::tertiary(term::format::cob(&id)).to_owned(),
term::format::default(issue.title().to_owned()), term::format::default(issue.title().to_owned()),
term::format::did(&issue.author().id).dim(), term::format::did(&issue.author().id).dim(),
if author.as_key() == &me {
term::format::primary("(you)".to_owned())
} else if let Some(alias) = alias {
term::format::primary(alias)
} else {
term::format::default(String::new())
},
term::format::secondary(tags.join(", ")), term::format::secondary(tags.join(", ")),
if assigned.is_empty() { if assigned.is_empty() {
term::format::dim(String::default()) term::format::dim(String::default())
@ -381,7 +403,6 @@ fn list(
]); ]);
} }
t.print(); t.print();
Ok(()) Ok(())
} }

View File

@ -66,9 +66,13 @@ pub fn run(
is_me.then(by_rev_time).then(by_id) is_me.then(by_rev_time).then(by_id)
}); });
let store = profile.tracking()?;
let mut errors = Vec::new(); let mut errors = Vec::new();
for (id, patch) in &mut all { for (id, patch) in &mut all {
match row(&me, id, patch, repository) { let author_id = patch.author().id();
let alias = store.node_policy(author_id)?.and_then(|node| node.alias);
match row(&me, alias, id, patch, repository) {
Ok(r) => table.push(r), Ok(r) => table.push(r),
Err(e) => errors.push((patch.title(), id, e.to_string())), Err(e) => errors.push((patch.title(), id, e.to_string())),
} }
@ -90,6 +94,7 @@ pub fn run(
/// Patch row. /// Patch row.
pub fn row( pub fn row(
whoami: &PublicKey, whoami: &PublicKey,
alias: Option<String>,
id: &PatchId, id: &PatchId,
patch: &Patch, patch: &Patch,
repository: &Repository, repository: &Repository,
@ -113,6 +118,8 @@ pub fn row(
term::format::did(&author).dim().into(), term::format::did(&author).dim().into(),
if author.as_key() == whoami { if author.as_key() == whoami {
term::format::primary("(you)".to_owned()).into() term::format::primary("(you)".to_owned()).into()
} else if let Some(alias) = alias {
term::format::primary(alias).into()
} else { } else {
term::format::default(String::new()).into() term::format::default(String::new()).into()
}, },
@ -132,22 +139,39 @@ pub fn row(
} }
pub fn timeline( pub fn timeline(
whoami: &PublicKey, profile: &Profile,
patch_id: &PatchId, patch_id: &PatchId,
patch: &Patch, patch: &Patch,
repository: &Repository, repository: &Repository,
) -> anyhow::Result<Vec<term::Line>> { ) -> anyhow::Result<Vec<term::Line>> {
let you = patch.author().id().as_key() == whoami; let whoami = profile.id();
let store = profile.tracking()?;
let alias = if patch.author().id().as_key() == whoami {
Some("(you)".to_string())
} else {
store
.node_policy(patch.author().id())?
.and_then(|node| node.alias)
};
let mut open = term::Line::spaced([ let mut open = term::Line::spaced([
term::format::positive("").into(), term::format::positive("").into(),
term::format::default("opened by").into(), term::format::default("opened by").into(),
term::format::tertiary(patch.author().id()).into(),
]); ]);
if you {
open.push(term::Label::space()); open.push(term::Label::space());
open.push(term::format::primary("(you)"));
if let Some(ref alias) = alias {
open.push(term::format::primary(alias));
open.push(term::Label::space());
open.push(term::format::tertiary(format!(
"({})",
term::format::node(patch.author().id())
)));
} else {
open.push(term::format::tertiary(patch.author().id()));
} }
let mut timeline = vec![(patch.timestamp(), open)]; let mut timeline = vec![(patch.timestamp(), open)];
for (revision_id, revision) in patch.revisions() { for (revision_id, revision) in patch.revisions() {
@ -172,11 +196,11 @@ pub fn timeline(
for (nid, merge) in patch.merges().filter(|(_, m)| m.revision == *revision_id) { for (nid, merge) in patch.merges().filter(|(_, m)| m.revision == *revision_id) {
let peer = repository.remote(nid)?; let peer = repository.remote(nid)?;
let mut badges = Vec::new(); let alias = if peer.id == *whoami {
Some("(you)".to_string())
if peer.id == *whoami { } else {
badges.push(term::format::primary("(you)").into()); store.node_policy(&peer.id)?.and_then(|node| node.alias)
} };
timeline.push(( timeline.push((
merge.timestamp, merge.timestamp,
@ -185,10 +209,22 @@ pub fn timeline(
term::format::primary("").bold().into(), term::format::primary("").bold().into(),
term::format::default("merged").into(), term::format::default("merged").into(),
term::format::default("by").into(), term::format::default("by").into(),
term::format::tertiary(Did::from(peer.id)).into(), if let Some(ref alias) = alias {
term::format::primary(alias).into()
} else {
term::format::default(String::new()).into()
},
if alias.is_some() {
term::format::tertiary(format!(
"({})",
term::format::node(&Did::from(peer.id))
))
.into()
} else {
term::format::tertiary(Did::from(peer.id)).into()
},
] ]
.into_iter() .into_iter(),
.chain(badges),
), ),
)); ));
} }
@ -205,11 +241,11 @@ pub fn timeline(
None => term::format::default("reviewed"), None => term::format::default("reviewed"),
}; };
let peer = repository.remote(reviewer)?; let peer = repository.remote(reviewer)?;
let mut badges = Vec::new(); let alias = if peer.id == *whoami {
Some("(you)".to_string())
if peer.id == *whoami { } else {
badges.push(term::format::primary("(you)").into()); store.node_policy(&peer.id)?.and_then(|node| node.alias)
} };
timeline.push(( timeline.push((
review.timestamp(), review.timestamp(),
@ -218,10 +254,22 @@ pub fn timeline(
verdict_symbol.into(), verdict_symbol.into(),
verdict_verb.into(), verdict_verb.into(),
term::format::default("by").into(), term::format::default("by").into(),
term::format::tertiary(reviewer).into(), if let Some(ref alias) = alias {
term::format::primary(alias).into()
} else {
term::format::default(String::new()).into()
},
if alias.is_some() {
term::format::tertiary(format!(
"({})",
term::format::node(&Did::from(reviewer))
))
.into()
} else {
term::format::tertiary(Did::from(reviewer)).into()
},
] ]
.into_iter() .into_iter(),
.chain(badges),
), ),
)); ));
} }

View File

@ -130,7 +130,7 @@ pub fn run(
.children(commits.into_iter().map(|l| l.boxed())) .children(commits.into_iter().map(|l| l.boxed()))
.divider(); .divider();
for line in list::timeline(profile.id(), patch_id, &patch, stored)? { for line in list::timeline(profile, patch_id, &patch, stored)? {
widget.push(line); widget.push(line);
} }
widget.print(); widget.print();

View File

@ -733,7 +733,7 @@ async fn patches_handler(
.all()? .all()?
.filter_map(|r| { .filter_map(|r| {
let (id, patch, clock) = r.ok()?; let (id, patch, clock) = r.ok()?;
(state.matches(&patch.state())).then_some((id, patch, clock)) (state.matches(patch.state())).then_some((id, patch, clock))
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
patches.sort_by(|(_, a, _), (_, b, _)| b.timestamp().cmp(&a.timestamp())); patches.sort_by(|(_, a, _), (_, b, _)| b.timestamp().cmp(&a.timestamp()));

View File

@ -18,7 +18,9 @@ use radicle::git;
use radicle::git::refname; use radicle::git::refname;
use radicle::identity::Id; use radicle::identity::Id;
use radicle::node::routing::Store; use radicle::node::routing::Store;
use radicle::node::tracking::store as TrackingStore;
use radicle::node::Handle as _; use radicle::node::Handle as _;
use radicle::node::TRACKING_DB_FILE;
use radicle::profile::Home; use radicle::profile::Home;
use radicle::profile::Profile; use radicle::profile::Profile;
use radicle::rad; use radicle::rad;
@ -74,6 +76,8 @@ impl Environment {
pub fn node(&mut self, name: &str) -> Node<MemorySigner> { pub fn node(&mut self, name: &str) -> Node<MemorySigner> {
let profile = self.profile(name); let profile = self.profile(name);
let signer = MemorySigner::load(&profile.keystore, "radicle".to_owned().into()).unwrap(); let signer = MemorySigner::load(&profile.keystore, "radicle".to_owned().into()).unwrap();
let tracking_db = profile.home.node().join(TRACKING_DB_FILE);
TrackingStore::Config::open(tracking_db).unwrap();
Node { Node {
id: *profile.id(), id: *profile.id(),
@ -90,6 +94,8 @@ impl Environment {
let storage = Storage::open(home.storage()).unwrap(); let storage = Storage::open(home.storage()).unwrap();
let keystore = Keystore::new(&home.keys()); let keystore = Keystore::new(&home.keys());
let keypair = KeyPair::from_seed(Seed::from([!(self.users as u8); 32])); let keypair = KeyPair::from_seed(Seed::from([!(self.users as u8); 32]));
let tracking_db = home.node().join(TRACKING_DB_FILE);
TrackingStore::Config::open(tracking_db).unwrap();
transport::local::register(storage.clone()); transport::local::register(storage.clone());
keystore keystore