Commit Graph

3141 Commits

Author SHA1 Message Date
Adrian Duke eb2dded0ed remote-helper: Introduce magic push ref 'refs/for/'
Introduces support for Gerrit-style magic push references via
`refs/for/<branch>`. Pushing to this ref automatically extracts the
target branch and opens a patch against it, bypassing the need for the
push option `patch.target`. Example:

```
$ git push rad HEAD:refs/for/accepted
```

Will open a patch with its `patch.target` set to `refs/heads/accepted`.
2026-06-09 11:37:26 +02:00
Adrian Duke 06e201c927 remote-helper: Add 'patch.target' push option
The remote helper now supports the push option `patch.target`. This
allows users to explicitly specify a target canonical reference when
opening or updating a patch. For example, to open a patch that targets
the branch "backport", use:
```
git push -o patch.target=refs/heads/backport
```

Furthermore, strict merge and revert isolation is now enforced:
patches are only marked as merged or reverted if the commits are
pushed to the target branch of the patch explicitly.
2026-06-09 11:21:33 +02:00
Adrian Duke f0c6abc6ea radicle/cob/patch: Extend MergeTarget
Extend `enum MergeTarget` to include a new variant, `Branch`.
The intended use of this new variant is to allow a `Patch` to have a
target branch other than the default branch.

The `Branch` variant holds a `TargetBranch` which, in turn, is ensured
to be a `Qualified` reference that begins with `refs/heads`, i.e. a
Git branch.
2026-06-09 11:21:33 +02:00
Adrian Duke c7339615a7 cob: Replace 'git2::Oid' -> 'git::raw::Oid' 2026-06-09 11:21:33 +02:00
Adrian Duke db4ad27b4f radicle-cli: Fix broken test 'rad-cob-update'
The `rad_cob_update` test accidentally use the `rad-cob-log` file
instead of `rad-cob-log`.

This change fixes that, and updates the `rad-cob-update` example file
to the latest patch show format.
2026-06-09 11:00:32 +02:00
Adrian Duke d734d69269 radicle-cli: Add labels column to patch list 2026-06-09 11:00:32 +02:00
Adrian Duke fda165ffca radicle: Replace WAN routeable testing IPs with 198.18.0.0/15 private subnet 2026-06-08 11:24:55 +01:00
Adrian Duke 55b4b04002 radicle-node: Replace WAN routeable testing IPs with 198.18.0.0/15 private subnet 2026-06-08 11:23:47 +01:00
Adrian Duke a294e05730 radicle-node: Prevent infinite connection loop on instant dial failure
When a connection drops and the node attempts to reconnect within the
same second, the `last_attempt` timestamp written to the database is
identitcal to the `last_success` timestamp due to the Unix time (seconds)
precision loss.

The `maintain_connections` logic filters eligible peers using the
condition `last_success >= last_attempt`. Because the truncated
timestamps are equal, this evaluates to true, causing the node to
bypass the `CONNECTION_RETRY_DELTA` backoff.

If the OS instantly rejects the dial attempt (e.g. `EHOSTUNREACH`),
the node synchronously queues another connection attempt. This traps
the reactor in an infinite `while` loop.

Changing the condition to `last_success > last_attempt` ensures that a
failed attempt in the same second correctly evaluates to false, forcing
the node to respect the backoff timer and breaking the loop.
2026-06-05 18:27:16 +01:00
Fintan Halpenny e4a16dc40a cli-test: Disable normalizing paths
The normalization of paths was converting valid `\n` characters to `/n`.
This had not been noticed until codespell suggest the change of
`/ndefined` to be `/undefined`.

Use `Assert::normalize_paths(false)` to disable this behaviour.
2026-06-03 11:49:41 +02:00
Fintan Halpenny b397b1a249 workspace: Update snapbox to 1.2 2026-06-03 09:40:26 +02:00
Fintan Halpenny 09e6147ef9 radicle/node/config: Document RateLimit fields
The documentation for `RateLimit::fill_rate` and `RateLimit::capacity`
were missing.

