Commit Graph

19 Commits

Author SHA1 Message Date
Fintan Halpenny 1fa30e2e88 cli: test missing commits for canonical quorum
Test the scenario where 2 delegates are collaborating, where one delegate is
missing the other's commit while pushing to the default branch.
2025-07-19 12:32:45 +01:00
Fintan Halpenny afe64d5175 remote-helper: improve canonical handling
This set of changes refactors the canonical handling by isolating the business
logic into another type, `Canonical`.

The functionality remains the same, but certain error scenarios are better
handled. Primarily, the commits of the inner `Canonical` type are checked to see
if they exist in the working copy, and if not, provide a more useful message
about which commit was missing or invalid for which DID.
2025-07-19 12:32:31 +01:00
Lorenz Leutgeb 0e3f3f03d2 cli: Improve formatting of Node IDs and addresses
Pay more attention to when a Node ID is displayed in compact form. As
this was sometimes used to save space, e.g. in `rad node status` in
combination with long node addresses (like .onion names), also implement
a compact format for node addresses and use that instead in some cases.
Progress notifications in spinners keep the short form.
2025-07-18 21:44:06 +01:00
Lorenz Leutgeb 1c20f64a26 node, protocol: Refactor
Mostly changes of `use`s and moving components to `radicle-protocol`,
with the goal of just getting `radicle-node` to work on top of the new
`radicle-protocol` crate.
2025-07-16 21:15:52 +02:00
Fintan Halpenny 8201225166 cli: test canonical tags
Add a test to exercise adding canonical reference rules and pushing new
canonical tags.

A change in `rad id` was required to allow adding a new payload to the document,
i.e. one that does not already exist.

Adding rules is also documented in the man page for `rad id`.
2025-07-16 16:54:43 +02:00
Fintan Halpenny a69397386a cli: extract document update logic
The business logic of modifying the identity document should not live in the CLI
code for updating said document.

Instead, we extract out that logic into separate update functions and these are
using from the CLI instead.
2025-07-16 16:41:16 +02:00
Fintan Halpenny 7f646666bc radicle: canonical references payload 2025-07-16 16:41:16 +02:00
Fintan Halpenny b77809ae9d chore: prepare crates release
Prepare the crates for releasing to crates.io:
- radicle-remote-helper: 0.10 -> 0.11
- radicle-term: 0.12 -> 0.13
- radicle-cli: 0.13 -> 0.14
- radicle-node: 0.11 -> 0.12
- radicle-fetch: 0.11 -> 0.12
- radicle: 0.15 -> 0.16

It was also necessary to specify the `version` in the workspace Cargo.toml file,
since this is required for publishing to crates.io.
2025-07-14 15:38:09 +01:00
Lorenz Leutgeb 5a840983a8 node, cli: Refactor test environment 2025-07-09 11:47:50 +01:00
Johannes Kühlewindt 895ca5d025 cli: rad node connect using only NodeId
Allow the `rad node connect` command to use only a `NodeId` when connecting.

The `NodeId` is used to connect to known addresses, and will stop at the first
address that is connected to.
2025-07-03 12:13:49 +01:00
Fintan Halpenny 76e00a34ea cli: change link direction symbols
The symbols used for [inbound] and [outbound] are part of the [Supplementary
Multilingual Plane](smp) (or Plane 1). This set of symbols are not as well
supported by font sets, as discovered by many reports of the characters missing.

There are two other arrow characters: [south east] and [north east] that serve
the same style and are part of the [Basic Multilingual Plane](bmp) (or Plane 0).
This set of characters is more widely supported.

[inbound]: https://www.compart.com/en/unicode/U+1F866
[outbound]: https://www.compart.com/en/unicode/U+1F865
[smp]: https://en.wikipedia.org/wiki/Plane_(Unicode)#Supplementary_Multilingual_Plane
[bmp]: https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
[north east]: https://www.compart.com/en/unicode/U+2197
[south east]: https://www.compart.com/en/unicode/U+2198
2025-07-02 11:10:09 +01:00
Lorenz Leutgeb ec47566cb0 radicle-term: Remove custom pager
I learned that there is an implementation of a pager in
`crates/radicle-term/src/pager.rs`. It does not make sense to me to
maintain a pager in `heartwood`, this is too far from the core of what
we are trying to achieve and adds unnecessary maintenance burden. We can
allow ourselves to defer to the paging done by `git` or just call the
user's `$PAGER`. Even though falling back to unpaged output might not be
the nicest thing, I still prefer that over maintaining the pager.

It also was frustrating to me that the pager does not support things
like search (like `less` does).

This also significantly decreases our dependence on `termion`.

The pager was originally implemented by cloudhead in

  40f4383bbc

and integrated into `rad diff` in

  6dd52c94fb

This commit restores the behaviour introduced in

  84a95848b0

(before there was a custom pager implementation).
2025-06-27 15:35:19 +02:00
Fintan Halpenny 6f34124d43 radicle: improve config errors
Improve the granularity of config errors mentioning the path location where the
configuration is expected to be loading from or saving to.
2025-06-24 13:51:55 +02:00
Lorenz Leutgeb 78ba263d0a radicle-cli/issue: Improve comment templating
Writing a comment, only the most recent comment replied to is shown.
Editing a comment, current contents are not prepared. Manual copy required.

To improve:
 - Chase all replies to the root and quote them. Gracefully handle if
   this proces fails, i.e. a comment in the chain cannot be resolved.
 - If editing, copy the current contents.
2025-06-19 13:12:46 +02:00
Lorenz Leutgeb af35e6f4d0 radicle-cli: Warn when using old names of nodes 2025-06-18 16:21:21 +02:00
Lorenz Leutgeb 727e4e72c7 radicle-cli/debug: Use `BTreeMap` for consistent ordering
A `HashMap` does not guarantee a consistent iteration order. It is
desirable that all environment variables are printed in a consistent
order.

Use a `BTreeMap` which guarantees a consistent iteration order.
2025-06-18 15:55:54 +02:00
Lorenz Leutgeb a354686bbc chore: Remove `seed.radicle.xyz`
The team node is not really special, remove occurrences.
2025-06-18 14:45:54 +02:00
Jakob Kirsch e30e66e009
radicle: add .external_template(false) to all other libgit2 calls
This complements 9d4aa59a12.
2025-06-14 00:28:06 +02:00
Lorenz Leutgeb 5bc2dc677b repo: Move workspace crates into `crates` subdirectory
This keeps the top level of the repo cleaner, e.g.
<https://github.com/radicle-dev/heartwood> scrolls less and
<https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/>
might show more files at the top level.

This way we also don't have to explicitly name all crates in
`Cargo.toml`.
2025-06-09 15:09:21 +02:00