Commit Graph

720 Commits

Author SHA1 Message Date
cloudhead 8f89f088c6
cli: Correctly honor sync timeout 2024-03-22 16:35:06 +01:00
Sebastian Martinez 0581c017ae
cli: Add `rad patch archive --undo`
Allows archived patches to be reverted to open state.
2024-03-21 20:33:15 +01:00
Fintan Halpenny ea31040ec6
cli: do not require RID for sync inventory
The inventory operation of the `rad sync` command does not require an
RID. Localise resolving the RID in the match arms that require it.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-21 20:29:11 +01:00
cloudhead 057af40ea3
radicle: Fix config loading with bad alias
Previously, a config would load fine with an invalid alias,
due to how serde is configured for the `Alias` type. This fixes it.
2024-03-21 14:44:04 +01:00
cloudhead 2bcb03b021
node: Re-think inventory update code
Instead of re-loading the full inventory on `rad init`, we simply add
the new repository to the in-memory cache.

We also keep track of whether a fetch was a full clone, to know when
to update our routing table.
2024-03-21 12:40:58 +01:00
Alexis Sellier f15afa84be
cli: Add timing information to `rad-sync` 2024-03-19 17:27:18 +01:00
Alexis Sellier ddd4bde302
node: Make worker count configurable 2024-03-19 16:34:15 +01:00
Lars Wirzenius 6569449fff
cli: add PATH to env vars in rad-debug
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-18 13:14:50 +01:00
Lars Wirzenius 5fce714ba5
cli: include path to rad binary in rad-debug
This relies on /proc/self/exe being a symlink to the binary, so this
may only work on Linux.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-18 13:14:01 +01:00
Alexis Sellier 5ae617abf0
helper: Don't sync if we aren't seeding 2024-03-18 13:04:48 +01:00
cloudhead 9cd1b0ec46
cli: Improve missing man page handling
Instead of saying "no manual entry", we output regular help.
2024-03-17 21:14:58 +01:00
cloudhead cf8f262cb2
man: Add `rad-id.1` man page 2024-03-17 21:14:58 +01:00
cloudhead 752656fbfa
cli: Fix output of `rad auth`
The `rad help` command was not the right one.
2024-03-15 10:20:28 +01:00
cloudhead de0b9ae44d
cli: Don't highlight unknown languages
Previously, we'd show "Empty file".
2024-03-12 16:12:16 +01:00
cloudhead eb1ae13e68
cli: Use correct styling for revision id 2024-03-12 15:46:55 +01:00
Michael Raitza f0b8446515
cli: Handle message editor corner cases
1. Split on double newline fails when description is empty
2. Title must be a single line
2024-03-12 15:44:26 +01:00
cloudhead 93ff59ae25
cli: Add `rad version --json` flag
This will be used to automatically populated metadata around releases
for the homepage.
2024-03-11 17:36:31 +01:00
Fintan Halpenny 14ce5fe7b1
cli: show reviews on `rad patch list`
When running `rad patch list`, show the set of delegate reviews for
each patch, with the following meaning for the symbols:

- ✔: delegate has accepted the patch
- ✗: delegate has rejected the patch
- -: delegate has not made a verdict on the patch

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 13:22:14 +01:00
josibake ce1e1f71ae
cli: Improve `rad init` wording
If the user passes a <path> argument to init, it is incorrect and a
bit confusing to reference the "current directory" or "this directory"
e.g. "run rad . in current directory" when the repo was not created in the
current directory and was created with a path argument instead.

Use the path provided by the user in help text, otherwise reference
the current directory.
2024-03-11 13:08:03 +01:00
Fintan Halpenny 18fc41c53f
cli: error on no id update
If `rad id` is called with no arguments, or just `--title` and
`--description`, then it will fail because there were no changes made
to the identity.

Check if the `proposal` document is the same the `current` document,
and if so supply a hint and a better error.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 13:05:01 +01:00
Fintan Halpenny 864ca656c0
cli: add Unknown variant for NotificationKind
When the `rad inbox` command would come across a reference name that
it did not recognise as a `Cob` or `Branch`, then it would fail with
an `Unknown` error.

