Commit Graph

565 Commits

Author SHA1 Message Date
cloudhead ae709b00ed
cli: Enable HTML syntax highlighting in diffs 2024-04-20 15:59:20 +02:00
cloudhead e3ecf4d7a0
cli: Add partial clone fail test
Ensure `rad clone` is successful as long as one fetch succeeds.
2024-04-09 15:54:08 +02:00
cloudhead 2eb665678e
cli: `rad sync` UX improvements
* Add `--force` flag to force a fetch even if the node is not a seed.
* Don't fail if we can't connect to a node during a fetch.
* More accurately exit when we hit our replica count.
2024-04-09 10:43:35 +02:00
cloudhead e9b79fb6d0
cli: Improve UX for cloning/fetching private repos
When `--private` is passed to `clone`, we force a fetch from nodes that
aren't known seeds.

When it isn't specified, we skip nodes that aren't known seeds, even if
they are in the preferred seeds list. Previously, we would still fetch
from them, which would cause errors.
2024-04-08 22:15:56 +02:00
cloudhead bd8e0ebcda
cli: Add tool in case `sqlite3` is unavailable
Adds the `rad node db exec <query>` command.

Easy way to run sqlite queries if the sqlite3 CLI is not available or
too old.
2024-04-06 17:55:59 +02:00
cloudhead 6be77ca9c3
radicle: Implement `remote_refs_at`
Implement this function on `RemoteRepository`, and move `repositories`
to the trait level.

This function will be used to quickly get the `RefsAt` of all repository
remotes.
2024-04-05 21:59:28 +02:00
cloudhead 36808234a6
cli: Don't allow announcing without a fork 2024-04-04 14:13:34 +02:00
Sebastian Martinez d38846baae
cli: Display better errors in `patch ready`
Instead of doing nothing and going to sync no change, we should display
some error to the users that we haven't been able to apply the changes.
2024-04-03 15:19:31 +02:00
Sebastian Martinez 0a78b9cc5b
cli: Display correct merge author in rad patch show output 2024-04-03 15:11:34 +02:00
Fintan Halpenny cd9b46fe51
radicle: fault tolerant thresholds
There are two areas where we can be more tolerant of delegate namespaces
being missing or not validating:
1. Calculating the canonical HEAD
2. Fetching from a remote

In 1. the protocol is tolerant in that if the local node does not have
the default branch for a delegate, it will still attempt to use any of
the delegates it does have to reach the threshold.

This is made safe by ensuring that if the threshold is being updated
then the node performing the update must have a threshold of delegates
locally in their storage. It also made safe by 2.

In 2. the protocol is tolerant by allowing delegates to be missing
from the serving side, as long as they can still meet a threshold of
delegates. This is further tolerant, when validating the received
data, a threshold of delegates are valid to consider the fetch
successful -- otherwise it will fail.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-03 14:30:05 +02:00
cloudhead f01aac8828
cli: Add `inbox` to help output 2024-03-26 13:13:14 +01:00
cloudhead e695d06bbb
node: Logging improvements & other small things 2024-03-25 12:05:05 +01:00
cloudhead dbf47fe4e9
Implement new versioning system
See `VERSIONING.md` for details.
2024-03-25 11:54:08 +01:00
cloudhead 33be2a62da
cli: Improve error when `radicle-node` isn't found 2024-03-22 16:41:51 +01:00
cloudhead 98b0d55fde
cli: Include all nodes we can announce to on sync
Previously, we only kept tracked of unsynced nodes we were connected to.
Now we track all unsynced nodes, since announcements are relayed.

We also cap the replicas to exit earlier in case of very low replica
count.
2024-03-22 16:35:06 +01:00
cloudhead 3535170f2d
cli: Improve errors and code for syncing
We distinguish between the cases:

a) There are no seeds at all.
b) There are no seeds to announce to despite the user wanting a higher
   replication factor, for example.
2024-03-22 16:35:06 +01:00
cloudhead ff79d15bb8
cli: Change syncing rule for configured seeds
Instead of waiting for *all* configured/preferred seeds to be synced,
we wait for at least one.

Note that the previous behavior can still be used by setting
`--replicas` appropriately.
2024-03-22 16:35:06 +01:00
cloudhead e6728db15a
cli: Unify all syncing code
We were using similar but slightly different syncing code in the
remote-helper, issues/patches and `rad sync`. This commit unifies them.
2024-03-22 16:35:06 +01:00
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 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
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
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
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
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
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 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
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