Add the documentation to help users decided on values based on how the
rate limiting works.
2026-06-01 11:36:21 +01:00
Fintan Halpenny 90aaec1c9e CONTRIBUTING: Add section on issue labels 2026-06-01 11:28:30 +01:00
Fintan Halpenny a3ff596e22 scripts/changelog: Generate links to commits on seed.radicle.dev
Generate the links to the commits, on seed.radicle.dev, so that
reviewers of the changelog can easily navigate to the commits.
2026-05-30 09:12:25 +01:00
Lorenz Leutgeb a65ac048cb cob/change_graph: Log Errors
In case of a signature verification failure or failure to apply an
operation, the error is swallowed, but not logged.

During debugging, it can be crucial to understand whether these errors
occur, so log them.

If trace logging is enabled, also log the tips that are used. This
gives a better overview where operations originate from.
2026-05-28 16:58:55 +01:00
Fintan Halpenny 9ff0e8b01f just: checking for ellipses
Add custom check for ellipses "...", asking for replacement of "…".

Git ranges and the CLI wildcard matches are ignored.

This change includes fixes to all sites that did not pass the check.
2026-05-28 16:52:02 +01:00
Fintan Halpenny 9c37511613 Revert "typos: Rule for ... -> …"
This reverts commit 8a38fa8c73.
2026-05-28 16:50:46 +01:00
Fintan Halpenny 81fd141139 Revert "codespell: Rule for ... -> …"
This reverts commit fe353ea7e9.
2026-05-28 16:50:46 +01:00
nullcurve f49cc5def8 radicle-node.1.adoc: Fix markup error
Remove stray trailing asterisk in *--help**

Signed-off-by: nullcurve <did🔑z6MkpP5WGopov3BTRK9dmCo5TmqngpAuJ57JW8cywPggZ8HP@radicle.xyz>
Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-28 16:28:52 +01:00
nullcurve dd7c13271f rad-patch.1.doc: Fix typos and markup errors
Fix "patched" -> "patches" in --author description
Fix "to diff" -> "to review" in review --revision description
Fix "--p" -> "-p" short flag for --patch option

Signed-off-by: nullcurve <did🔑z6MkpP5WGopov3BTRK9dmCo5TmqngpAuJ57JW8cywPggZ8HP@radicle.xyz>
Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-28 16:28:16 +01:00
nullcurve 898e00ecf1 CONTRIBUTING: Fix typo
Fix "For example." -> "For example," (orphaned period)

Signed-off-by: nullcurve <did🔑z6MkpP5WGopov3BTRK9dmCo5TmqngpAuJ57JW8cywPggZ8HP@radicle.xyz>
Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-28 16:26:34 +01:00
Arthur Mariano 0bbedb9650 cli: Fix panic on `rad patch review` without options
When invoked without any of `--patch`, `--delete`, `--accept`,
or `--reject`, the command panicked.

It will now correctly return an error to use `--accept`, `--reject`,
or to supply a message.
Note that `--patch` and `--delete` are removed as these commands are
now obsolete.

The new doc test also documents two previously-untested behaviors
of `rad patch review`: neutral reviews (verdict=None with summary)
and the COB layer's silent no-op when a duplicate review is submitted
(see `test_patch_review_duplicate` in radicle-cli/tests/commands/patch.rs).

Fixes 8ceff5d4b8fa94bcbe243f9f8ef52138f65e495d

Signed-off-by: Arthur Mariano <arthvm@proton.me>
Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2026-05-28 16:14:58 +01:00
Fabrice Bellamy 804fa3e44c cli/examples: rad-patch-merge-on-first-push
Exercise the edge case where Bob, as a delegate, has never pushed to the default branch.
He then merges Alice's patch, and it is correctly marked as merged.
2026-05-27 22:31:11 +01:00
Fabrice Bellamy cf28294473 remote-helper: Account for first push from delegate
An edge case was found where a delegate attempted to merge a patch,
but had not pushed to their default branch yet.
This resulted in the `old` not being defined and the check to revert
and/or merge not happening – so the patch continued to appear as open.

