Commit Graph

61 Commits

Author SHA1 Message Date
Slack Coder a407c3a4f8
cli: simplify inspect
Remove redundant 'collect()' call.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-10 16:37:20 +01:00
Alexis Sellier a8bca9cd92
cli: Use imperative for commit message in `edit`
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-09 16:48:05 +01:00
Alexis Sellier a6066e3ac3
cli: Update `inspect` command
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>
2023-01-09 16:48:01 +01:00
Slack Coder 03bc9d84d6
rad-remote-helper: honor RAD_PASSPHRASE
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>
2023-01-09 16:44:35 +01:00
Alexis Sellier e49226c500
cli: Make some changes to issue listing
* Use an `--assigned` flag
* Default to listing all issues

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-03 18:59:13 +01:00
Alexis Sellier f193d7d6cc
Improvements to keystore
* 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>
2022-12-27 13:43:16 +01:00
Alexis Sellier 9ec7a0a2ce
cli: Fix flaky tests
We were setting the CWD for the parent process, which wasn't such a good
idea.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2022-12-27 12:53:57 +01:00
Fintan Halpenny aa05f676f7
cli: add delegate cli
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
2022-12-27 12:25:24 +01:00
Fintan Halpenny adaed6a3ac
radicle: validated construction of Project
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
2022-12-27 12:23:39 +01:00
Slack Coder 94be0ca392
cli: Make issue args more declarative
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>
2022-12-26 15:53:06 +01:00
Slack Coder 61fe352ad9
cli: rad issue show
Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-12-26 15:52:14 +01:00
Slack Coder 260863f571
cli: list your assigned issues via 'rad issue'
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>
2022-12-26 15:52:14 +01:00
Slack Coder 83f2f2b5a5
cli: Make terminal::Table more accepting
Make the Table type easier to use by having it accept &str over String
types as arguments.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-12-26 15:44:19 +01:00
Slack Coder c0590a100d
cli: Lightly document terminal::Table
Help developers by giving a small description and example for its use.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-12-26 15:43:47 +01:00
Slack Coder 6b67e0571e
cli: Use term::Table to print list of issues
Signed-off-by: Slack Coder <slackcoder@server.ky>
2022-12-26 15:38:39 +01:00
Slack Coder 946d6ac675
cli: assign and unassign issues
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>
2022-12-26 15:38:39 +01:00
Alexis Sellier e47d7ca2aa
cob: Implement comment edit action
This implementation intentionally preserves all edits such that
they may be displayed in an application as an edit history.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-16 12:32:20 +01:00
Alexis Sellier f26674a5a9
Upgrade Rust to 1.66
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-15 20:55:26 +01:00
Alexis Sellier bdbf111163
Refactor identity verification
Introduces a new `DocAt` type.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-12 15:01:47 +01:00
Alexis Sellier d309f593b1
Move doc initialization to storage
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 22:06:21 +01:00
Alexis Sellier b37fef9f22
Re-organize identity types and modules
The new hierarchy should be much more correct, and cleaner:

* `identity` (`Identity`)
* `identity::did` (`Did`)
* `identity::doc` (`Doc`, `Payload`)
  * `identity::doc::id` (`Id`)
* `identity::project` (`Project`)

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 22:06:20 +01:00
Alexis Sellier 98c1566109
Make `Doc` type payload generic 2022-12-09 22:05:38 +01:00
Alexis Sellier 7b8bb08b08
Consolidate `node::Handle` traits into one
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 10:52:18 +01:00
Alexis Sellier a100f1c683
cli: Implement tracking correctly
The tracking command was tracking a project when it should
have been tracking peers.

We also add the ability to pass an alias when tracking from
the CLI.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 10:52:18 +01:00
Alexis Sellier 5d2be57cd9
Rename patch/issue "status"
This reverts to the previous naming, since after serialization
we would otherwise end up with `{ status: { status: closed } }`.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 10:44:59 +01:00
Alexis Sellier 66d76d7ab2
radicle: Use `defaultBranch` for payload key
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>
2022-12-07 18:01:47 +01:00
Alexis Sellier 207d2133f9
Remove delegate names from identity doc
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>
2022-12-07 12:16:00 +01:00
Alexis Sellier c33aa87589
Move CLI command tests to integration tests
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-06 10:01:41 +01:00
Alexis Sellier e63f334890
cli: Replace `trycmd` with our own test runner
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>
2022-12-06 10:01:38 +01:00
Alexis Sellier 64ce15dbe2
crdt: Include timestamp in `Change`
We can then use the real change timestamp for our COBs.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-02 14:19:25 +01:00
Alexis Sellier 0dc34dc15d
Implement patches with radicle CRDTs
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Alexis Sellier 09a8b46f34
cob: Move clock out of `Issue`
The clock shouldn't be part of the issue state, but rather
the local "actor" state.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Vincenzo Palazzo c7d5ffe51b
cli: fix ambiguity between mutually exclusive args
There are some cases where it is just safe to skip the `--x` flag
because it is already set to true by default, and other cases where we
need to use an option value.

Also, I may miss some team code conventions regarding the PartialEq and
Eq macros to enable the quality on the `Comment` type!

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-12-01 10:18:58 +01:00
xphoniex c597b6989e
cli: Change help descriptions for cmds
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-28 11:25:06 +01:00
xphoniex 5532d40aae
cli: Add rest of cmds to `rad`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-28 11:25:06 +01:00
Alexis Sellier 171b5a45f7
Implement issues using radicle CRDTs
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:41:37 +01:00
Alexis Sellier 01ad0fb31d
cob: Split generic code from automerge-specific 2022-11-26 17:13:18 +01:00
xphoniex 21e47c7a34
cli: Use the build.rs at root
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-23 19:48:15 +01:00
Alexis Sellier e258c72eca
Implement some CLI tests using `trycmd`
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>
2022-11-22 10:44:30 +01:00
Alexis Sellier d6a95e4d58
Support `RAD_PASSPHRASE` in `signer` method
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 1d798a80b4
Fix issues with incorrect terminal width
For some reason, the terminal width isn't always valid, and
then ends up returning `80`.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier fd936becf1
Make `Profile::init` more flexible
Allow passing a custom home.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier 03fd69f323
Configure CLI default bin
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier bdeebfb79a
Add `rad-path` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +01:00
Alexis Sellier b4bc032113
Add `rad-merge` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-17 09:25:17 +01:00
Alexis Sellier 01047a4942
Add `rad-review` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 16:38:51 +01:00
xphoniex 89bdf59e8e
Add `rad-issue` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-16 16:28:31 +01:00
Alexis Sellier 47d20003c0
Implement `rad-patch`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 12:07:19 +01:00
Alexis Sellier dea268c389
Implement `rad-push`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-16 11:36:23 +01:00
xphoniex a496eeb84d
Add `rad-rm` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-15 16:22:08 +01:00