Commit Graph

822 Commits

Author SHA1 Message Date
Alexis Sellier 973f618cd3
node: Fix routing table update on refs
The announcer is always the one who must have the refs, not the relayer.
This was changed in a recent patch.
2023-03-30 10:24:09 +02:00
Alexis Sellier 7c41c5edff
node: Replace most sleeps with events
With the new event system, we can replace the thread sleeps by
waiting for events. This should speed tests up a lot and
be more reliable.
2023-03-30 10:24:06 +02:00
Alexis Sellier 6fb6cff708
term: Add border support for tables 2023-03-27 17:46:32 +02:00
Fintan Halpenny af99d6f47a
radicle: set identity head on init
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-27 10:13:04 +01:00
Fintan Halpenny a629f91b1e
node: set identity head after fetch
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-27 10:13:03 +01:00
Fintan Halpenny a32101ab75
radicle: canoncial refs/rad/id
Introduce a canonical reference for refs/rad/id to aid in discovering
information about a repository without knowing a peer -- e.g. if a
peer wants to clone a new repository it needs to find out which peers
are delegates for that project, but does not know what their NIDs are
up front.

The approach mirrors the canonical `head` for a repository and
introduces useful constructors for `Doc`/`DocAt`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-27 10:13:03 +01:00
Han Xu b030e9ea80
node: Only fetch from tracked nodes
The tracked nodes include nodes marked tracked in the db, and
the delegates and `Namespaces::All` if it is a new repo.

Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-03-25 12:27:29 +01:00
Sebastian Martinez a5746b4f08
httpd: Add reactions to issue and patch json
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-25 12:04:53 +01:00
Sebastian Martinez 6b62f5bb28
httpd: Add patch head refs to patch output
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-25 11:54:09 +01:00
Alexis Sellier da9d63b284
node: Fix fetch requests code
We were not correctly deleting the fetch request, since only one
was kept per RID.
2023-03-24 13:25:40 +01:00
Alexis Sellier fe8953ab8b
node: Don't penalize peer for protocol mismatch
Instead of returning a non-transient disconnect reason, return
a transient one, since protocol mismatches can happen.
2023-03-24 13:23:43 +01:00
Alexis Sellier d3f4189324
node: Fix reconnection logic
First, we make sure to always attempt reconnection to persistent peers,
no matter the reason.

Second, we don't re-attempt connections when an inbound peer
disconnects. This minimizes the chance of connections crossing.

Third, we clean up `session::Error`, and don't use it to signal a
missing session, since it doesn't really belong there.
2023-03-24 13:20:34 +01:00
Alexis Sellier 4438a10498
node: Change ping interval to 1 minute
30 seconds is too chatty.
2023-03-24 13:19:36 +01:00
Alexis Sellier 8dba01d6ae
cli: Improve patch command output
* Fix timeline ordering
* Remove spinner noise
* Add revisions to timeline
2023-03-24 13:04:52 +01:00
Alexis Sellier 40eb6f2a6e
term: Remove unused file 2023-03-24 11:25:04 +01:00
Alexis Sellier bfea229850
node: Relax `Service` storage trait bound 2023-03-23 18:08:06 +01:00
Alexis Sellier 577a232a68
cli: Fix multiline `patch show` description output 2023-03-23 14:43:21 +01:00
Alexis Sellier 6c1e2d0ddd
cli: Don't strip initial message from editor
This was problematic when the initial message was a valid default.
2023-03-23 14:43:21 +01:00
Alexis Sellier 63fc06c817
cli: Don't have blank line if no description
Changes `rad patch show` to not have a blank line when there is no
description.
2023-03-23 14:43:21 +01:00
Sebastian Martinez 8e3b629178
cli: Enable `rad tag` and `rad untag` for patches as well
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-23 11:53:11 +01:00
Sebastian Martinez 564886b165
httpd: Add `path` property to `CodeLocation`
For the web client to be able to show file we need to provide
the web client with the file path.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-23 11:41:13 +01:00
Sebastian Martinez 00ea587c6d
httpd: Add `CorsLayer` to `/raw` endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-23 11:07:58 +01:00
Alexis Sellier c427f41379
node: Fix periodic inventory announcement
1. We were announcing inventory every 30 seconds. This is now changed
   to 1 hour.
