Commit Graph

35 Commits

Author SHA1 Message Date
cloudhead ad7a3addb6
cli: Add `rad config` command
Displays the current configuration.

Also move to our tree-sitter highlighter for pretty-printing JSON and
remove the `json-color` dependency.
2023-11-30 10:46:32 +01:00
Sebastian Martinez 8277559ee0
Update radicle-surf to 0.17.1 2023-11-24 13:42:30 +01:00
Thomas Scholtes 3ccb6a5fac
Move `rad-web` binary to `radicle-httpd` package
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-11-22 11:27:11 +01:00
cloudhead 84a95848b0
cli: Add pager to `rad diff`
Invokes a pager when the output doesn't fit on the screen.
2023-11-03 14:20:16 +01:00
cloudhead 1d167581f2
cob: Introduce `xyz.radicle.id` COB
Introduces a new COB type to store repository identity documents.

The reason for this change is to:

1. Simplify the code, as the identity document logic resembled a COB,
   yet it had custom logic. This allows existing COB code to be used for
   identities.
2. Make identity document update logic more flexible, since COB actions
   can be added in the future.
3. Re-purpose existing tools around COBs to work on identities, eg. `rad
   cob`.
4. Unify the concept of an identity change proposal, with regular identity
   changes. This means we can remove the `id.proposal` COB in favor of
   using the `id` COB itself.

Notes
-----

* Each repository has one Identity COB.
* The `Proposal` COB has been repurposed into the `Identity` COB.
* Identity documents are stored as *embeds* inside the Identity COB
  actions.
* The action that contains new document versions is called `revision`,
  just like the Patches COB.
* The namespaced `rad/id` ref is a symbolic reference to that Identity
  COB.
* The canonical `rad/id` ref is a direct reference to the commit in the
  Identity COB that contains the latest *accepted* revision of the
  document.
* All commands for managing identities have been folded into `rad id`.
  Hence `rad delegate` and `rad edit` are removed.
* The concept of "rebasing" an identity document is gone.
* The `rad id` output has been updated to match the style of other
  commands.
* When a revision has enough signatures, it is automatically adopted as
  the current identity, there is no longer the need for a "commit"
  action.
* When an identity revision is proposed, and the current identity has a
  threshold of `1`, that identity is automatically accepted due to the
  above point.
* The idea of "verifying a peer's identity branch" no longer applies, as
  COBs cannot be verified one history at a time.
* Since the root commit of the Identity COB does not have a "Resource"
  to point to (it would have to point to itself, which is impossible),
  we've made the resource id optional for COBs.
2023-10-12 17:32:33 +02:00
Sebastian Martinez 504a198cec
Update `radicle-surf` to v0.17
This commit introduces the `FileStats` struct, that adds the insertions
and deletions for each file to `DiffContent`.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-11 14:29:34 +02:00
cloudhead 2011f2b06e
cli: Disable `html` highlighting by default
See code comment for reasoning. This is fixed in v0.20.0 which is not
out yet.
2023-10-03 13:33:10 +02:00
cloudhead 8479666731
cli: Disable `ruby` highlighting by default
See code comment for reasoning.
2023-10-03 13:18:10 +02:00
cloudhead 154566f8ef
cli: Update to `radicle-surf` 0.16 2023-09-27 15:54:16 +02:00
cloudhead 90fe50c152
cli: Implement pretty diffs with highlighting
Implements a new kind of diff output that includes syntax highlighting.
This type of diff will be used for code review.
2023-09-27 12:37:41 +02:00
Sebastian Martinez 6bb0dd1a28
Update `radicle-surf` to `v0.15.0`
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-18 10:57:37 +02:00
cloudhead 8cb8398be9
Introduce `cargo-deny`
Add `deny.toml` with a few exceptions, and update certain dependencies
to get rid of duplicates.

Running `cargo deny check` will yield some warnings still, but no
errors.
2023-08-22 14:33:00 +02:00
Alexis Sellier 45ccbde226
Update `radicle-surf` and `git-ref-format` 2023-07-14 16:57:55 +02:00
Alexis Sellier 1a1e63d998
node: Implement `sessions` command
Returns session information through the control socket.

We also update `rad node status` to display sessions.
2023-07-04 00:26:31 +02:00
Alexis Sellier 63ff4717dc
cli: Implement hunk-based code review
Review code with an interface similar to `git add -p`.
2023-06-22 11:15:42 +02:00
Alexis Sellier d249937a61
Update dependencies
* radicle-surf
* radicle-git-ext
* amplify
2023-05-10 15:56:21 +02:00
Fintan Halpenny 8508eab8fa
radicle: update radicle-git-ext
This change updates to the latest radicle-git-ext, which required a
few changes within the radicle family of crates.

One set of changes is that the radicle-git-ext crate subsumes
git-commit, git-trailers, and git-ref-format -- so all those imports
go through radicle-git-ext.

The commit code requires that parent `Oid`s point to commits, which
made some tests fail. One of the reasons for these failures is that
the patch tests used fabricated `Oid`s and so the verification would
fail. This is fixed by allowing the test context code to create
`PatchRequest`s that create valid commits.
The other reason for failure was that the identity `Action` passed an
`Oid` that pointed to a blob. This is fixed by removing that code and
making a note of it in documentation.

The final major change was moving the Refspec type into git-ref-format
and removing the AsRefspecs trait. The trait was not required and
could its usage could be replaced by simpler code.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-05-08 10:36:15 +01:00
Alexis Sellier 5ccf38079c
cli: Make `patch checkout` fetch missing objects
Before this change, `rad patch checkout` would fail if the patch commits
were not in the working copy.
2023-03-18 12:24:17 +01:00
Alexis Sellier f7aac06a8f
cli: Polish `assign` and `unassign` commands 2023-03-13 12:27:47 +01:00
Alexis Sellier 5fb5df2e61
cli: Update `inquire` crate 2023-03-07 10:39:45 +01:00
Alexis Sellier 02304875ce
Initialize `radicle-term` crate
We split out all non-radicle terminal functionality so that it can be
accessed by `radicle-node` without importing `radicle-cli`.
2023-03-06 10:22:50 +01:00
Alexis Sellier 0a93fa833e
cli: Simplify & improve CLI output
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.
2023-02-27 17:10:52 +01:00
xla 97f7064094 cli: Extract crate for md based tests
To allow that functionality to be published for reuse.

Signed-off-by: xla <self@xla.is>
2023-02-15 15:25:38 +11:00
Fintan Halpenny b257f482cb
cli: rad id command
Introduces the `rad id` subcommand for interacting with the identity
proposal cob.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-13 13:50:52 +00:00
Alexis Sellier b542ddcd6c
node: Create shared test environment
We move and combine some of the test code, so that the CLI tests and
node tests use shared code.
2023-02-07 10:46:12 +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 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
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 03fd69f323
Configure CLI default bin
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 10:44:30 +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
xphoniex 80401f89ae
Add `rad-inspect` command
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-11-14 12:23:24 +01:00
Alexis Sellier 32cd94dd23
Add `rad-init` command
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-07 22:01:49 +01:00
Alexis Sellier 223d36086e
Add `radicle-cli` crate's `terminal` module
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
Co-authored-by: xphoniex <dj.2dixx@gmail.com>
2022-11-07 14:48:01 +01:00