Instead, add an `Unknown` variant to `NotificationKind` which can be
displayed in the `inbox` CLI, by using the `--show-unknown`
flag. Otherwise, it will be skipped and the inbox will work as usual.

While refactoring, the `TypedId` type is used for the `Cob` variant to
simplify some of its uses.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 12:57:53 +01:00
Fintan Halpenny 2fe0cca6d9
cli: ref_update should take a ref
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 12:57:53 +01:00
Sebastian Martinez bdd1b238fc
Bump `radicle-surf` to 0.19.0 2024-03-11 12:27:27 +01:00
Fintan Halpenny 7ddb1119a5
cli: show revision on rad patch checkout
Help the user know which revision they currently have checked out when
running `rad patch checkout`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:56:11 +01:00
Fintan Halpenny 87d1cb50a0
fetch: allow fetch of annotated tags
If an ancestry check of an annotated tag was triggered then the fetch
from that peer would fail. This is due to `graph_ahead_behind` only
working for commit-ish objects.

To allow for annotated tags, and other object that peel to commits,
the check now peels the two objects to commits before getting their
`Oid`s. The call to `graph_ahead_behind` can take these two `Oid`s
instead.

A test for annotated tags is included as part of the `examples/git`
suite in the CLI tests.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:13:26 +01:00
Sebastian Martinez 9950182ee0
cli: Remove rad-web from help
Due to it not being stable, and eventually the auth flow to be
rewritten, it should be removed.
2024-03-11 11:06:32 +01:00
cloudhead b917c1b411
cli: Rename `rad ls --seeds` flag
Rename to `--seeded` as per our discussion in Zulip.
2024-03-11 10:46:09 +01:00
cloudhead d1e2e3b61e
cli: Fix some tests 2024-03-09 14:01:30 +01:00
Zlatan Todoric acf71fceaa
cli: Update help output 2024-03-09 13:51:30 +01:00
Fintan Halpenny cac6c0aad7
cli: add name to `rad seed` output
If the name is available to show for the repository -- it may not be
if it hasn't been replicated yet -- then add it to the output of the
`rad seed` command.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-09 13:45:35 +01:00
Christopher Fredén 13d5b4f620
cli: fix `issue` command asking for passphrase
Only require `signer` when doing a write operation.
2024-03-09 00:03:24 +01:00
Fintan Halpenny 50833d88d9
cli: document `rad inbox` further
The documentation for `rad inbox show` and `rad inbox clear` were
missing.

Add documentation into the help message for both.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-09 00:01:26 +01:00
Lars Wirzenius ccec3f80dc
cli: add "debug" subcommand
This writes out information that may be useful when debugging Radicle
remotely on a user's machine. Things like versions of programs, and
values of relevant environment variables.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-08 23:50:01 +01:00
Fintan Halpenny 3bba7d1634
cli: test rad patch delete
No tests for `rad patch delete` existed.

Add a test where two peers interact on a patch and one decides to
delete the patch. It ensures that the patch is still visible to the
peer that did not delete the patch.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-08 23:43:19 +01:00
Fintan Halpenny 96c65eb2b3
cli: add replies to patch show output
If any replies to patches were made, it was not possible to see them
in the output of `rad patch show`.

Add the replies to show output, but only if the `--verbose` flag is
set.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-08 23:43:19 +01:00
Fintan Halpenny 3a2e06e498
cli: document --reply-to option
The option to reply to a comment was undocumented in the `rad patch
comment` command.

Add the option to the "Comment options" section of the help message.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-08 23:43:19 +01:00
Alexis Sellier 1c4a2cd167
helper: Fix error message
Git was outputting a confusing message when an unuspported option was
used:

  fatal: helper rad does not support 'push-option'

