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.
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.
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.
By mapping all '[.. ]'s with any number of spaces inside them into
'[..]'s, examples can preserve text formatting while using this glob
pattern.
The downside is failed output will show '[..]' in place of the original
version with spaces.
* 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.
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.
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.
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>
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.
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.
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.
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.
The method `track_repo` only accepted the RID as the argument for
tracking.
Instead, allow passing Scope as an argument for tracking a
repository.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
It's fairly easy for a user to (by mistake or intentionally) create two
operations with the same OpId. This patch makes it much less likely,
and ensures that if the OpId is equal, it's because the operations
are identical.
Improvements to the CLI output as well as converging towards
`termion` as a backend.
The crates we were using for prompting and spinners were based on
a terminal backend called `console`, which is not really used
anywhere else. There were also limitations in terms of the output
of these crates.
Therefore, we switched to the `inquire` crate for prompting, using
the `termion` backend, which is very standard.
Additionally, we simplify the terminal output to use symbols:
! for Warning
✓ for Success
✗ for Error
... Instead of a mix of words and symbols.
We also include a modified version of the `yansi` crate which plays
well with our table formatting functions by automatically truncating
and padding output in a unicode-aware way.
The `From` implementation would allow someone to create a `Home` in an
incorrect fashion, for example the path is not canonical.
Exchange `From` for a `TryFrom` implementation.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑` While we want to maintain
`Author` and `ActorId` for internal use.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
The CLI commands and output use PublicKey, ActorId, and NodeId for
peer identifiers.
Instead Did should be standardised for use in CLI arguments and
outputs.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit allows to checkout a patch created
with `rad patch open` in a new branch
named `patch/{short_patch_id}`.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit includes a simplification in finding the
long patch id in order to perform operations like
`patch show <id>` and `patch checkou <id>`.
Actual output
```
➜ rio git:(main) rad patch list
- YOU PROPOSED -
patch text 8c94760699e R0 f1b2740 (macros/rad_patch) ahead 1, behind 0
└─ * opened by z6MkuvfwAkZ6yD6Z5TT6YXfJjFNPMQz9fPi9BSU7gwhS9s2x (you) 12 minutes ago
└─ * patch id 8c94760699e3e2da64aa9f14f4d2cecfe7b754ad
patch text 78e0fb5ad45 R0 f1b2740 (macros/rad_patch) ahead 1, behind 0
└─ * opened by z6MkuvfwAkZ6yD6Z5TT6YXfJjFNPMQz9fPi9BSU7gwhS9s2x (you) 24 minutes ago
└─ * patch id 78e0fb5ad45481d225a6fb45f51422e468b55c94
- OTHERS PROPOSED -
Nothing to show.
```
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Add the resulting SHA of the new Identity when performing `rad id
commit`.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The last commit of a newly cloned repository should remain untouched by
making `Node::project()` use a repository fixture instead of a randomly
generated one.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Simplify codebase by splitting patch::create::run() into patch::create::run() and
patch::update::run().
Patch has the subcommands `create` and `update` but both use the same
method to do the heavy lifting. Spitting the code allows us to detangle
the code path making it easier to follow.
Also, reduce cognitive load by minimizing the amount of variables used
and isolating them to utility functions. For instance, `head_branch` can be passed to
these methods instead of `head_oid` and `head_branch`.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Define git author name and email address, and others to allow using it
deterministically in documentation tests.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Use '-'s to avoid trailing spaces on items when listing patches.
The spaces are used as part of the format with colouring. However they
are a nuisance to support in testing given the autoformatting of editors
to remove them.
Signed-off-by: Slack Coder <slackcoder@server.ky>
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>
Change `OperationName::Create` to `OperationName::Open` and change the
command argument to reflect this.
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>
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
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>
Allow assigning an issue to one or more people via a new subcommand.
rad assign <issue> <peer>
To unassign:
rad unassign <issue> <peer>
To support testing and documentation, create an example for maintaining
issues for a project.
Signed-off-by: Slack Coder <slackcoder@server.ky>
This was changed by mistake from the previous format used in radicle
link. We restore all keys to camel-case.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
We are working on other mechanisms to help identify keys, and this
is just redundant.
Also update some of the CLI examples to create a canonical example
for documentation.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This will allow us to run commands other than `rad`
and to have tests that switch between different users.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
I'm not entirely satisfied with `trycmd`, but it's a start.
If we choose to move to a different crate, or implement our own,
we can keep the example test cases.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>