Since `old` only matters for the revert and merge check for the
default branch, resolving the `old` side does its best to find a
commit for the checks.
It does this by falling back to getting the canonical head before the
push, and using that as the old.
2026-05-27 22:31:11 +01:00
Fintan Halpenny c70d4a29eb CHANGELOG: Backfill 1.9.1 updates
Some updates for 1.9.1 were missed, and are backfilled in this commit.
2026-05-27 22:24:51 +01:00
Lorenz Leutgeb cf108311dc node: Heap Profiling with DHAT 2026-05-27 12:07:52 +01:00
Fintan Halpenny d8bf84c173 CONTRIBUTING: modify notes on preparing commits 2026-05-27 11:13:19 +01:00
Fintan Halpenny 3e1a02fdb1 CONTRIBUTING: include `super` in import examples 2026-05-27 11:04:47 +01:00
Fintan Halpenny 01df41bf01 CONTRIBUTING: document the use of the terms safe and unsafe 2026-05-27 11:04:47 +01:00
Fintan Halpenny 70c2f89bdf CONTRIBUTING: reword section on unwrap and expect
Change the expectations for when these methods are used.

Importantly, remove the note on SAFETY. This will be documented in
another section.
2026-05-27 11:04:47 +01:00
Fintan Halpenny 21608788cb CONTRIBUTING: mention nextest 2026-05-27 11:04:31 +01:00
Fintan Halpenny 87347bdfa6 CONTRIBUTING: clean up lint and formatting section
Provide a better clippy command for catching all of the crates'
targets and features.

Includes a small fix to the grammar.
2026-05-27 11:00:03 +01:00
Fintan Halpenny 05507f21a9 CONTRIBUTING: mention `--log-level` for logs
Help the person reporting the issue to run with debug logs to provide
better information.
2026-05-27 10:58:38 +01:00
Fred Gobry 0a03f1c84e crypto: Handle default `SSH_AUTH_SOCK` on Windows
On Windows, SSH Agents commonly use a named pipe with a global default
name. This patch is to give users a more streamline experience as they
will not need to set the environment variable manually anymore.
2026-05-26 09:18:07 +02:00
Fintan Halpenny 067a9d13bf justfile: Add `--check` to `cargo fmt`
Since these are run as checks, the `--check` flag should be run.
This ensures that the `pre-commit` and `pre-push` checks fail if there
is any formatting.

Contributors are expected to have formatting in their IDEs or can run
`cargo fmt` if they wish to format the Rust files.
2026-05-22 09:13:48 +01:00
Lorenz Leutgeb 998ff91e2c cli/id: Print Parent of Revision
When delegates collaborate on the repository identity, their voting
narrows the tree of active proposals to the chain of accepted
proposals. Thus, they crucially must understand which proposals are
siblings, i.e., which proposals share the same parent, because no
two sibling proposals should ever be accepted at the same time, as
this would mean a fork.

To ease collaboration of delegates and improve their overview, also
print the parent revision, if present. Note that the initial revision
is the only revision that has no parent.
2026-05-22 09:09:01 +01:00
Fintan Halpenny 5bd3569e12 CHANGELOG: Add entry for address parsing fix
Add entry for commit `704b6cdabbdf7e16476a651287dbf967ee1f92ad`.
2026-05-21 16:33:25 +01:00
Fintan Halpenny f9ae4b7578 CHANGELOG: Release 1.9.0 2026-05-21 16:32:26 +01:00
Fintan Halpenny 704b6cdabb radicle/node/address: Skip unknown AddressType value
Since `tor` and `i2p` are features, dependents may compile the
`radicle` crate without these features and will not be able to parse
`AddressType`.

Allow parsing of the `AddressType` to fail, and skip if that is the
case.

Further, the same holds for `Address`, and skip if that fails to parse
as well.

