Commit Graph

798 Commits

Author SHA1 Message Date
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
xphoniex a49eec9892
node: Add eventing system to `Handler` and `Service`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-16 22:26:57 +01:00
Alexis Sellier ebfd445034
node: Use correct scope when getting namespaces
We were using the default scope instead of the entry scope.
2023-03-16 15:38:05 +01:00
Alexis Sellier 88c545bfdd
node: Make sure to only read packet-line header
If there is an unexpected error, eg. `BrokenPipe` in the upload process
process of the worker, we may have more than four bytes to read from the
remote socket. This change ensures that we don't attempt to read more
into a buffer of size `4`.
2023-03-16 15:26:16 +01:00
Alexis Sellier c46bc0cc82
node: Start periodic tasks
This change ensures that we start the periodic tasks "loop" by
scheduling the first wakeup during initialization.
2023-03-16 15:26:13 +01:00
Alexis Sellier fdfe1d508b
node: Use deserializer when decoding messages
For whatever reason, we weren't using the deserializer for message
decoding. This meant that if a message came in two pieces, it would
cause decoding problems, since the first piece would be discarded.
2023-03-16 15:26:13 +01:00
Alexis Sellier 17e3c975fb
node: Better error message when protocol mismatch 2023-03-16 15:26:13 +01:00
Alexis Sellier c4a66c20d0
node: Fix potential protocol mismatch on fetch
It's possible that the daemon or stream closes the git connection
without reading the final `done` packet. If this is the case, we
try to read it after either of the connections is closed.

This may potentially mitigate the issue where the node then receives
the `done` packet while in gossip mode, and disconnects the remote
for misbehavior.
2023-03-16 15:26:13 +01:00
Alexis Sellier cf6890f6f1
Flesh out `HACKING.md` 2023-03-16 13:06:38 +01:00
Alexis Sellier af7a7ada3e
ci: Add git tracing to node deployment 2023-03-16 12:30:15 +01:00
Adam Szkoda 41b9b46d99
ci: Add `--tracking-scope all` 2023-03-16 12:29:35 +01:00
Adam Szkoda 70779ec148
ci: Enabled backtraces on the server 2023-03-15 16:47:33 +01:00
Alexis Sellier 98ee9c46a9
node: Fix state mismatch between service and wire
Due to never removing peers from the peer map in the wire
protocol module, it was possible for there to be multiple
connected peers with the same Node ID. Some might be in a
"connected" state, while others might be "disconnected".

This caused a bug where a peer, although connected would
be considered disconnected by the wire module, because
when searching for a peer with that Node ID, the disconnected
one would return first.

To fix this, we make sure to remove peers from the map once
the connection is dropped.
2023-03-15 16:46:27 +01:00
Alexis Sellier 5828b917f9
node: Fail fast when repository can't be read
It's not a good idea to have fallible operations run after `FetchOk`
is received, since there's no easy way to communicate the error
to the remote at that point. What would then happen is that the fetch
just "hangs", since nothing is there to cancel it.

Hence, we compute namespaces earlier in the process, and store the
namespaces in the session. If there is a failure, the fetch is
never initiated.
2023-03-15 16:22:43 +01:00
Alexis Sellier bd436d4369
cli: Open tracking DB in read-only mode 2023-03-15 12:59:49 +01:00
Alexis Sellier 05d7090326
node: Remove `Handle::inventory` method 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 40c58b45ed
node: Move `routing` to `radicle` crate 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 cf8113765c
node: Move tracking store to `radicle` crate 2023-03-15 12:59:49 +01:00
Alexis Sellier cf80f246b3
node: Fix bug in seed stats 2023-03-15 12:48:03 +01:00
Alexis Sellier 13998dcf46
cli: Flesh out `rad self` 2023-03-15 10:25:23 +01:00
Rūdolfs Ošiņš fdd6bca311
httpd: Fix status code in commit history endpoint
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-03-15 10:17:41 +01:00
Fintan Halpenny de8e92d48c
radicle: safe Reaction construction
The Reaction type needs to ensure that the `char` stored for its value
meets certain requirements -- via its `new` constructor.

To ensure Reaction is always constructed correctly, the `pub` accessor
is removed, and the Deserialize implementation is implemented by hand
-- as opposed to using derive.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-14 14:31:12 +01:00