This fixes it.
2024-03-08 23:25:31 +01:00
Alexis Sellier 786ce40f95
node: Add connection limits
The limits are roughly modeled after the Bitcoin network.
2024-03-08 23:24:34 +01:00
cloudhead a48081f271
cli: Move node addresses command
To make things a little more consistent, move the `rad self --address`
command to `rad node config --addresses`, since it's more about
externally-facing configuration of the node, rather than your local user
or profile.
2024-02-26 14:23:13 +01:00
cloudhead 9c96b46c59
cli: Show full path in `rad init`
Instead of showing a '.'
2024-02-26 12:40:17 +01:00
cloudhead 9c9bbbe7bb
node: Expose listen addresses 2024-02-26 12:35:20 +01:00
cloudhead d86d99e002
cli: Fix `rad config` bugs
The command was unable to deal with an invalid config. We fix this by
introducing a way to load the user's home without loading the config.
2024-02-26 12:10:34 +01:00
cloudhead 0726754b0e
cli: Add `--repo` option to `issue` and `patch`
Allows users to operate on a repo without a checkout.
2024-02-23 18:16:52 +01:00
Fintan Halpenny 9e745b68d1
cli: add caching commands for patch and issue
In order to bootstrap the COB cache, and also in case of issues,
supply a command for caching a set of patches/issues, or a single
patch/issue.

This is necessary since reads are not read-thru, it may appear that
COBs are missing when in fact they haven't been cached when first
moving over to the cache.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-02-23 16:03:26 +01:00
Fintan Halpenny 985b0af3f6
radicle: implement caching for issues and patches
Implement caching for the `Issue` and `Patch` COB. This is achieved by
having the `Transaction::initial` and `Transaction::commit` methods
take a cache which can update the newly created/updated object. The
`Store::remove` method also takes the cache for removing the object
from the cache, as well as the repository.

This meant that the `*Mut` types for the respective COBs are required
to carry a cache alongside the repository store. Identities will not
be cached, and so this is always set to `NoCache` -- which performs no
caching, and always succeeds.

To perform cache reading for issues and patches, the `cache::Issues`
and `cache::Patches` traits are introduced. They capture the minimal
amount of methods that are needed for the `rad issue` and `rad patch`
CLI commands.

The implementor for each of these traits is there respective `Cache`
types, which combines their backing repository store and the SQLite
database. They both provide convenience methods:
- `create` (and `draft` for patches)
- `get_mut`
- `remove`
which can be used instead of their repository store counterparts.

All uses of the repository stores (where needed) are replaced with
`Cache` types.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-02-23 16:03:21 +01:00
cloudhead 17744a03fd
cob: Properly authorize root actions
Previously, authorization was only checked for ops after the root op.
We also avoid creating empty actions for `assign` and `label`, which
was needed for non-authorized users to be able to create issues/patches.
2024-02-23 12:31:13 +01:00
cloudhead c63aaaceac
cli: Fix `id` COB notifications in `rad inbox` 2024-02-23 11:35:54 +01:00
cloudhead eff40166c9
cli: Add `rad unseed` command
This replaces the `-d` flag of `rad seed`, making it more like `rad
unfollow`.
2024-02-22 16:02:40 +01:00
cloudhead 0d18a8fd9e
cli: Better error message in `rad id` 2024-02-22 16:02:40 +01:00
cloudhead e06dd208f4
cli: `rad seed` output improvement
Better colors, and re-order fields to have policy before scope.
2024-02-22 16:02:38 +01:00
cloudhead 9767b485c2
cli: Improve `rad inbox` output
* Add change authors
* Add object status
* Add colors
2024-02-12 14:03:14 +01:00
cloudhead b477864b83
cli: Stabilize sort order of inbox repos
Sort repositories before displaying them.
2024-02-12 12:01:54 +01:00
cloudhead 664cf20c92
Change default seeding scope to 'all'
This makes the default policy `block` with scope `all`. The good thing
about this is that you don't have to manage individual nodes in the
beginning. You simply seed the repos you want, and everything is
followed within those repos. This matches user expectations, as `rad
seed` does what you expect it to do.

For open-policy seed nodes, it also means that simply changing `block`
to `allow` from the default config is all you need.

