Commit Graph

152 Commits

Author SHA1 Message Date
Alexis Sellier 8f57d60706
cli: Don't rely on working copy for `patch show`
Since the patch may not have been pulled into the working copy,
we shouldn't rely on it for displaying patch information.
2023-03-18 12:24:17 +01:00
Alexis Sellier cf1acf7e24
Fix patch `description` method
The description is not actually optional, so don't return an `Option`.
2023-03-18 12:24:17 +01:00
Alexis Sellier bd436d4369
cli: Open tracking DB in read-only mode 2023-03-15 12:59:49 +01:00
Alexis Sellier caaa7581e6
node: Remove `Routing` command
Replaced by direct DB access.
2023-03-15 12:59:49 +01:00
Alexis Sellier b558c742e6
node: Rename `repo_entries` to `repo_policies`
Do the same thing for `node_entries` etc.
2023-03-15 12:59:49 +01:00
Alexis Sellier 9b6ede8fc5
cli: Use tracking DB access for `node` command 2023-03-15 12:59:49 +01:00
Alexis Sellier 13998dcf46
cli: Flesh out `rad self` 2023-03-15 10:25:23 +01:00
Alexis Sellier 9c77332cba
cli: Implement `tag` and `untag`
These commands are added at the top level because they will eventually
also work on patches.
2023-03-13 15:08:14 +01:00
Alexis Sellier 2737369910
cli: Fix missing patch announcement 2023-03-13 14:37:01 +01:00
Alexis Sellier f7aac06a8f
cli: Polish `assign` and `unassign` commands 2023-03-13 12:27:47 +01:00
Alexis Sellier 8e5627d28a
node: Rename `tracked_repo` -> `repo_policies`
I was finding the current naming misleading, as the returned entries
could be for blocked repos/nodes.
2023-03-13 11:41:07 +01:00
Vincenzo Palazzo f8aa1daedb
cli: show the issue when it is created
Show the issue when it is created to give feedback to the user.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-03-12 19:26:28 +01:00
Slack Coder 166f7e7cc2
cli: Minimize patch info on creation
Reduce noise when showing patch information to the user on creation by
only showing the git branch name and not the commit reference.
2023-03-11 18:38:54 +01:00
Alexis Sellier 34a2d1a9dc
cli: use canonical head for patch target
Correct assumptions made about how patching work in `rad patch`.  Make
the default Patch target a `git ref` in place of a target 'peer'.

Use the canonical head as the git reference.  This is head of the
project's master branch which project delegates have concensus on.
2023-03-11 18:38:54 +01:00
Alexis Sellier adbf6f5bf5
cli: Improve `patch` command
Cleanup and simplify output of patch command.
2023-03-08 20:23:49 +01:00
Alexis Sellier 1168f2ddb5
cli: Update `track` command
Allows the `track` command to be used to track nodes and repos.
2023-03-08 15:32:34 +01:00
Fintan Halpenny 3b015a9325
radicle: accept Scope as track_repo argument
The method `track_repo` only accepted the RID as the argument for
tracking.

Instead, allow passing Scope as an argument for tracking a
repository.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-08 11:29:34 +00:00
Fintan Halpenny 39be7db1e9
radicle: make alias optional
Previously the alias field was simply a string which could possibly be
empty. Some checks were made to see if this string was empty.

Instead, make the logic more obvious by making the alias field
optional.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-08 11:29:34 +00:00
Vincenzo Palazzo 0e491fae79
cli: fix command line silent abort
Fix the command line silents abort when the
the `EDITOR` variable is not specified.

With this commit the result is reported below

