Commit Graph

76 Commits

Author SHA1 Message Date
Alexis Sellier b78790622f
cli: Improve test utilities
This will allow easy creation of multiple users with deterministic keys.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-24 10:46:57 +01:00
Slack Coder 87ff1990c0
cli: Create terminal::cob
Use a new module, `terminal::cob`, to collect collaborative object code to
improve consistency.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-20 13:46:02 +01:00
Slack Coder a0588460f3
cli: More informative `rad patch show`
Show entire patch commit history using `rad log --patch`.
2023-01-20 13:46:02 +01:00
Slack Coder 2295bb4ea4
cli: add `rad patch show`
Show patch information with `rad patch show`.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-20 13:46:02 +01:00
xphoniex 1e4cff4a0f
cli: Change `reaction` flag to `emoji`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-18 18:12:59 +01:00
Slack Coder 9243b9fdeb
cli: Add minimal `rad comment`
Allow users to comment on an Issue.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-18 18:08:09 +01:00
Alexis Sellier be9def8b11
Rename `profile::Paths` to `profile::Home`
This makes the intent clearer.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier d31968509d
Speed up node E2E tests
By allowing the node to run using a `MockSigner`, we speed up tests
significantly, since PBKDF2 doesn't need to run.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Slack Coder 592b0047a4
rad-patch: create tracking branch on push
If not tracking branch is set, create one when pushing.  This is a common
default behavior for git and avoids failing over on some installations.
2023-01-17 10:08:44 +01:00
Slack Coder 8f8eacc078
github: Workaround test dep on git remote helper
Workaround a client documentation test dependency on radicle's
radicle-remote-helper.

The framework has yet to support using the projects version directly.  A
proper fix is non-trivial.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-17 10:08:44 +01:00
Slack Coder 54bcb91339
cli: Allow using `git` in doc tests
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>
2023-01-17 10:08:44 +01:00
Slack Coder 284aadc37c
cli: Avoid trailing spaces on list
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>
2023-01-17 10:08:44 +01:00
Slack Coder a6d59b3c0e
cli: alter use subcommands for patch
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>
2023-01-17 10:08:44 +01:00
xphoniex 7962ac0a8e
httpd: Add api tests
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-12 20:30:53 +01:00
Slack Coder 897d439f95
radicle-cli: Correct operation name
Change `OperationName::Create` to `OperationName::Open` and change the
command argument to reflect this.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-01-12 19:59:43 +01:00
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