Commit Graph

2106 Commits

Author SHA1 Message Date
Fintan Halpenny e130b4dc06
radicle: custom upstream remote for patches
When creating a new upstream for the patch workflow, the remote name is always
assumed to be `rad`.

It's possible for users to use another remote name but still use a `rad://` URL
for pushing. To allow for this, the function that creates the upstream entry now
takes a remote name. In the remote helper, `rad patch checkout`, and `rad patch
set` the remote can be optionally specified and fall back to the `rad` remote
name as a default.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-09-12 17:59:57 +02:00
Lars Wirzenius 00639182a7
docs: Add a note on running isolated nodes
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 17:56:21 +02:00
Lorenz Leutgeb 47842a81e3
man: Mention `rad patch review` 2024-09-12 17:51:42 +02:00
Lorenz Leutgeb 4b955fff15
nix: Fix macOS build 2024-09-12 17:50:06 +02:00
Fintan Halpenny f244d89e56
node: check policy before visibility
In the `is_authorized` helper, the logic checks the policy and the visibility of
the repository.

If the policy is set to block, the function can return before getting the
repository and the identity document. This improves the check, since the
repository and identity document may be missing if the repository is blocked, so
it would return a different error other than the expected unauthorized error.
2024-09-12 17:47:55 +02:00
Lorenz Leutgeb 1d57778f6b
profile: Treat empty passphrase as no passphrase 2024-09-11 13:34:41 +02:00
cloudhead d39ba83cfc
Update `Cargo.lock` 2024-09-03 12:42:10 +02:00
cloudhead b77bea8e09
Update `radicle-systemd` Cargo.toml 2024-09-03 12:40:22 +02:00
cloudhead 1c620a2819
Update `radicle-node` crate to 0.10.0 2024-09-03 12:37:47 +02:00
cloudhead 57a0c8c46c
Update `radicle-fetch` crate to 0.10.0 2024-09-03 12:36:24 +02:00
cloudhead c8b33a4fba
Update `radicle-remote-helper` crate to 0.10.0 2024-09-03 12:34:27 +02:00
cloudhead bde68ac76c
Update `radicle-cli` crate to 0.11.0 2024-09-03 12:33:02 +02:00
cloudhead bbc79a7e30
Update `radicle-term` crate to 0.11.0 2024-09-03 12:31:07 +02:00
cloudhead 73467bde83
Update `radicle-signals` crate to 0.10.0 2024-09-03 12:31:07 +02:00
cloudhead bc14229639
scripts: Small improvement to `cache-cobs` 2024-09-02 16:20:17 +02:00
cloudhead 4e112aaeaa
Update `radicle` crate to 0.13.0 2024-08-28 13:01:35 +02:00
cloudhead 2d241e5f7d
Update `radicle-crypto` crate to 0.11.0 2024-08-28 13:01:35 +02:00
cloudhead c112f3fbc9
Update `radicle-cob` crate to 0.12.0 2024-08-28 12:55:30 +02:00
cloudhead c8fbcf2a7a
helper: Revert patches correctly
When pushing to the default branch and updating the canonical head,
check to see if any merged patches are reverted due to this change.

If so, make sure the COB cache reflects this.
2024-08-23 15:59:59 +02:00
Lorenz Leutgeb 0dd06b91c1
nix: Correctly set `RUST_SRC_DIR` 2024-08-22 11:12:10 +01:00
Lorenz Leutgeb 621c5a4563
rust: Migrate to `rust-toolchain.toml`
See
 - https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file
2024-08-22 11:12:10 +01:00
Lorenz Leutgeb b398e54b83
nix: Update flake to get to reach Rust 1.80 2024-08-22 11:12:09 +01:00
cloudhead 757483f351
radicle: Fix patch COB `review` action
When two `review` actions were posted by the same author, for the same
revision, an error was returned, cancelling evaluation for that author.
This caused certain patches to for eg. lose their merge status.

To remedy this, we *allow* multiple `review` actions per revision, but
simply take the last one as the "current" review. Since this makes the
`review.edit` action redundant, we remove that action completely. This
is safe, as none of the tools created review edits.
2024-08-21 17:37:58 +02:00
cloudhead 8922388caa
scripts: Add install command in changelog 2024-08-20 17:39:04 +02:00
Sebastian Martinez c0aecbac3a
Relax version requirement for `radicle` dependencies
Since a few crates rely on the `radicle` crate, dependency updates that
affect multiple crates like `git2` are not able to resolve the
dependencies and fail, if the version is fixed to e.g. `0.12.0`
2024-08-20 16:35:04 +02:00
Sebastian Martinez beac367056
Update `radicle-surf` to 0.22.0 2024-08-20 16:35:04 +02:00
Sebastian Martinez cae66b6168
Update `radicle-git-ext` to 0.8.0 2024-08-20 16:35:04 +02:00
Sebastian Martinez f71da0ee95
Update `git2` to 0.19.0 2024-08-20 16:35:04 +02:00
Fintan Halpenny eb432b9bc1
cli: announce on issue edit and comment
The `rad issue edit` and `rad issue comment` subcommands were not included in
the announce check. Since these are considered write commands, they should also
announce when executed.
2024-08-20 16:32:02 +02:00
cloudhead ab6ca14c88
tools: Add optional revision to `rad-merge` 2024-08-20 16:23:32 +02:00
Fintan Halpenny 86a0443916
crdt: run cargo fmt 2024-08-09 12:41:01 +02:00
Fintan Halpenny e1470fccd7
fetch: update gix-pack and gix-odb
The `gix-fs` crate was flagged as vulnerable[^0]. To update it to `>=0.11.0`, it
was necessary to update the `gix-pack` and `gix-odb` crate versions to `0.51`
and `0.61`, respectively.