```
➜  rio git:(main) RAD_PASSPHRASE=12345 rad issue open
✗ Issue failed: editor not configured: the `EDITOR` environment variable is not set
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-03-08 12:25:11 +01:00
Fintan Halpenny ed985f6fe0
cli: rad node
This adds a rad node subcommand to the CLI.

The subcommand aims to fulfill the following requirements:

- Checking the node status (rad node status)
- Connecting to the node's control socket (rad node connect)
- Printing out our routing table (rad node routing)
- Printing out our tracking policies (rad node tracking)

The following are yet to be implemented:

- Starting the node (rad node start)
- Stopping the node (rad node stop)

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-07 15:38:41 +01:00
Alexis Sellier 5fb5df2e61
cli: Update `inquire` crate 2023-03-07 10:39:45 +01:00
Alexis Sellier 85df613682
cli: Implement automatic issue announcement 2023-03-07 08:40:20 +01:00
Alexis Sellier cb3b7a3765
cli: Implement `patch delete` 2023-03-06 15:45:54 +01:00
Alexis Sellier fb2c388a5d
cli: Properly trim `patch` message 2023-03-06 15:39:07 +01:00
Alexis Sellier 35f22ba37a
cli: Update `init` help for consistency 2023-03-06 15:38:42 +01:00
Alexis Sellier be5c9c9258
cli: Add `--verbose` flag to `init` 2023-03-06 15:38:42 +01:00
Alexis Sellier c8c44c884c
cli: Allow `init` without running node 2023-03-06 15:38:42 +01:00
Alexis Sellier e69be6051d
cli: Give more control over `init` announcement
Instead of always announcing the inventory, by default we don't.
Users can run `rad push` to trigger an announcement.
2023-03-06 15:38:42 +01:00
Alexis Sellier 8c22012d61
Remove need to pass public key in cob store 2023-03-06 10:56:20 +01:00
Alexis Sellier 44f3984159
Sign COB refs after modification 2023-03-06 10:42:26 +01:00
Alexis Sellier 02304875ce
Initialize `radicle-term` crate
We split out all non-radicle terminal functionality so that it can be
accessed by `radicle-node` without importing `radicle-cli`.
2023-03-06 10:22:50 +01:00
Alexis Sellier 82d858314f cli: Fix `rad rm` prompt 2023-03-04 22:28:45 +01:00
Slack Coder dd7e3923b5 cli: expose `rad fetch`
Make `rad fetch` accessible via the command line.  It appears to be
accidently left out.
2023-03-03 09:59:45 -05:00
Alexis Sellier de71c5d9b1
cli: Implement `--fetch` on `rad patch` 2023-03-02 17:00:31 +01:00
Alexis Sellier 43bd5fca00
cli: Implement `rad fetch` command 2023-03-02 17:00:27 +01:00
Alexis Sellier 5f59493c70
cob: Don't require a local fork to exist
Before this change, the identity document would be loaded for the
COB signer. This meant that a fork would be needed for that signer.

After this change, it's no longer necessary, since the identity doc
head is computed from available remotes.

While making those changes, it was also apparent that some of the
identity-related functions had bad names and error types, this
was fixed as well.
2023-03-01 15:40:30 +01:00
Alexis Sellier 2a687502c5
cli: Improve `rad inspect`
* Don't always require auth
* Fix `--refs` sub-command
2023-03-01 13:03:42 +01:00
Alexis Sellier 892f02bc43
cli: Improve `rad-auth` first authentication 2023-03-01 13:03:42 +01:00
Alexis Sellier e4b44370d3
cli: Register key on first `auth`
Registers the secret key with ssh-agent when `rad auth` is first called.
2023-03-01 13:03:42 +01:00
Alexis Sellier 68aca5dd65
cli: Don't fork if we already have a fork 2023-02-27 18:27:52 +01:00
Alexis Sellier 207030d2e1
cli: Don't fail clone if we have repo locally 2023-02-27 18:19:02 +01:00
Fintan Halpenny c70dc71b18
node: improve seeds information
Previously, the seeds information would only consist of the connected
NodeIds.

Improve on this by adding any disconnected and fetching seeds as
well. A seed can either be disconnected, connected, or fetching --
where fetching implies connected.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-27 17:48:11 +01:00
Alexis Sellier 06a92d52d9
cob: Use hashes for operation ids
It's fairly easy for a user to (by mistake or intentionally) create two
operations with the same OpId. This patch makes it much less likely,
and ensures that if the OpId is equal, it's because the operations
are identical.
2023-02-27 17:11:48 +01:00
Alexis Sellier 0a93fa833e
cli: Simplify & improve CLI output
Improvements to the CLI output as well as converging towards
`termion` as a backend.

The crates we were using for prompting and spinners were based on
a terminal backend called `console`, which is not really used
anywhere else. There were also limitations in terms of the output
of these crates.

Therefore, we switched to the `inquire` crate for prompting, using
the `termion` backend, which is very standard.

Additionally, we simplify the terminal output to use symbols:

! for Warning
✓ for Success
✗ for Error

... Instead of a mix of words and symbols.

We also include a modified version of the `yansi` crate which plays
well with our table formatting functions by automatically truncating
and padding output in a unicode-aware way.
2023-02-27 17:10:52 +01:00
Fintan Halpenny f9dbd590a4
cli: add missing commands for rad_help
The assign, id, and unassign help messages were missing from the rad
help command.

Add them to complete the list.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-24 11:41:19 +01:00
Sebastian Martinez b04451a1bd
Use `Did` in a bunch more places
Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑` While we want to maintain
`Author` and `ActorId` for internal use.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-16 18:01:42 +01:00
Fintan Halpenny 2b5552546c
cli: add rid function for Id parsing
Adds helper for parsing the Id type in CLI arguments.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-16 17:07:14 +01:00
Fintan Halpenny 5477a3615f
radicle-cli: use Did across CLI
The CLI commands and output use PublicKey, ActorId, and NodeId for
peer identifiers.

Instead Did should be standardised for use in CLI arguments and
outputs.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-16 17:07:14 +01:00
Fintan Halpenny b57a4606f6
cli: add did function for args parsing
Adds a standard for parsing the Did type for the CLI commands.

It attempts to parse the Did type. If it fails then it checks if the
operator passed a PublicKey and suggests using `did:key` instead.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-16 17:07:14 +01:00
Alexis Sellier 950fae209d
Make `ReadStorage` more usable
Previously, we were not able to access a `ReadRepository` instance
through `ReadStorage`. With this change, we are able to.
2023-02-15 22:08:20 +01:00