Commit Graph

96 Commits

Author SHA1 Message Date
Alexis Sellier 3e7761740f
node: Rely on inventory announcement in `rad init` 2023-02-13 09:59:44 +01:00
Alexis Sellier 8c7c2242cc
cli: Announce fork in `rad clone`
This allows peers to know about its existence.
2023-02-12 17:11:43 +01:00
Alexis Sellier 27d0c8f235
cli: Track projects we initialize 2023-02-12 16:48:46 +01:00
Alexis Sellier b2dbf12862
cli: Fix `rad rm` command 2023-02-10 12:56:11 +01:00
Rūdolfs Ošiņš f1de61ad88
cli: Allow specifying protocol for `rad web`
This also adds an informative text instructing the user what clicking
the link does and improves the CLI argument names.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-02-09 16:51:32 +01:00
Slack Coder ac812d7834
rad: Add comment `reply-to`
Allow replying to patch and issue comments using `rad comment --reply-to` option.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-09 16:42:47 +01:00
Alexis Sellier b108342fab
cli: Test clone failure for unknown repo 2023-02-08 21:28:59 +01:00
Alexis Sellier 69ac8be8fd
node: Update local routing table on announce 2023-02-08 21:28:49 +01:00
Alexis Sellier f01735bef6
cli: Have `init` trigger routing table updates
Before this change, nodes had to be restarted to announce newly
initialized projects.
2023-02-08 16:29:42 +01:00
Rūdolfs Ošiņš 803d36f0f6
cli: Use localhost for rad web
Since sessionStorage and localStorage use protocol + host + port as scope,
we want to align this between the CLI and radicle-interface. Using
localhost has other benefits as well, because browsers treat it
differently when doing requests from the deployed app which is being
served via https.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-02-07 21:01:27 +01:00
Slack Coder ed9900b5ac
cli: Support patch commenting
Allow commenting on a patch as well an issue.

Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-07 11:16:59 +01:00
Alexis Sellier 2649e9c6fe
cli: Add `rad-clone` test 2023-02-07 10:46:12 +01:00
Alexis Sellier 45e31a5192
Communicate fetch results through control socket
This allows a CLI to report to the user what fetch requests were
fulfilled, and which ones failed.
2023-02-07 10:46:12 +01:00
Slack Coder 3c202564bf
cli: split into patch::create and patch::update
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>
2023-02-06 13:53:31 +01:00
Fintan Halpenny 3f48c2c516
Rust 1.67
Rust 1.67 was announced[0]. Update the necessary files for running
1.67 and fix the clippy suggestions for string interpolation.

[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-04 19:30:29 +01:00
Alexis Sellier f1a6a86689
node: Check refs when getting local inventory
If we don't do this, we're going to be returning broken repos.
2023-01-30 11:38:00 +01:00
Alexis Sellier b92dc59204
node: Turn off `--atomic` when not supported 2023-01-29 18:22:41 +01:00
Sebastian Martinez f07a875ce1
Add web-based authentication
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-01-27 17:23:05 +01:00
Alexis Sellier bb3787258a
cob: Refactor `Thread` methods 2023-01-26 16:20:22 +01:00
Alexis Sellier 30e9d6103c
Cleanup `clone` code
Remove a bunch of different instances of it.
2023-01-25 17:51:49 +01:00
Alexis Sellier 8279ef72fd
cli: Fix output of checkout command 2023-01-25 17:51:49 +01:00
Alexis Sellier fdad6358fc
cli: Correctly setup remote tracking branch
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-25 17:51:49 +01:00
Alexis Sellier b1012014fe
Remove old `Profile::paths` function 2023-01-25 15:35:24 +01:00
Alexis Sellier 963ad3c3d7
Get `rad clone` working correctly 2023-01-25 11:35:20 +01:00
Alexis Sellier fd5ac7f6af
cli: Minor cleanups 2023-01-25 10:21:57 +01:00
Alexis Sellier bb135b64b3
cli: Get `rad-checkout` working properly 2023-01-24 14:54:56 +01:00
Alexis Sellier 1f06f5340f
Make `Id` to string conversion more explicit
Two types of conversion: `canonical`, which is just the base58 encoding,
and `urn` which is like canonical, but includes `rad:`.
2023-01-24 13:49:03 +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 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
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