This leaves the non-default `followed` scope as a more "advanced"
setting, since it is much more cumbersome: it forces you to follow a
user before you can see their issues/patches, which is not something
most users expect coming from old-shcool forges.
2024-02-12 10:56:21 +01:00
cloudhead 137961c1f7
cli: Add `rad config get`
Gets a specific config value.
2024-02-07 17:12:45 +01:00
cloudhead e5fcbba4c0
cli: Implement `rad block` command
Blocks repos & nodes from beeing seeded/followed.
2024-02-07 15:51:05 +01:00
cloudhead d37c52aade
cli: Allow `rad inspect` without repo existing
To check the seeding policy of a repo without it being in storage.
2024-02-07 15:51:00 +01:00
cloudhead 565e3b889c
cli: Fix output of `rad seed` when empty 2024-02-07 15:45:50 +01:00
cloudhead 1130608331
cli: Document `rad init --no-seed` 2024-02-07 13:57:08 +01:00
cloudhead fe55de181d
cli: Add new `rad inbox` command
Shows you updates on local repositories.

Included here is a basic implementation of a notification system. A new
database is created and updated after every fetch, with refs that have
changed.

The `rad inbox` command can then list items in the database and delete
them.
2024-02-06 11:40:58 +01:00
cloudhead bb06663d1c
cli: Organize patch functions better
Move patch showing and timeline to a shared library so we can use it for
`rad inbox`.
2024-02-06 10:36:22 +01:00
cloudhead 8928c5ee26
cli: Fix node file rotation with `rad node start`
This was causing issues (error 22) on macOS and some Linux systems.
2024-02-05 16:26:55 +01:00
Lars Wirzenius 5abd7bf55a
cli: fix formatting of warning of unconnected node
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-05 12:53:36 +01:00
cloudhead e12bff0871
cli: Update and remove some dependencies 2024-02-02 09:57:45 +01:00
cloudhead 0a3da17fad
cli: Add `--seeds` option to `ls`
Small addition that is useful.
2024-01-31 17:24:59 +01:00
cloudhead 71bba29c9a
cli: Add log rotation to `node start`
Very simple log rotation with two files.
2024-01-31 14:23:43 +01:00
cloudhead 1ece339eac
cli: Hint to install ssh-agent 2024-01-31 14:07:28 +01:00
cloudhead 4e9e438f41
cli: Don't error if ssh-agent isn't running 2024-01-31 13:54:39 +01:00
cloudhead b5b9a55306
cli: Add `--path` option to `rad node start`
Useful for debugging and running nodes from different locations.
2024-01-31 13:40:13 +01:00
Sebastian Martinez 921f9f2d76
cli: Display rad-web in rad --help
Only show `rad-web` in help, if we are able to run the binary.
2024-01-31 13:30:40 +01:00
cloudhead 3560e0066d
Fix preferred seeds configuration
When using `network: "test"`, we shouldn't default to any public seed
node. This change makes sure that the "preferredSeeds" configuration var
is only given a value when `network` is `main`.
2024-01-31 12:09:09 +01:00
cloudhead e58419a9b0
cli: Fix capitalization of "Radicle" 2024-01-29 11:30:30 +01:00
cloudhead 3ff1ddd5e3
cli: Improve `rad config` 2024-01-29 11:28:37 +01:00
cloudhead d7ca9ad3c0
cli: Fix help text in `rad inspect` 2024-01-29 11:22:48 +01:00
cloudhead b994c4a6ef
cli: Rework `rad sync`
The command now works with both a replica target *and* a seeds target.
This is especially useful to eg. ensure that a preferred seed has been
synced, while still trying to hit a higher replica count.
2024-01-26 15:22:10 +01:00
cloudhead c13c658f4e
cli: Add `rad self --address` command
Useful when running seed nodes.
2024-01-25 21:16:58 +01:00
cloudhead 131103cb53
Fix code around default policies
Make the code a little clearer and ensure that we are always calling the
`Config` and not the `Store`, so that we fallback on the default policy.
2024-01-25 21:11:08 +01:00
Fintan Halpenny 49584f4e73
radicle: pinned repositories configuration
Introduce pinned repositories to the `profile::Config`, i.e.
`config.json`.

This is used for pinning repositories in the httpd `/projects` handle.

