Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli/issue: Fix list command
✗ CI failure Erik Kundt committed 7 months ago
commit be2b0559eb55a496dc630dd1097d12413f91c71d
parent 16404493713f5619a668296069964d6f3fdc87c0
1 failed 2 pending (3 total) View logs
3 files changed +48 -15
added crates/radicle-cli/examples/rad-issue-list.md
@@ -0,0 +1,40 @@
+
Let's say we have a project with an issue created already. We can list all open issues.
+

+
```
+
$ rad issue list
+
╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
+
│ ●   ID        Title                         Author           Labels             Assignees   Opened │
+
├────────────────────────────────────────────────────────────────────────────────────────────────────┤
+
│ ●   d87dcfe   flux capacitor underpowered   alice    (you)   good-first-issue               now    │
+
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
+
```
+

+
We can now assign ourselves to the open issue.
+

+
```
+
$ rad issue assign d87dcfe --add did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
+
```
+

+
It will now also show up in the list of issues assigned to us.
+

+
```
+
$ rad issue list --assigned me
+
╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
+
│ ●   ID        Title                         Author           Labels             Assignees   Opened │
+
├────────────────────────────────────────────────────────────────────────────────────────────────────┤
+
│ ●   d87dcfe   flux capacitor underpowered   alice    (you)   good-first-issue   alice       now    │
+
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
+
```
+

+
If we now fix this issue, we can close it.
+

+
```
+
$ rad issue state --solved d87dcfe --no-announce
+
✓ Issue d87dcfe is now solved
+
```
+

+
It will not show up in the list of open issues anymore.
+

+
```
+
$ rad issue list
+
```
modified crates/radicle-cli/src/commands/issue/args.rs
@@ -214,13 +214,12 @@ impl Default for Command {
}

/// Arguments for the [`Command::List`] subcommand.
-
#[derive(Parser, Debug)]
+
#[derive(Parser, Debug, Default)]
pub(crate) struct ListArgs {
    /// Filter for the list of issues that are assigned to '<DID>' (default: me)
    #[arg(long, name = "DID")]
-
    #[arg(default_missing_value = "me")]
+
    // #[arg(default_missing_value = "me")]
    #[arg(num_args = 0..=1)]
-
    #[arg(require_equals = true)]
    pub(crate) assigned: Option<Assigned>,

    /// List all issues
@@ -229,6 +228,7 @@ pub(crate) struct ListArgs {

    /// List only open issues (default)
    #[arg(long, group = "state")]
+
    #[arg(default_value = "true")]
    open: bool,

    /// List only closed issues
@@ -240,18 +240,6 @@ pub(crate) struct ListArgs {
    solved: bool,
}

-
impl Default for ListArgs {
-
    fn default() -> Self {
-
        Self {
-
            assigned: None,
-
            all: false,
-
            open: true,
-
            closed: false,
-
            solved: false,
-
        }
-
    }
-
}
-

impl From<ListArgs> for Option<State> {
    fn from(value: ListArgs) -> Self {
        if value.open {
modified crates/radicle-cli/tests/commands.rs
@@ -66,6 +66,11 @@ fn rad_issue() {
}

#[test]
+
fn rad_issue_list() {
+
    Environment::alice(["rad-init", "rad-issue", "rad-issue-list"]);
+
}
+

+
#[test]
fn rad_cob_update() {
    Environment::alice(["rad-init", "rad-cob-log"]);
}