Finally, `Address` may parse an address string successfully to
`HostName`, but it may have an `AddressType` that does not match the
`HostName` variant. Guard against this, again skipping if they are not
equal.
For example, `HostName::Dns` is a `String` underneath, so there is
higher chance that something like `deadbeef.onion` parses to this
variant.
2026-05-21 16:08:36 +01:00
Lorenz Leutgeb ff8660d872 radicle: Warn less aggressively on IPv6 addresses
Parsing of IPv6 addresses not enclosed in square brackets causes a
warning to be logged.

This is too strict, since the user can not influence IPv6 addresses
received over the network, but only those in their configuration.

Remove the warning from parsing, and instead carry a boolean to warn the
user later.
2026-05-21 14:52:35 +01:00
Lorenz Leutgeb 7ed9d50ab6
crypto: Update ssh-agent-lib from 0.5.2 to 0.6
This should fix issues handling SSH certificates.

See
<https://radicle.zulipchat.com/#narrow/channel/369873-Support/topic/1.2E9.2E0.3A.20rad.20auth.20fails.20with.20SSH.20certificate.20in.20agent/with/596358640>.
2026-05-21 13:10:35 +02:00
Lorenz Leutgeb 09b1f1f77c
node: Fix handling absence of systemd credential
In case `radicle_systemd::credential::path` returns `Ok(None)`, a
misleading warning is logged.

Handle this case separately and do not emit a warning.
2026-05-20 09:36:22 +02:00
Fintan Halpenny 9381232604 .radicle/ambient: Add pre-plan action for rustup
To ensure the correct toolchain is used when building and testing the
project, a pre-plan action is added for `rustup`.
It uses the same `channel` as defined in the `rust-toolchain.toml`.
A note is left about this duplication, and the possibility of it being
supported in the future.

Note that this includes a workaround:
```
sed -i /components/d rust-toolchain.toml
```
which ensures that `components` are removed, since Ambient does not
support `components` at this time.
2026-05-19 10:46:50 +01:00
Fintan Halpenny 1f40b32b6a protocol: provide more information for invalid timestamps
The invalid timestamp error will only tell the timestamp of the
offending node's message.

Currently, there are issues where that error is occurring but the
timestamp seems legitimate. This patch adds the running node's
timestamp to help debug the issue.
2026-05-18 18:06:26 +02:00
Fintan Halpenny ac5fc67428 fetch: Update gix packages
Several vulnerabilities were found in the gix packages[^1][^2][^3].

Update the packages to their latest versions which include the fixes.

The only required change is in `ls_refs`.
`RefPrefixes` was introduced and this fixes the issue with `ref-prefix`.
This should now improve the ls-refs stage and only return references
that the client is asking for, as opposed to all references.

[^1]: https://github.com/radicle-dev/heartwood/security/dependabot/38
[^2]: https://github.com/radicle-dev/heartwood/security/dependabot/39
[^3]: https://github.com/radicle-dev/heartwood/security/dependabot/36
2026-05-18 14:57:33 +02:00
stefan 1000402536 node: upgrade cyphernet to fix a panic in socks5-client when using artix
cyphernet 0.5.4 upgrades socks5-client to 0.4.3, which fixes a panic
that occurred when using tor's new artix implementation via socks5.

The upstream fix (authored by me):
https://github.com/cyphernet-labs/cyphernet.rs/pull/18

Diff:
https://github.com/cyphernet-labs/cyphernet.rs/compare/v0.5.3...v0.5.4
2026-05-15 09:06:46 +01:00
Lorenz Leutgeb 9158df5067 flake: Add NixOS tests to checks 2026-05-13 17:23:54 +01:00
Lorenz Leutgeb 767b80e7fe flake: Sort Inputs Lexicographically 2026-05-13 17:23:54 +01:00
Lorenz Leutgeb c5043617b9 flake: Fix nixpkgs inputs 2026-05-13 17:23:49 +01:00
Adrian Duke caee776c38 log: New crate for logger implementations
Move logging-related module `radicle::logging` into its own crate.

While at it, remove the "logger" feature flag from `radicle`.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.dev>
2026-05-11 16:44:37 +01:00