2. We were using a variable to track whether our inventory has been
   announced to the network, but this var was set based on what we
   tracked, not the inventory we had. This var has been removed.
2023-03-22 22:03:59 +01:00
Alexis Sellier 71cf289c52
Skip hidden files in repository listing 2023-03-22 18:25:31 +01:00
Alexis Sellier e103ffbb95
Improve invalid RID error 2023-03-22 18:25:31 +01:00
Vincenzo Palazzo 654a21b2b3
cli: Allow git revision parameters as COB IDs
This commit allows any git revision to be used instead
of the full SHA-1, when specifying COBs.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-03-22 15:38:14 +01:00
Sebastian Martinez f2d31aa9c0
httpd: Add patch update endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-22 13:53:19 +01:00
Alexis Sellier dd97ac8384
node: Improve worker error handling
Better handle case where the connection to the daemon fails, in the
responder scenario.

Instead of trying to read the `done` packet once, we loop until we've
read it. This handles a scenario where the uploader fails before the
git protocol is initiated, and the fetcher is still sending git packets.
2023-03-22 12:22:44 +01:00
Alexis Sellier a9d1a71f7a
node: Add timestamp to test logger 2023-03-22 12:22:44 +01:00
Adam Szkoda 1455810d57
node: Add commit SHA-1 to log 2023-03-22 08:52:52 +01:00
Adam Szkoda b4c3bee39d
cli: Add CLI commit SHA-1 to help 2023-03-22 08:52:35 +01:00
Han Xu 241c41a632
node: Queue pending fetches in Session
Pending fetches are drained one at a time after the previous fetch is
completed.

Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-03-22 08:46:27 +01:00
Sebastian Martinez fc724a2333
httpd: Add commit diff endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-21 18:50:26 +01:00
Sebastian Martinez f9980f7205
radicle: Fix `canonicalize_home` test on macos
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-21 18:40:55 +01:00
Alexis Sellier c51585dbf9
tui: Fix clippy issue 2023-03-21 13:19:38 +01:00
Alexis Sellier db8ec5735f
cli: Use new widgets for `patch list` 2023-03-21 12:43:44 +01:00
Alexis Sellier ab74e54949
term: Implement new output widget system
We implement a new `Element` trait which allows for more complex output
to be drawn, such as vertical and horizontal stacks.

We adapt `Table` to work within this system.

We refresh the output of `rad patch show` to use these new tools.
2023-03-21 12:43:44 +01:00
Sebastian Martinez 73221e43d7
httpd: Add more revision properties to patch
For display purposes in the web client, we add with this commit the
some needed properties to the revisions in the patch endpoint.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-20 18:43:06 +01:00
Slack Coder b6c1560a0a
cli: add workflow example with two peers
Make the documentation more realistic by using two peers, a maintainer
and a contributor, for the client examples.  Define them as 'workflow'
examples, ordering them in their own directory to aid user navigation.
2023-03-20 18:27:58 +01:00
Erik Kundt d331389ada
tui: Implement workspaces container
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Erik Kundt 791c378d4e
tui: Show project payload
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Erik Kundt 897f4c5250
tui: Support property lists
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Erik Kundt bd4efee897
tui: Implement basic application
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Erik Kundt 62867d26bd
tui: Add basic framework
Signed-off-by: Erik Kundt <erik@zirkular.io>
2023-03-20 16:27:42 +01:00
Alexis Sellier 5ccf38079c
cli: Make `patch checkout` fetch missing objects
Before this change, `rad patch checkout` would fail if the patch commits
were not in the working copy.
2023-03-18 12:24:17 +01:00
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
Rūdolfs Ošiņš d40f40b9af
httpd: Use camelCase in query params
It's more ergonomic to consume in JS/TS.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-03-17 17:11:00 +01:00
Alexis Sellier ed1120f3eb
node: Don't relay redundant gossip messages
This change ensures that on `Subscribe`, we only relay the latest
announcement of each node, per announcement category.

Previously, we would relay all announcement, while only the last one
was relevant.
2023-03-17 17:10:10 +01:00
Sebastian Martinez 2c0cdcd1c5
httpd: Add timestamp to revisions json
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-17 13:54:48 +01:00