This in turn updated `fastrand` which changed its algorithm[^1], which meant
that some test outputs were reordered or matched new values.

[0]: https://rustsec.org/advisories/RUSTSEC-2024-0350
[1]: https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md#version-210
2024-08-09 12:41:01 +02:00
cloudhead a61affa9fb
node: Don't fail if we can't load a COB to cache
This change simply logs an error if there is a problem loading a COB
from storage, instead of bailing on the cache update process.

We also ensure that objects that can't be loaded from storage are
removed from the cache.
2024-08-09 11:59:53 +02:00
cloudhead 1d1b9c3d49
radicle: Don't use transactions in cache
The `transaction` method was being used for single queries. This
was unnecessary.
2024-08-09 10:54:04 +02:00
cloudhead 9db69a40a6
radicle: Remove cache entries before caching
In case of a bug or failed cache update, there may be objects in the
cache that are no longer in storage.

When doing a full re-cache, remove all existing entries from the repo
first.
2024-08-09 10:48:46 +02:00
cloudhead bfc949d094
cli: Log errors when COBs can't load 2024-08-09 10:47:54 +02:00
cloudhead 2b75045661
scripts: Add a script to create a radicle env
Creates a new profile with a repo and drops you in.
2024-08-07 10:41:28 +02:00
cloudhead 73f3c49689
cli: Don't fail on `rad ls` if project is invalid 2024-08-07 10:40:46 +02:00
cloudhead 16560950ec
radicle: Fix log when delegate is not found 2024-08-06 16:36:27 +02:00
cloudhead a496190198
cli: Suggest the user to reset the cache
If there is an error loading a patch or issue, suggest resetting the
cache.
2024-08-06 14:43:59 +02:00
cloudhead c6a8a00055
Update `rust-toolchain` to 1.80
Fix new clippy warnings.
2024-08-06 14:37:21 +02:00
cloudhead 0e08452323
node: Ensure we don't prune our own routes
Filter out routing entries of our own node when prunning.
2024-08-06 14:17:12 +02:00
Fintan Halpenny 52554af4f1
cli: add `rad unblock` command
Add the `rad unblock` command for reversing the effect of blocking an NID or RID.

In both cases, the entry is removed from the DB, if the policy was set to block
-- otherwise it is a no-op.
2024-08-06 14:12:44 +02:00
Ivan Stanković 468d5a46ee
cli: Only get the signer where needed in `rad id`
Requesting a signer may prompt the user for key password, which
is not really needed with commands like `list` and `show`.
2024-08-06 14:02:46 +02:00
cloudhead 84e3ba1482
Validate project names properly in all places
We were only validating names when passed as a flag to `rad init
--name`.
2024-07-31 16:05:31 +02:00
cloudhead ee1c867800
cli: Add way to init from existing repositories
This adds an option to `rad init` to initialize a working copy with
an existing radicle repository in storage:

    rad init --existing <rid>

This sets up the remote(s) and configures the repo for you.
2024-07-29 11:49:19 +02:00
cloudhead 74336f961a
cli: Write comments into draft patch review
We tidy things up with an explicit `Brain` type that stores the accepted
state of the code.

Review comments are added to the patch draft.
2024-07-24 16:46:24 +02:00
cloudhead 7cecabed42
Add `id` to `Revision`, forbid duplicate reviews
Some changes to the `Patch` state needed for code review.
2024-07-24 16:46:24 +02:00
Fintan Halpenny 81a3bc3d1b
cli: `rad id` allow missing default branch
If a peer had created any references but was also missing the
canonical branch, the `rad id update` command will fail when adding
that peer as a delegate.

Instead, missing delegates and missing default branches are tracked
during verification. If the number of missing delegates means the
`threshold` cannot be met, then the errors are returned.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-07-24 16:43:36 +02:00
Fintan Halpenny dc34eafdf4
remote-helper: allow patch creation from detached HEAD
The patch creation flow would be partially interrupted when creating a
patch via a detached HEAD state. The creation of an upstream branch
would fail since there is no branch to set an upstream for. It would
result in the following error:

    ✓ Patch 6035d2f582afbe01ff23ea87528ae523d76875b6 opened
    To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
     ! [remote rejected] HEAD -> refs/patches (git: reference 'HEAD' is neither a local nor a remote branch.; class=Invalid (3))
    error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'

To fix this, the reference that's resolved is checked to see if it a
local branch. If not, it will return early.

The behaviour is tested in the `rad-patch-detached-head` example.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-07-23 17:13:30 +02:00