Commit Graph

2643 Commits

Author SHA1 Message Date
Defelo 0ec084fc23 remote-helper: Support push --force-with-lease
Previously, the remote helper would not support the `--force-with-lease` option.
This change introduces this support and ensures that it works as intended.

Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2025-11-25 10:48:30 +00:00
Sebastian Martinez 6d0c571ea9 radicle: Return individual results for repo in `repositories_by_id`
Change `repositories_by_id` to return `impl Iterator<Item = Result<RepositoryInfo,
RepositoryError>>`
instead of `Result<Vec<RepositoryInfo>, RepositoryError>`.
This allows callers to handle failures on a per-repository basis rather
than having the
entire operation fail if a single repository lookup fails.

Previously, the method would stop processing and return an error as soon
as any repository failed to load. Now it processes all repositories and
returns individual results, making the API more resilient and giving
callers
more control over error handling.
2025-11-06 10:43:04 +01:00
Lorenz Leutgeb c268e809e9 chore: Fix mistakes discovered by typos 2025-11-04 14:09:07 +00:00
Lorenz Leutgeb 11cbc2e515 hooks: Run "pre-push" by default 2025-11-04 14:04:24 +00:00
Erik Kundt 7ccdd4c810 ci: Activate all features when building docs
Currently, `cargo doc` fails on warnings for missing links to
`qcheck` and `radicle_git_ref_format`. This will enable the required
features to compile those modules in.
2025-11-03 11:30:43 +01:00
Yaroslav Halchenko 32d77641ab chore: Fix spelling errors with codespell 2025-11-01 12:11:02 +01:00
Yaroslav Halchenko f7e57361dc hooks: Add codespell
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-11-01 12:06:08 +01:00
Lorenz Leutgeb 8e331ce182
node/reactor/transport: Implement `Debug`
The derived implmenetation prints read and write buffers, which is too
much even for trace logging (where we use this trait).
2025-11-01 11:20:43 +01:00
Fintan Halpenny bc1d9ed495 cli: remove lexopt dependency 2025-11-01 11:20:43 +01:00
Fintan Halpenny 83f26abaa0 cli/main: refactor external command
Refactors the external command logic into a struct.

This allows for methods to maitain the logic of an external command.
It also allows for a cleaner output for the executable name – avoiding the debug
output of OsString using `""`.
2025-11-01 11:20:43 +01:00
Fintan Halpenny f60922d125 cli/terminal: make args module private 2025-11-01 11:20:43 +01:00
Fintan Halpenny 961301f643 cli/terminal: clean up args::Error type
The other variants of `terminal::args::Error` were no longer used.
The only variant required is `Error::WithHint`.

The enum is also made private, since it is only used in this crate.
2025-11-01 11:20:43 +01:00
Fintan Halpenny a75db6a695 cli/terminal: remove argument helpers
These helper functions were for parsing arguments passed via lexopt.
Since `clap` is now the parser for these types, these functions are no longer
needed.
2025-11-01 11:20:43 +01:00
Fintan Halpenny fec8a27a36 cli/terminal: remove Help struct
The `Help` struct is no longer needed thanks to `clap`, so it is removed.
2025-11-01 11:20:43 +01:00
Fintan Halpenny e359435040 cli/main: move run_command_fn to main
This call was moved to the `main.rs` file, since that is where it is used.

It is renamed to `run` and its call site is cleaned up.
2025-11-01 11:20:43 +01:00
Fintan Halpenny 7533db62f9 cli/terminal: remove unused parameter 2025-11-01 11:20:43 +01:00
Fintan Halpenny 1f80eb61ed cli/terminal: remove unused trait 2025-11-01 11:20:43 +01:00
Fintan Halpenny d41ac59828 cli/help: remove the help module
The `help` module is no longer needed, since `clap` handles that.

This meant that the re-exports of each command's `ABOUT` could be removed and
the `const`s can now be private.
2025-11-01 11:20:43 +01:00
Fintan Halpenny 23332fa318 cli/main: migrate main to use clap
Now that all commands can be parsed by clap, remove any custom parsing and
directly use `CliArgs::parse`.

The `Diff` command was removed, since only one `external_command` can be
declared for a subcommand. The handling of `rad diff` is now done via the
`External` variant. If the subcommand name is `diff` then this is executed,
otherwise delegate to the possible `rad-{exe}` command.

Also of note, the `rad inspect` command has an alias `rad .`. This changes the
behaviour of `rad . --help`. Before, it would print the help of the `rad`
command. Now, it prints the help of `rad inspect`.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-11-01 11:20:43 +01:00
Fintan Halpenny 5053a1aa77 cli/unseed: rename options to args
Have consistent naming for args
2025-11-01 10:52:13 +01:00
Fintan Halpenny 6ca1292350 cli/unfollow: rename options to args
Have consistent naming for args
2025-11-01 10:52:13 +01:00
Fintan Halpenny 3c89525003 cli/sync: migrate to clap
Due to the idiosyncracies of this command there are a few things to note about
this migration.

The `rad sync` command acts as a default subcommand in itself, in that it has
options that do not apply to its subcommand, `rad sync status`. This means that
the options will print with `rad sync --help`, but they will not print with `rad
sync status`.

The `--inventory` flag is not compatible with any of the other flags and
options, thus they are all marked with `conflicts_with`. This cannot be done for
a positional argument, so `clap` will "helpfully" print out the usage, for
example, as:

    error: the argument '--inventory' cannot be used with '--fetch'

    Usage: rad sync --inventory [RID]

    For more information, try '--help'.

