Commit Graph

14 Commits

Author SHA1 Message Date
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
Fintan Halpenny 5b4cbc2cd8 radicle: introduce announcer
Similar to the `Fetcher` sans-IO approach, an `Announcer` sans-IO approach is
introduced. The previous `Handler::announce` was already quite close to using a
sans-IO approach, but using internally held state. This change makes the
business logic more reusable – and testable.

Similarly to the `Fetcher`, the `Announcer` is configured and then driven by
telling it when nodes have been synchronized with. It will continuously check if
it has reached its target, yielding to the caller to decide whether to keep
going. In contrast, it also provides a way to mark the process as timed out,
since announcing relies on waiting for events to come back in a timely manner.
2025-05-26 12:31:03 +02:00
Fintan Halpenny eec4dd4505 radicle: improve sync fetching
This patch changes separates the business logic of fetching from the process of
fetching itself. It does this through a sans-IO approach, where a `Fetcher`
provides the necessary state to help drive a fetch forward, without performing
any of the IO itself.

What the `Fetcher` cares about is:
- What nodes are going to be attempted to be fetched from
- In what order should they be attempted
- When should the fetching process be considered finished

The `Fetcher` is then used in `radicle-cli` to drive forward the `sync::fetch`
function, allowing it to only care about the IO.
2025-05-23 17:22:48 +01:00
Lorenz Leutgeb f13afe491d remote-helper: Print `git range-diff` invocation 2025-04-24 16:51:38 +02:00
Lorenz Leutgeb dc1ff882c5
cli/sync: Also print node addresses 2025-04-17 14:20:21 +02:00
Fintan Halpenny 7ddb1119a5
cli: show revision on rad patch checkout
Help the user know which revision they currently have checked out when
running `rad patch checkout`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:56:11 +01:00
cloudhead 17744a03fd
cob: Properly authorize root actions
Previously, authorization was only checked for ops after the root op.
We also avoid creating empty actions for `assign` and `label`, which
was needed for non-authorized users to be able to create issues/patches.
2024-02-23 12:31:13 +01:00
cloudhead a46bcb2247
cob: Distinguish between commit parents
Previously, COB change commits would not distinguish between their
parents. This means that they would try to load source code commits
(eg. for patch COBs) and then fail since those commits wouldn't have a
manifest or `Rad-Resource`.

We introduce a backwards compatible change here which is that parent
oids that are not COB commits are accompanied by a commit trailer called
`Rad-Related`. This is for all related content that should be pulled in
but is not part of the change graph proper.

When building the change graph, we simply ignore commits that are marked
as "related".
2024-01-22 21:20:01 +01:00
cloudhead 6349c1c559
cli: Small change to output for clarity
So that users don't confuse the revision id with a commit id, we
explicitly state it's a new revision id.
2024-01-08 17:46:22 +01:00
cloudhead e4f06e9c9d
cli: Improve `rad remote add`
By default, this command now:
* Follows the peer if not already followed
* Syncs refs of the peer, if it wasn't followed before
* Fetches refs into working copy

This functionality can be disabled via `--no-sync` and `--no-fetch`.
2024-01-08 17:28:01 +01:00
cloudhead 9ada30255b
cli: Don't sync on git-fetch
It's actually not such a great idea to sync on git-fetch and
git-ls-remote, as syncing is supposed to happen in the background
already, and if you want to force a sync, you can just call `rad sync`.

Previously, it would be annoying that when you called `rad sync` and
then `git fetch`, it would still attempt another sync, for example.

Moving forwards, it might make sense to call `git-fetch` on `rad sync`
(so the other way around), because `git-fetch` is free (it doesn't talk
to peers), and you almost always want your working copy up to date with
your storage.
2023-12-13 14:47:14 +01:00
Fintan Halpenny 44206cb6ca
cli: ensure patch is present in rad-push-and-pull-patches
In some cases, there's a chance for the patch to not have arrived
before trying to check it out in the `alice` repo.

Ensure that the patch is present by first running `rad sync -f`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-12-13 12:25:12 +01:00
Fintan Halpenny bb5fb5e9d9
cli: fix rad-push-and-pull-patches
The call to `rad sync -a` can end up with different output if the `git
push` has already announced to the network -- ending up with the nodes
already be in sync.

Instead, for consistency, leave the syncing up to the `git push` and
remove the call to `rad sync`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-11-30 10:19:40 +00:00
cloudhead e703bad294
remote-helper: Fix `FETCH_HEAD` setting on fetch
The `git2` crate is not reliable at setting the `FETCH_HEAD` on fetch.
Therefore we disable that feature, and let the git command-line do its
thing.
2023-11-22 11:29:44 +01:00