Commit Graph
216 Commits
Author SHA1 Message Date
Alexis Sellier eecea67ffd cob: Deduplicate change parents 2023-04-14 13:54:27 +02:00
Alexis Sellier 97f076e3cf Include dependencies for certain COB actions
We ensure that for example, the given commits are fetched before the
revision or merge actions in a patch.
2023-04-14 13:22:10 +02:00
Alexis Sellier 9db63a8801 cli: Cleanup patch, checkout and clone output
Remove extra whitespace, start moving away from sprout.
2023-04-12 12:02:38 +02:00
Alexis Sellier 89b9eb53b7 node: Implement protocol multiplexing
To improve the reliability and flexibility of the protocol, we introduce
multiplexing over peer connections. This involves a new `Frame` type
that carries a stream-id and payload.

Three stream types are made available:

1. Control
2. Gossip
3. Git

This change brings the following improvements:

* Removed need to queue fetch requests
* Removed need to queue gossip messages
* Removed need for `Fetch` and `FetchOk` messages
* Service doesn't need to know about inbound fetches
* Removed one round-trip for fetch negotiation
* Removed special `done` git packet
* Removed session logic and state around Git/Fetch protocols
* Removed code around upgrading/downgrading transport
* Worker in responder mode is able to process any number of fetches
* Connections support any number of concurrent fetches

We had to introduce a few extra things however to make it all work:

* A `VarInt` type for variable-length integers, since we want the frames
  to be lightweight.
* A custom "tunnel" implementation, since we couldn't use the existing
  one anymore.

Overall the change removes more complexity than it adds, while improving
the protocol along the way.
2023-04-10 14:41:55 +02:00
Adam Szkoda 0f47dc9057 cli: Make rad rm work without a fork 2023-04-10 10:42:22 +02:00
Alexis Sellier 3d40a606f7 cli: Fix rad track help output
Even though we accept `did:key` as a substitute for NIDs, we don't
generally accept DIDs in this command.
2023-04-10 10:28:46 +02:00
Alexis Sellier c1face7cd8 cli: Fix and simplify rad review
* Properly remove review help message from review
* Remove `--no-confirm` and confirmation step

The CLI should be mostly non-interactive for day-to-day commands,
keeping the interactivity for the TUI.
2023-04-10 10:27:52 +02:00
Alexis Sellier f999a62da2 cli: Show patch status in color in patch show 2023-04-10 10:17:38 +02:00
Alexis Sellier 7d1e3d489b cli: Add patch archive sub-command 2023-04-10 10:17:37 +02:00
xphoniex 414477a316 cli: Unify format of help messages
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-04-10 10:06:45 +02:00
Alexis Sellier 33461e4be1 Set patch status to merged automatically
When a merge is applied to a patch, we check whether the threshold
of delegates has been reached, at which point we set the patch status
to `merged`.

This requires threading the identity document oid through the "apply"
process.
2023-04-05 10:32:45 +02:00
Alexis Sellier 6b44955cd9 cli: Show timeline in patch show 2023-04-04 21:19:50 +02:00
Alexis Sellier 9e50d9053a cli: Additional fixes in the merge process 2023-04-03 16:06:24 +02:00
Alexis Sellier b6fa4a4b2a cli: Some improvements to rad merge 2023-04-03 16:06:24 +02:00
Alexis Sellier cf37950828 node: Rename control socket
The old name, `radicle.sock` didn't tell us much about the purpose
of this socket.
2023-03-31 17:29:58 +02:00
Slack Coder 0b7f169c8b cli: Support revision id in rad merge
Revision IDs are globally unique.  Users will be able to use the
Revision ID in place of its patch ID.

Make `rad merge` refuse to merge an older revision unless the `--force`
option is given.
2023-03-31 17:24:55 +02:00
Sebastian Martinez 87f47cdc67 Reduce pub accessors in patch and issue cob structs
Replaces pub accessors to struct fields with methods
Also creates some methods to compute necessary information

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-31 13:44:37 +02:00
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
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 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
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
Adam Szkoda b4c3bee39d cli: Add CLI commit SHA-1 to help 2023-03-22 08:52:35 +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
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
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
Alexis Sellier bd436d4369 cli: Open tracking DB in read-only mode 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 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 13998dcf46 cli: Flesh out rad self 2023-03-15 10:25:23 +01:00
Alexis Sellier 9c77332cba cli: Implement tag and untag
These commands are added at the top level because they will eventually
also work on patches.
2023-03-13 15:08:14 +01:00
Alexis Sellier 2737369910 cli: Fix missing patch announcement 2023-03-13 14:37:01 +01:00
Alexis Sellier f7aac06a8f cli: Polish assign and unassign commands 2023-03-13 12:27:47 +01:00
Alexis Sellier 8e5627d28a node: Rename tracked_repo -> repo_policies
I was finding the current naming misleading, as the returned entries
could be for blocked repos/nodes.
2023-03-13 11:41:07 +01:00
Alexis Sellier b33fb2a33d cli-test: Improve testing framework logging
Show which file is being run.
2023-03-13 11:38:33 +01:00
Vincenzo Palazzo f8aa1daedb cli: show the issue when it is created
Show the issue when it is created to give feedback to the user.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-03-12 19:26:28 +01:00
Slack Coder 166f7e7cc2 cli: Minimize patch info on creation
Reduce noise when showing patch information to the user on creation by
only showing the git branch name and not the commit reference.
2023-03-11 18:38:54 +01:00
Alexis Sellier 34a2d1a9dc cli: use canonical head for patch target
Correct assumptions made about how patching work in `rad patch`.  Make
the default Patch target a `git ref` in place of a target 'peer'.

Use the canonical head as the git reference.  This is head of the
project's master branch which project delegates have concensus on.
2023-03-11 18:38:54 +01:00
Alexis Sellier aacacf872f cob: Use EntryId as the operation identifier
By introducing a small limitation: only allowing entries in the change
graph to be addressable, instead of individual operations; we
drastically simplify the CRDT implementation.

There are four advantages:

1. Op ids are just regular SHA-1s
2. There's no need for relative IDs, ops never refer to other ops within the
   same commit
3. There's no need for a nonce, since commits can't collide, and neither can op IDs
4. `OpId` can just be an alias of `EntryId`

The disadvantage of course, is that we have to be mindful of how we
create op transactions, since each transaction creates an addressable
unit. For example, we must not include multiple patch revisions in the
same transaction.
2023-03-09 17:08:56 +01:00
Alexis Sellier adbf6f5bf5 cli: Improve patch command
Cleanup and simplify output of patch command.
2023-03-08 20:23:49 +01:00
Alexis Sellier 1168f2ddb5 cli: Update track command
Allows the `track` command to be used to track nodes and repos.
2023-03-08 15:32:34 +01:00
Fintan Halpenny 1e8f5b2259 node: determine fetching namespace based on repo policy
To determine the correct Namespaces to use, the repo Policy and Scope
are consulted.

If the policy is Block then this is a failure state and is reported to
the other end.

Otherwise, if the policy is Track, then the scope is checked. For the
Trusted Scope then the Namespaces should consist of all tracked nodes
and delegates for the given repository. However, the repository might
not exist and so it is necessary for the whole repository to be
fetched.

For the All Scope, all Namespaces are fetched.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-08 11:33:41 +00:00