To allow returning all repositories, an `all` query parameter is also
included.

This is non-backwards compatible change, since we introduce the `show`
query parameter which, if not supplied, will default to `pinned`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-24 10:55:27 +01:00
cloudhead ae981ded6e
cli: Add `rad stats` command
Returns aggregate stats as JSON. Useful for tracking seed node metrics.
2024-01-23 15:50:32 +01:00
cloudhead a60afc8350
cli: Improve sync errors
In the case where we don't find any seeds, display a better error
message.

We also don't bail out on error, since the announcement step might still
be worth trying.
2024-01-22 21:23:13 +01:00
cloudhead a46bcb2247
cob: Distinguish between commit parents
Previously, COB change commits would not distinguish between their
parents. This means that they would try to load source code commits
(eg. for patch COBs) and then fail since those commits wouldn't have a
manifest or `Rad-Resource`.

We introduce a backwards compatible change here which is that parent
oids that are not COB commits are accompanied by a commit trailer called
`Rad-Related`. This is for all related content that should be pulled in
but is not part of the change graph proper.

When building the change graph, we simply ignore commits that are marked
as "related".
2024-01-22 21:20:01 +01:00
cloudhead 7feb3e3b10
Use "repository" consistently over "project"
We were using the two pretty interchangeably. "Project" should only be
used to refer to the repository payload. "Repository" should be used
when referring to the resource that is fetched, synced, cloned, checked
out etc.
2024-01-22 21:18:54 +01:00
cloudhead f87dfba9cd
Rename `Id` to `RepoId`
Rename the type to make it clearer and consistent with `NodeId`.
2024-01-22 15:51:44 +01:00
cloudhead 0fbfbc5721
Make sure `preferredSeeds` has a default
If the user already has a config, the preferred seeds list is not
populated. We fix that here by giving it a default value.
2024-01-19 16:30:24 +01:00
cloudhead ebdaf0edd9
General dependency update
Left out some of the `gix-*` dependencies to be done separately after
review.
2024-01-18 13:30:26 +01:00
cloudhead f4f479d68f
cli: Add logging and file limit setting 2024-01-17 17:36:51 +01:00
cloudhead 045b3e7175
node: Increase process ulimit on start
Users have been having issues with the process soft file limit.
We set that to a reasonably high value to avoid problems.
2024-01-17 17:34:25 +01:00
cloudhead 76302ffec0
cli: Attempt to fix flaky test
We also move the seed config to the test module.
2024-01-17 12:35:04 +01:00
Fintan Halpenny cf3cfb7efd
cli: test 3-way delegate collaboration
Add a test to show the behaviour of setting up 3 delegates, through two
seed nodes -- ensuring that commands are still operational after
accepting a delegate that the node is missing.

The two seeds are setup with two different scopes:
- `Scope::All`
- `Scope::Followed`

This is to show that the network has eventual consistency once there
is a way to fetch any other node's fork in the network.

The setup of the test is:
- Alice adds Bob as a delegate
- Bob adds Eve as a delegate
- Alice accepts Bob's changes

Alice is able to get Eve's fork through the `Scope::All` seed. The
`Scope::Followed` seed will then be able get Eve's fork once any other
node syncs with it, in this case Eve.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-12 16:37:09 +01:00
Fintan Halpenny b6d8bc9489
cli: fix check for synced replicas
If the expected replica count had exceeded the amount of seeds already
synced with the following message would appear:

    Not connected to any seeds for {rid}.

This is not true, since there are seeds that were already synced.

This is fixed by calculating the `synced` and `connected` nodes,
without the local peer in the set. This means that the check for
`synced.len() >= connected.len()` will get a hit and the function will
correctly return early.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-12 16:21:49 +01:00
Fintan Halpenny 16478e721b
cli: fix rad sync test flake
We cannot guarantee that the `rad sync status` will run before all the
nodes are synced.

Remove the call to `rad sync status` and explain that at least 1 of
the nodes will be synced.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-12 16:10:45 +01:00
cloudhead 1e2776cb08
cli: Output explore URLs on push 2024-01-12 13:24:11 +01:00
cloudhead fd38d88e14
cli: Hint about how to start node
In some cases, we can hint to the user about how they can start their
node.

