Commit Graph

992 Commits

Author SHA1 Message Date
Fintan Halpenny 3bfea69642
node: validate production in debug mode
Ensure that the production repository is validated after fetching and
performing deletions. This is to highlight any inconsistencies that
may show up between fetching and deleting references.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-04-28 14:26:47 +02:00
Fintan Halpenny 024218014b
node: test case for outdated refs
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-04-28 14:26:47 +02:00
Fintan Halpenny 694bd345d9
node: use ls-remote when in fetching mode
Given the scenario of 3 peers, A, B, and C each having a project R. If
peer A has B's fork, but C does not, then when peer A attempts to
fetch from C the fetch will be rejected since Git will fail when a
refspec that is asked for does not exist on the remote side.

To avoid this, the fetch logic is changed so that the client first calls
ls-remote to the remote side, which results in the references that the
remote has which the client is interested in. The follow-up fetch then
uses these refs as the refspecs -- which should succeed unless there
was a race for a deletion on the remote side.

The rest of the verification logic stays the same, so the storage
should still be in a working state before transferring from the staged
repository to the production repository.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-04-28 14:26:47 +02:00
Fintan Halpenny 5a48cdf507
node: ensure that we can fetch with a non-existent tracked node
Ensure that non-existent tracking relationships do not affect
fetching.

This is tested by first performing a clone, by `bob` from `alice`,
after `bob` tracks a remote that does not exist. `alice` creates an
issue which is then fetched by `bob` -- to ensure the fetching
scenario is also tested.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-04-28 14:26:47 +02:00
xphoniex ac12a4deee
cli: Implement `rad node start` with support for deamonizing
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-04-28 14:19:20 +02:00
Erik Kundt 362f26a0c8
tui: Update navigation design 2023-04-28 11:41:33 +02:00
Alexis Sellier 4a99e18562
docs: Update contributor guide 2023-04-28 10:59:31 +02:00
Slack Coder 2667569a6d
cli: Fix patch open/update when out-of-sync
Trying to open or update Patch will fail if the user's working copy is
out of sync with the Radicle projects canonical head.

Fix this by always operating on the storage when opening or
updating a patch.
2023-04-28 10:33:36 +02:00
Erik Kundt e757750398
tui: Fix clippy warnings 2023-04-28 10:27:37 +02:00
Erik Kundt 7c7379c733
tui: Implement new table design for patches 2023-04-28 10:22:58 +02:00
Erik Kundt b1c92f4a0d
tui: New labeled container design 2023-04-28 10:22:58 +02:00
Erik Kundt e268e75280
tui: Add custom block implementation 2023-04-28 10:22:58 +02:00
Erik Kundt 1fa49796ff
tui: Remove obsolete event handling 2023-04-28 10:22:58 +02:00
Alexis Sellier 3e9c3d2679
cob: Don't overwrite nodes during traversal
By not checking if the node exists, if a node is traversed twice,
the second instance of it gets overwritten, and all the edges get
lost.
2023-04-27 14:44:47 +02:00
Vincenzo Palazzo 730eaa00ca
cli: Improve `rad issue show` output
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-27 11:48:11 +02:00
Alexis Sellier 83547f9c8a
node: Close worker streams on disconnect
This is in an attempt to fix the worker pool from being backed up.
2023-04-27 11:42:33 +02:00
Alexis Sellier 60fc50644f
cli: Fix `Message::get` bug
We were not propagating the error properly.
2023-04-27 11:22:44 +02:00
Alexis Sellier 44298df48f
Update scripts with a couple of new ones 2023-04-27 11:08:56 +02:00
Alexis Sellier 0ecd8fb074
cli: Add `--draft` to `patch list` command 2023-04-27 10:54:19 +02:00
Alexis Sellier 12a91bd0ae
cli: Create `rad patch ready` command
Allows for converting patches to and from draft mode.
2023-04-26 16:53:24 +02:00
Alexis Sellier f111681dd6
cli: Add `--quiet` option to `patch open` 2023-04-26 16:42:58 +02:00
Alexis Sellier 182c9592c0
cli: Add `--draft` flag to `rad patch open`
Allows opening patches as drafts.
2023-04-26 13:47:43 +02:00
Alexis Sellier 3b20d45d80
cli: Display patches like issues, in `rad patch`
We also make sure not to bail if one of the patches fails to load.
2023-04-26 12:29:32 +02:00
Alexis Sellier b809bd3d73
cli: Force push refs on patch open/update
This ensures that `patch update` does not fail in a non-fast-forward case.
2023-04-26 12:29:32 +02:00
Alexis Sellier 3a9c8b7144
radicle: Remove `delegate` from `Remote` type
It wasn't being set correctly, and it's not the place for it,
so we remove it and set it in `httpd`.

Note that `Remote` is now simply a wrapper around `SignedRefs`.
If we want to remove the type or turn it into an alias, it will
require touching lots of different parts of the codebase. I opted
not to do that here as it's lower priority.
2023-04-26 11:06:55 +02:00
Alexis Sellier df25e9a2a5
radicle: Fix unverified `Remote::new` constructor
We were allowing remotes to be constructed via a function that didn't
check its inputs.

