Commit Graph

1788 Commits

Author SHA1 Message Date
cloudhead 6288dd0a24
radicle: Load inventory lazily
Instead of loading the inventory cache on storage open, load it
when the `inventory` function is called and the cache is `None`.
2024-03-21 18:03:18 +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
Alexis Sellier 8b1dc8f168
node: Connect to preferred seeds
Make sure we connect to and keep connected to preferred seeds.
2024-03-21 12:47:32 +01:00
Sebastian Martinez 3aca2a11b0
httpd: Only return cache header on success 2024-03-21 12:45:13 +01:00
cloudhead 04a4aa06c9
httpd: Fix broken test 2024-03-21 12:43:35 +01:00
cloudhead f1f1313b6d
node: Update `netservices` to 0.8.0
The previous version was relying on a broken method from `socket2` that
switched non-blocking sockets to blocking.
2024-03-21 12:40:58 +01:00
cloudhead d771ce8522
node: Make `Storage::refresh` private 2024-03-21 12:40:58 +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
cloudhead 0e880e12e6
node: Cache node inventory
For large seeds with many repos, it's expensive to traverse the
inventory everytime the node connects to a new peer, for example.

To improve the situation, we cache the inventory per `Storage` instance,
and add a `refresh` method to refresh the inventory.

This method is called when the node is told to synchronize its
inventory.
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
Alexis Sellier 623ef278d0
helper: Add `-o hints` push option
Works even if you have hints disabled in config.
2024-03-18 12:57:32 +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 74abd789c7
httpd: Fix private repo visibility
Make private repos invisible on all routes, including /raw endpoints
and Git clones.
2024-03-17 21:13:25 +01:00
cloudhead 62fa8c25c8
scripts: Delete old install script 2024-03-15 16:53:09 +01:00
cloudhead 15efae2a74
docs: Use POSIX-compliant install command 2024-03-15 10:36:22 +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 54aacc9619
ci: Add version file to binary release
This commit also upgrades deprecated actions.
2024-03-13 12:36:03 +01:00
cloudhead d7c88f12ab
radicle: Fix some doc comment issues 2024-03-12 16:13:08 +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
Fintan Halpenny 3ad2b4431f
fetch: only send changed wants and haves
This change limits the amount of `wants` and `haves` data that is sent
to the serving side of a fetch.

When a `RefsAt` announcement is sent, the fetching peer can calculate
the difference between the `rad/sigrefs` they're aware of -- if it
exists -- and the newly advertised `rad/sigrefs`. This means they can
efficiently ask for the `wants` and `haves` of references that have
changed -- saving some data sent over to the serving side.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-12 13:01:03 +01:00
cloudhead 0f0f9ff9b4
helper: Check for missing canonical head
Without the canonical head in the working copy, the next check will fail
with a cryptic error.
2024-03-12 12:56:45 +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
cloudhead fa4b929a06
ci: Remove old deploy script, cleanup build 2024-03-11 16:54:52 +01:00
Lars Wirzenius 570a7eb141
build.rs: fix formatting
.radicle/native.yaml runs "cargo fmt --check" and that fails without
this change.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-11 13:29:37 +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 71d4cb0128
radicle: TypedId improvements
- Add `Serialize` implementation
- Add `is_identity` method

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 98bb91680d
httpd: Update stats to count all repos
Instead of filtering private repos for a total count, we should count
all repos.
2024-03-11 12:38:00 +01:00
Sebastian Martinez 955c942c18
httpd: Improve alias use in tests 2024-03-11 12:31:28 +01:00
Sebastian Martinez 088549a333
httpd: Add support for submodules 2024-03-11 12:27:27 +01:00
Sebastian Martinez bdd1b238fc
Bump `radicle-surf` to 0.19.0 2024-03-11 12:27:27 +01:00
cloudhead 3d7ae89a83
httpd: Fix tests 2024-03-11 12:24:30 +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 325289d28f
httpd: Insert test node into node db in `test::profile` fn
To allow the `AliasStore` to retrieve an alias from the node db, we need
to insert it manually into the database in the `profile` function, else
we won't find any Aliases there.
2024-03-11 11:52:46 +01:00
Fintan Halpenny b1435629f9
fetch: re-work transport::done signal call
The protocol requires that the fetcher signals to the remote that it
is done with the fetching process, so that the remote can exit out of
its upload-pack process.

The first change is that the `done` signal can happen before the
validation, since nothing else needs to be fetched.

The second change is that the fetcher does not care if the remote
responds to this signal since it has the data required for validation
and applying the changes to its refdb. Thus, if an error is
encountered then it is logged, but the rest of the process proceeds as
normal.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:42:15 +01:00
Fintan Halpenny c02ff1e47e
fetch: log handshake error
When performing a handshake, the error source is hidden in the error
variant and never shown.

To get insight as to what the error was, it is logged when it is
encounterd.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:34:49 +01:00
Fintan Halpenny 6efd0d97a5
fetch: add logging for stages
Log when different stages of the fetch have completed, while also
providing the elapsed time, in seconds.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:34:17 +01:00
Fintan Halpenny 4b268adf49
node: downgrade log statements
Announcement are logged at the debug level and are very frequent. This
causes a lot of noisy logging in a node.

Downgrade the log levels for these messages from debug to trace.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:28:38 +01:00
Fintan Halpenny 68339d86b9
node: increase timeouts
For larger fetches, a timeout for the channels and socket control are
required. Bump the timeout from 9s to 30s.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:28:38 +01:00
Fintan Halpenny 4d50f79f1c
node: remove unused timeout
The timeout was never being used, so it is being removed for the time
being.

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