Files
heartwood/radicle-cli/examples/rad-issue.md
T
Fintan Halpenny 2584ecdb0a radicle: Pin timestamp for testing
When testing the CLI, "since"-calculations will result in different
values over time:

    now
    1 month ago
    2 months ago
    10 months ago
    1 year ago
    10 years ago

Initially, the solution was to use the wildcard match from `snapbox`,
`[..]`, to match on these values. However, since these values change
in length it means that they will affect the width of the tables
produced by the CLI.

To ensure the width is stable across runs over time it's possible to
use a time that is the same as the commit time used at testing.

To do this the `Timestamp` type is now a newtype which has a
constructor `now` which will use the `RAD_COMMIT_TIME` env variable
for construction, if it's available and in debug mode. This ensure
that all "since"-calculations will result in `now`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-10-30 14:48:38 +01:00

103 lines
6.8 KiB
Markdown

Project 'todo' items are called 'issue's. They can be inspected and modified
using the 'issue' subcommand.
Let's say the new car you are designing with your peers has a problem with its flux capacitor.
```
$ rad issue open --title "flux capacitor underpowered" --description "Flux capacitor power requirements exceed current supply" --no-announce
╭─────────────────────────────────────────────────────────╮
│ Title flux capacitor underpowered │
│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
│ Flux capacitor power requirements exceed current supply │
╰─────────────────────────────────────────────────────────╯
```
The issue is now listed under our project.
```
$ rad issue list
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 9bf82c1 flux capacitor underpowered z6MknSL…StBU8Vi (you) now │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
```
Show the issue information issue.
```
$ rad issue show 9bf82c1
╭─────────────────────────────────────────────────────────╮
│ Title flux capacitor underpowered │
│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
│ Flux capacitor power requirements exceed current supply │
╰─────────────────────────────────────────────────────────╯
```
Great! Now we've documented the issue for ourselves and others.
Just like with other project management systems, the issue can be assigned to
others to work on. This is to ensure work is not duplicated.
Let's assign ourselves to this one.
```
$ rad assign 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --to did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
```
It will now show in the list of issues assigned to us.
```
$ rad issue list --assigned
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 9bf82c1 flux capacitor underpowered z6MknSL…StBU8Vi (you) z6MknSL…StBU8Vi now │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
Note: this can always be undone with the `unassign` subcommand.
```
$ rad unassign 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --from did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
```
Great, now we have communicated to the world about our car's defect.
But wait! We've found an important detail about the car's power requirements.
It will help whoever works on a fix.
```
$ rad issue comment 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --message 'The flux capacitor needs 1.21 Gigawatts' -q
1a8e9d3d62d22b247064b12d1d89ad8598504129
$ rad issue comment 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --reply-to 1a8e9d3d62d22b247064b12d1d89ad8598504129 --message 'More power!' -q
fb6ab7e0ca5be3c34688bcae37d7302bb824decf
```
We can see our comments by showing the issue:
```
$ rad issue show 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d
╭─────────────────────────────────────────────────────────╮
│ Title flux capacitor underpowered │
│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
│ Flux capacitor power requirements exceed current supply │
├─────────────────────────────────────────────────────────┤
│ z6MknSL…StBU8Vi (you) now 1a8e9d3 │
│ The flux capacitor needs 1.21 Gigawatts │
├─────────────────────────────────────────────────────────┤
│ z6MknSL…StBU8Vi (you) now fb6ab7e │
│ More power! │
╰─────────────────────────────────────────────────────────╯
```