This is now fixed by moving the public key into the `SignedRefs` struct.
2023-04-26 10:57:26 +02:00
Alexis Sellier ccbfe5b6fa
node: Add warning if workers are all busy 2023-04-26 09:59:19 +02:00
Alexis Sellier 10fe2ae299
node: Add worker channel timeouts
It's currently possible for a channel to be blocked forever while
waiting for data, if the remote peer keeps the connection alive.
This can occupy a worker indefinitely.

With these timeouts, we ensure that workers exit if there is no
activity after a certain amount of time.
2023-04-26 09:59:19 +02:00
Alexis Sellier 5428420f27
node: Rework peer map to not panic
In the wire protocol, we often panic in case a peer is not found.
With this change, we instead log an error.
2023-04-26 09:59:19 +02:00
Alexis Sellier 7a08a1d459
cli: Get fetch after track working
When tracking a repository with the `--fetch` option, we run a fetch
once the tracking is done.

When tracking nodes, we don't accept the `--fetch` flag, as there may
not be a repository to fetch.
2023-04-26 09:49:37 +02:00
Vincenzo Palazzo 8d1bf9e997
cli: Show a message when there are no issues to display
This commit fixes the inconsistency with the `rad patch` command,
which previously displayed an empty table when there were no issues. Now,
the CLI will display a message indicating that there are no issues to display.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-26 00:58:09 +02:00
Alexis Sellier 3ea7541d55
cli: Replace seedling emoji with alien invader
To match the new branding, we remove seedlings and sometimes replace
them with alien invaders.
2023-04-25 12:47:36 +02:00
Alexis Sellier 045d201916
node: Fix log pluralization 2023-04-25 12:47:36 +02:00
Alexis Sellier 7d72b16087
cli: Call `rad sync` on `git push rad`
Instead of `Node::announce_refs`, we call `rad sync` to have the
terminal block while waiting for nodes to fetch the changes.

We also change the use of `git push` in the patch command to not
trigger syncing in that case.
2023-04-25 12:46:25 +02:00
Erik Kundt fed4e84dd7
tui: Reorganize component modules 2023-04-24 17:49:56 +02:00
Erik Kundt a2da673c31
tui: Split application into separate modules 2023-04-24 17:49:56 +02:00
Erik Kundt 969219c51d
tui: Split widgets into separate modules 2023-04-24 17:49:56 +02:00
Alexis Sellier 6346931ce2
cli: Add canonical remote to `init` and `checkout`
Add a remote that points to the canonical upstream.
2023-04-24 15:42:00 +02:00
Alexis Sellier d6cebf613f
cli: Remove `rad fetch` command
The command is replaced with `rad sync --fetch`. Soon, it will be called
from the git-remote-helper, so users won't have to call it explicitly.
2023-04-24 14:19:31 +02:00
Alexis Sellier a285943166
cli: Remove `rad push` command
Users should use `git push` or `git push rad` instead.
2023-04-24 14:19:24 +02:00
Alexis Sellier 671c169244
node: Implement `rad sync` command
This command announces refs to peers and waits for them to be
in sync.

Adds a subscribe method to `Handle` so that we can get the events
from the seed to allow us to confirm that the configured seeds fetched
from us.
2023-04-24 11:39:37 +02:00
Alexis Sellier 86feebe4d8
cli: Add `--quiet` flag to `rad issue` 2023-04-24 11:29:42 +02:00
Alexis Sellier d74535a5a5
Update license for `radicle-cob`
Now that we've obtained permission from the original author, we're
able to update the license to MIT/Apache.
2023-04-23 15:20:35 +02:00
Alexis Sellier 7f8526ff76
Update yanked version of `inquire`
Version 0.6.0 was yanked from crates.io.
2023-04-23 15:14:19 +02:00
Alexis Sellier fd3a6583d0
node: Improve framing code
Thanks to @fintohaps for these suggestions.
2023-04-23 15:10:42 +02:00
Vincenzo Palazzo 5a4d0fff3f
tests: add radicle command test for the rad remote
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-22 14:10:23 +02:00
Vincenzo Palazzo d55861572d
cli: accept from the cli the remote subcommand
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-22 14:09:30 +02:00
Vincenzo Palazzo fb44af9653
cli: implement the rad remote rm command
Implementing the `rad remote rm` command in order to be able
to remote a remote inside the radicle remote list.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-22 14:09:30 +02:00
Vincenzo Palazzo 027ccb943e
cli: implement the rad remote list command
Implementing the `rad remote list` command in order to be able to
list all the radicle remotes added to the repository

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-22 14:09:30 +02:00
Vincenzo Palazzo 33547c9c3c
cli: implement the rad remote add command
implementing the `rad remote add` command in order
to be able to add rad remotes from the command
line.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-04-22 14:09:30 +02:00