Make `rad patch` accept subcommands for specifying its operation in
place of the '--command' notation.
For instance `rad patch update` versus `rad patch --update`. Also make
the default operation list active patches, replacing patch creation.
Patch creation is now done via `rad patch open`.
Make these changes in a way consistent with other commands like `rad
delegate`.
Add '--no-confirm' to patch to support this subcommand's documentation
test.
Signed-off-by: Slack Coder <slackcoder@server.ky>
We shouldn't be marking attempted peers as "connected". We should wait
for the connection to be properly established.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
There are few unrelated changes in this commit that I wasn't able to
split out, mostly due to laziness, so I'll list them here:
* The node startup logic is moved out of the main function, and into a
dedicated functionin `client.rs`.
* There is a tentative worker implementation that is untested, and
handles git replication both ways. It's likely lacking in various ways
but I wanted to get it in there anyway.
* `Address` was moved from `radicle-node` to `radicle`, because it's
needed to send `Connect` commands from the node handle.
* The `netservices` dependency was updated.
* Finally, there is a first end-to-end node test, which currently
doesn't use NoiseXK, but uses the new reactor in `netservices`.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
Change `OperationName::Create` to `OperationName::Open` and change the
command argument to reflect this.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Outdated dependencies are producing warnings, some about upcoming
deprecations.
For example:
```
The `set-output` command is deprecated and will be disabled soon.
```
or
```
The `save-state` command is deprecated and will be disabled soon.
```
Signed-off-by: Slack Coder <slackcoder@server.ky>
Fix order of iteration, and make output look more like commit log.
Also show commit parent and message.
Signed-off-by: Alexis Sellier <self@cloudhead.io>
Make testing more convenient by reducing rad-remote-helper's dependency
on SSH Agent. It may be opted out of by setting the `RAD_PASSPHRASE`
environment variable.
Signed-off-by: Slack Coder <slackcoder@server.ky>
We were getting warnings in release mode, since the
debug code is not being run, and some vars are mutable
instead of immutable.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
By using `0` as the clock value for an empty state (without operations),
we simplify transaction code. Previously, there was no clock value for
empty states, which meant that we had to sometimes use an `Option`.
* Move storage impl into `storage::cob`
* Rename `change::Create` to `change::Template`
* Rename `change::Storage::create` to `change::Storage::store`
Some of the renames are to further distinguish COBs from Changes, and
the different types of "create" operations within cobs.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
We're using petgraph to encode an operation based CRDT (each graph node
is an operation) as a DAG, and one of the important things to ensure
is that the final state is not influenced by the order of concurrent
operations. In this case a concurrent operation would mean two potential
graph traversal orders, as there's no direct edge between the two
concurrent ops. This is essential a "partial order" of operations.
To be able to test this, we'd want some kind of control over how
neighbors are iterated over I guess, when there's more than one possible
sort order. Say we have a graph like this:
┌────────b◄─────┐
▼ │
a d
▲ │
└────────c◄─────┘
There are two possible topological traverse orders: [a, b, c, d] and [a,
c, b, d]. Having a way to go through these different orders would
be super handy.
One option would be to allow random order traversal. This would allow us
to test all orders by running the test enough times to likely test all
permutations.
Since petgraph doesn't support this, we implement our own simple DAG in
`radicle-dag`, which implements random-order topological orders.
For now, we don't make explicit use of these improvements, we simply
replace the underlying graph with our own.
* Use the correct passphrase type everywhere
* Allow conversion of secret key
* Extract logic for storing a key in keystore
Signed-off-by: Alexis Sellier <self@cloudhead.io>
Adds a `rad delegate` CLI command.
The command consists of three subcommands:
* `add` -- add a new delegate to the set of delegates of a project
* `remove` -- remove an existing delegate from the set of delegates of a
project
* `list` -- list the delegates of a project
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
To ensure that signatures are unique for verifying an identity a
HashMap is used in place of a Vec of tuples.
This prevents any double counting for quorum checks.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The `validate` method of `Project` was unused, which is problematic if
the attributes are supposed to be validated based on some
constraints. The issue is that `Project` provided public construction
of its fields with enforcing validation.
This change makes `Project`'s attributes private and introduces a
smart constructor `new` which is fallible if any of the constraints
are not met. The error type was changed to be a vector of errors since
all of these errors can be collected for better error reporting.
Deserialization also provided a way of constructing a `Project`
without ensuring any of the constraints were checked. To prevent this
a hand-rolled `Deserialize` is provided that goes through
`Project::new`.
To access the fields of `Project`, accessor functions are added and
all call sites are updated to use them.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Avoid delegating argument parsing to issue::run(). Define the forms a
peer can take when given as an argument using an enum. It is then used
to replace OperationName::Default, which is no longer needed, as the
commands default operation is now fully defined by the enum 'Operation'.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Allow listing issues for a given peer by using 'rad issue list' with an optional
argument.
For convenience, make listing your own issues easy by making it the
default operation of 'rad issue'.
Signed-off-by: Slack Coder <slackcoder@server.ky>