We also remove the `CallError` type that was redundant.
2024-01-12 11:20:42 +01:00
Fintan Halpenny 2e781b1efd
cli: add control flow for announcement
To allow `rad sync` to break early from the call to `announce`,
control flow is introduced for the callback.

In `rad sync`, the number of synced nodes is checked against the
`replicas` -- if specified -- and sends a `Break`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-10 16:03:14 +01:00
Fintan Halpenny 498da296fd
cli: show head on patch opened
Previously, the head of the opened patch would not be displayed, and
so the user could not tell what it was if any updates were applied.

Show the head for the opened revision. The below shows the difference
between before and after, respectively:

```
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) now                               │
│ ↑ updated to 8d6692ce2b2219a54d09ccd5feefedb2bae33eba (02bef3f) now │
│ ↑ updated to 8438ab3940316abe65c93982a0a8f39688400359 (9304dbc) now │
╰─────────────────────────────────────────────────────────────────────╯
```

```
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (8b0ea80) now                     │
│ ↑ updated to 8d6692ce2b2219a54d09ccd5feefedb2bae33eba (02bef3f) now │
│ ↑ updated to 8438ab3940316abe65c93982a0a8f39688400359 (9304dbc) now │
╰─────────────────────────────────────────────────────────────────────╯
```

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-10 15:51:09 +01:00
cloudhead c8afda2ddf
cli: Don't discard radicle-node stderr output 2024-01-10 15:23:08 +01:00
Fintan Halpenny 8e0e1c232d
cli: improve Author labels
When an alias cannot be found for an `Author` the DID can be repeated eg.

    ✓ accepted by z6MkkfM…jXVsVz5 z6MkkfM…jXVsVz5

To prevent this we output one of four cases:

* `(<alias>, (you))` -- the `Author` is the local peer and has an alias
* `(<did>, (you))` -- the `Author` is the local peer and has no alias
* `(<alias>, <did>)` -- the `Author` is another peer and has an alias
* `(<blank>, <did>)` -- the `Author` is another peer and has no alias

Notably, we output a blank `Label` when no alias was found.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-09 13:44:46 +01:00
cloudhead 7d4ce8207d
httpd: `rad web --connect` takes an argument
To be able to connect to any running httpd, have `--connect` take the
address of the running daemon.
2024-01-09 13:33:26 +01:00
Fintan Halpenny b57099a0d0
cli: allow editing patch revision descriptions
Allow `rad patch edit` to take a `--revision` option which will edit
the description of the specified revision, rather than the root
revision.

If the flag is not specified, then the original behaviour of editing
the root revision's title and description is used.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-09 13:28:08 +01:00
Fintan Halpenny a8cca57c0a
cli: inline patch revision updates
Instead of having a timeline of a patch be global and sorted by
timestamp, organise it via revisions. Each revision has an entry in
the timeline, sorted by timestamp. Under each revision, a series of
updates are inlined, also sorted by their timestamps. Currently, these
updates can either be reviews or merges.

For example:

```
├────────────────────────────────────────────────────────────────────────────┤
│ ● opened by fintohaps (you) 1 week ago                                     │
│   └── ✓ accepted by fintohaps (you) 1 week ago                             │
│ ↑ updated to 5f2a123e3f2aa60f2e03815df283563495b73085 (a1c3c0f) 1 week ago │
│   └── ✓ accepted by fintohaps (you) 1 week ago                             │
│   └── ✓ merged by cloudhead (z6Mkt67…v4N1tRk) now                          │
╰────────────────────────────────────────────────────────────────────────────╯
```

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-09 13:06:03 +01:00
Fintan Halpenny 3323082ce3
cli: show debug for patch and issue
It's useful to be able to print out the Rust data of a Radicle defined
COB for debugging purposes, since the current CLI commands will only
show a subset of the data.

Add `--debug` flags to `rad patch show` and `rad issue show` that
print the data to stdout.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-09 11:09:05 +01:00