Which is incorrect, since `RID` is ignored. This is explained in the `--help`
documentation for `--inventory`.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-11-01 10:52:13 +01:00
Matthias Beyer d1e19a87b0 cli/patch: migrate patch CLI parsing to clap
Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-10-29 09:11:05 +00:00
Fintan Halpenny 3ea61f0f98 cli/patch: move comment actions
Moving the sub-comment actions to be beside the top level comment action. This
is mostly to provide a better diff for the next commit – that refactors due to
`clap` changes.
2025-10-29 09:11:05 +00:00
Lorenz Leutgeb e404f1038f node: Use `std::time` for reactor and wire
This reduces the exposure to the `localtime` crate, using
`std` instead.
2025-10-29 09:05:52 +00:00
Sebastian Martinez 9bcdd353c9 cli/inbox: Use clap 2025-10-28 12:11:37 +00:00
Johannes Kühlewindt 5741bafa3b radicle/cob/db: Add index for issues and patches
To improve query performance for issues and patches, add a composite
index on "repo" and "id" to the SQLite database schema via a
migration.
2025-10-25 10:22:50 +02:00
Richard Levitte 990e22acff cli/inspect: use Clap
This includes a horrible - but hopefully short-lived - hack to make
`rad .` work.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-10-22 21:14:12 +02:00
Adrian Duke 5ed1b8e579 node: Fix test 'test_concurrent_fetches'
The test 'test_concurrent_fetches' is broken. It asserts over empty
sets nullifying its utility. Correct the test by changing it so that
sets to be asserted against are cloned.
2025-10-22 17:11:23 +02:00
Erik Kundt e8f9d21be3 cli/node: Use clap
Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-10-22 11:27:23 +01:00
Erik Kundt f20c2f215a node: Re-export `PeerAddrParseError`
In order to build higher-level errors that use `PeerAddrParseError`, it
must be re-exported.
2025-10-22 11:27:23 +01:00
Fintan Halpenny 6cfed884bf cli/remote: migrate to clap 2025-10-21 10:12:33 +01:00
Erik Kundt 93578340d1 Add changelog for Radicle 1.4.0 2025-10-20 15:14:21 +01:00
Sebastian Martinez f8fe296ceb radicle/rad: Fix typo 2025-10-20 15:09:43 +01:00
Sebastian Martinez 8604d3bcc7 cli/config: Use clap 2025-10-20 12:04:31 +01:00
Erik Kundt 8d90699c30 cli/cob: Use clap 2025-10-20 11:21:58 +01:00
Fintan Halpenny 38ca038a0d cli: fix test regression in 27a85987c3
A test failure was caused in commit
27a85987c3, which expected `STRING`
instead of `ALIAS`.

This change fixes that discrepancy.
2025-10-17 16:57:29 +01:00
Sebastian Martinez c1d9f04963 cli/self: Use clap 2025-10-17 16:45:20 +01:00
Erik Kundt 27a85987c3 cli: Fix argument value names in `auth` and `init`
We decided to use the value names to indicate which type the value
is parsed into (instead of just saying that the value is a `STRING`).

This makes the value names consistent with other commands again.
2025-10-17 13:43:42 +01:00
Lorenz Leutgeb 44efdc02f9
flake: Fix source filtering
The more complicated filter for `*.txt` did not work. Filtering by
extension directly is not as precise, but there are not many `*.txt`
files in this repository anyway, so the difference should be
neglegible.
2025-10-17 13:00:30 +02:00
Lorenz Leutgeb b3f23594db
git: Ignore parent from blame 2025-10-17 13:00:20 +02:00
Lorenz Leutgeb b0beef4391
workspace/rust/clippy: Fix all warnings
Fix clippy warnings following the upgrade of the Rust toolchain to
version 1.90. Almost all are "mismatched_lifetime_syntaxes".
2025-10-17 12:56:43 +02:00
Lorenz Leutgeb e1b4065353
workspace/rust: 1.88 → 1.90
The update to `flake.lock` is a simple

    nix flake update rust-overlay

to be able to reach 1.90.
2025-10-17 12:56:43 +02:00
Lorenz Leutgeb 0dd2f3f407
workspace/rust/msrv: 1.81 → 1.85
In ed8b086045 the dependency `backtrace`
was introduced which requires Rust 1.82. This dependency should be
kept, so this gives the new lower bound.

As of 2025-10-17, Debian stable ("trixie") has reached 1.85, which is
used as upper bound for the bump.
2025-10-17 12:56:43 +02:00
Erik Kundt 407abc6a2c cli/follow: Use clap 2025-10-17 10:50:21 +01:00
Erik Kundt deaf77e5b4 cli/unfollow: Use common DID / NID argument parser 2025-10-17 10:50:21 +01:00
Erik Kundt e488ddb446 cli: Add common value parser for NID / DID 2025-10-17 10:50:21 +01:00
Richard Levitte 06e22434e1 cli/checkout: use Clap 2025-10-17 08:51:10 +02:00
Erik Kundt 28824a3127 cli/init: Fix argument value names 2025-10-17 08:20:30 +02:00
Erik Kundt 634866889f cli/id: Use clap
This implementation works around the fact that `clap` does currently
not support value parsers for a series of values, so representing
`--payload` as a `Vec<Payload>` does not work.

Instead, we parse eveything into a `Vec<String>` and do the validation
on the application side.

Using value parsers for a series of values will probably be supported in
`clap` v5, though.
2025-10-16 18:14:11 +02:00