Commit Graph

1860 Commits

Author SHA1 Message Date
cloudhead 95b5191533
Reproducible cross-compiled builds
Implement a new build pipeline using `podman` and `zig` that is
reproducible and can be run entirely on linux.

We also simplify the versioning system, defaulting to the output of `git
describe` when there are no exact tag matches.
2024-04-20 11:11:00 +02:00
cloudhead 0b5fa51a92
helper: Allow pushing a raw SHA-1 2024-04-18 17:09:45 +02:00
cloudhead 4276a70eb1
node: Event on local refs announcement
This allows us to listen on the socket for when the user announces new
refs.
2024-04-18 10:57:55 +02:00
cloudhead e5d8563cca
node: Update routing table on fetch
Since a user can force a fetch of a private repository without any
announcement being involved, we update the routing table if the fetch
completes successfully, with the remote node.
2024-04-18 10:51:23 +02:00
cloudhead f17df88229
term: Update `inquire` crate 2024-04-15 17:12:36 +02:00
Sebastian Martinez 574ac3566b
httpd: Remove diff and branches from history route 2024-04-10 11:44:00 +02:00
Fintan Halpenny 3556758386
cli: fix rad inbox clear output
If multiple ids are specified for `rad inbox clear`, it would report
that only 1 item was cleared, when in fact multiple were.

This was found to be due to the SQL code returning a change count of
`1`. This is likely due to the way the statement is being reset each
time. The `sqlite` library does not seem to easily support the usage
of `IN` in a `WHERE` clause. So instead, the `count` is aggregated in
the loop and returned instead.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-09 16:09:44 +02:00
Fintan Halpenny 8bf871903a
node: handle removal of cob from cache
When a `Patch` or `Issue` is entirely removed from the Git repository,
then there is no update to be made -- instead it should also be
removed from the cache.

This covers the case where the original author of the COB deletes the
COB.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-09 16:06:51 +02:00
cloudhead 53ecc88437
node: Always notify the service of a fetch result
Even if the peer is no longer connected.
2024-04-09 16:00:49 +02:00
cloudhead 395d317954
node: Keep track of data sent/received in fetch
Keep track and log the Git data sent/received.
2024-04-09 15:59:55 +02:00
cloudhead e3ecf4d7a0
cli: Add partial clone fail test
Ensure `rad clone` is successful as long as one fetch succeeds.
2024-04-09 15:54:08 +02:00
cloudhead 2eb665678e
cli: `rad sync` UX improvements
* Add `--force` flag to force a fetch even if the node is not a seed.
* Don't fail if we can't connect to a node during a fetch.
* More accurately exit when we hit our replica count.
2024-04-09 10:43:35 +02:00
cloudhead e9b79fb6d0
cli: Improve UX for cloning/fetching private repos
When `--private` is passed to `clone`, we force a fetch from nodes that
aren't known seeds.

When it isn't specified, we skip nodes that aren't known seeds, even if
they are in the preferred seeds list. Previously, we would still fetch
from them, which would cause errors.
2024-04-08 22:15:56 +02:00
cloudhead ef1ed621d7
node: Don't re-queue fetch that is already queued 2024-04-08 17:15:57 +02:00
cloudhead e19c773a86
fetch: Improve logging of clone 2024-04-08 17:06:38 +02:00
cloudhead 976b58ba7a
node: Simplify and fix fetch dequeueing
There was redundant code and a missing `break`.
2024-04-08 12:48:49 +02:00
cloudhead bd8e0ebcda
cli: Add tool in case `sqlite3` is unavailable
Adds the `rad node db exec <query>` command.

Easy way to run sqlite queries if the sqlite3 CLI is not available or
too old.
2024-04-06 17:55:59 +02:00
cloudhead ad7ba82e6a
node: Populate refs db on startup
If the refs database is empty, populate it on startup.
Also includes a script to clear it.
2024-04-05 21:59:58 +02:00
cloudhead 6be77ca9c3
radicle: Implement `remote_refs_at`
Implement this function on `RemoteRepository`, and move `repositories`
to the trait level.

This function will be used to quickly get the `RefsAt` of all repository
remotes.
2024-04-05 21:59:28 +02:00
cloudhead 7834dccd2c
node: Account for skipped refs when announcing 2024-04-05 17:40:53 +02:00
cloudhead bc247dff24
node: Skip fetch early if no refs in announcement 2024-04-05 12:17:17 +02:00
cloudhead e55c86f1ce
node: Improve fetch logging 2024-04-04 18:41:53 +02:00
cloudhead 6ff4efebed
node: Remove namespaces from fetch request
It was unused..
2024-04-04 18:22:19 +02:00
cloudhead f2fe0242e1
node: Always check refs status before fetching
We were only checking it on dequeue.

Also simplifies some of the logic by centralizing the check for fetching
our own refs.
2024-04-04 18:10:49 +02:00
cloudhead 36808234a6
cli: Don't allow announcing without a fork 2024-04-04 14:13:34 +02:00
cloudhead 51e64cfa8b
node: Fix logging for skipped refs
We were using the wrong condition.
2024-04-04 12:24:49 +02:00
cloudhead a5212a7a88
term: Fix editor command with args
We add support for `EDITOR` being set to a command with arguments, eg.
`code --wait`.

Fixes dd6861f.
2024-04-04 10:52:36 +02:00
Fintan Halpenny ea69168f44
cli: explain public to private changes
Add an example of changing a public repository to a private
repository, noting that any replicated data will be public, but any
new changes will not be replicated.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-03 15:41:48 +02:00
Lars Wirzenius a71289f720
docs: link to protocol guide
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-03 15:32:26 +02:00
Sebastian Martinez b16eb5c986
man: Add `rad patch archive` to man page 2024-04-03 15:25:31 +02:00
Sebastian Martinez d38846baae
cli: Display better errors in `patch ready`
Instead of doing nothing and going to sync no change, we should display
some error to the users that we haven't been able to apply the changes.
2024-04-03 15:19:31 +02:00
Sebastian Martinez 0a78b9cc5b
cli: Display correct merge author in rad patch show output 2024-04-03 15:11:34 +02:00
Richard Levitte b495358c5f
cli: Don't force bold output to be white
On terminals in light mode, it makes the bold stuff invisible.

Signed-off-by: Richard Levitte <richard@levitte.org>
2024-04-03 15:07:31 +02:00
Fintan Halpenny cd9b46fe51
radicle: fault tolerant thresholds
There are two areas where we can be more tolerant of delegate namespaces
being missing or not validating:
1. Calculating the canonical HEAD
2. Fetching from a remote

In 1. the protocol is tolerant in that if the local node does not have
the default branch for a delegate, it will still attempt to use any of
the delegates it does have to reach the threshold.

This is made safe by ensuring that if the threshold is being updated
then the node performing the update must have a threshold of delegates
locally in their storage. It also made safe by 2.

In 2. the protocol is tolerant by allowing delegates to be missing
from the serving side, as long as they can still meet a threshold of
delegates. This is further tolerant, when validating the received
data, a threshold of delegates are valid to consider the fetch
successful -- otherwise it will fail.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-04-03 14:30:05 +02:00
cloudhead 7e13e0759f
node: Simplify handling of fetch completion
* Don't branch based on whether it was a user-requested fetch or not.
* Only announce inventory on clones of public repos.
2024-04-03 14:25:02 +02:00
cloudhead fd4f5fff7d
node: Don't fetch if only our own remote
Skip the fetch from announcement if the announcement only contains our
own remote.
2024-04-03 14:25:02 +02:00
cloudhead 6744ffc325
node: Improvements to test reliability 2024-04-03 14:25:02 +02:00
cloudhead e90c6a49bc
node: Include identity doc in fetch result
This avoids having to reload the document in the service, which can be
an expensive operation.
2024-04-03 14:25:02 +02:00
cloudhead 991505ec9d
radicle: Switch error type for repository methods
This simplifies error handling for the next commit.
2024-04-03 14:25:02 +02:00
cloudhead 2b9a014243
node: Small changes and note around initial state 2024-04-01 16:32:30 +02:00
cloudhead 9a60d4ad7f
node: Put new `refs` table in new migration 2024-04-01 15:00:13 +02:00
Michael Raitza 97af643a86
nix: Update rust-overlay input to rust 1.77 2024-03-30 22:58:21 +01:00
cloudhead 256c620d31
node: Use refs cache to decide on fetching
When deciding whether or not to fetch a repo based on a refs
announcement, we need to know whether our signed refs are stale or not,
compared to the ones in the announcement. This can be quite expensive as
it requires multiple reads from Git's ODB, which often results in
packfile loading.

To remedy this, we introduce a refs cache in our node database that is
consulted when an announcement is received.

We also remove the logic that generates `info` messages, since they are
rarely needed and introduced more complexity.

Additionally, we revert commit 3ad2b4431f,
which introduced logic to minimze wants and haves with additional logic,
since it potentially also increases the load on the ODB.
2024-03-29 16:00:33 +01:00
cloudhead 345fa57b64
ci: Fix release workflow
By default, the `checkout@v4` action does a shallow clone, so we weren't
getting the history.
2024-03-27 13:51:38 +01:00
cloudhead 081af03362
Release 1.0.0-rc.1 2024-03-26 16:54:47 +01:00
cloudhead aaea06dd98
term: Fix spinner output on certain platforms 2024-03-26 13:13:54 +01:00
cloudhead f01aac8828
cli: Add `inbox` to help output 2024-03-26 13:13:14 +01:00
cloudhead 9cdf0aa1fd
Update radicle crates to 0.9.0 2024-03-26 11:56:27 +01:00
cloudhead 77076af23c
radicle: Add new `ash.radicle.garden` seed node
Add the new `ash` node as a preferred seed, to load balance.
2024-03-26 10:36:31 +01:00
cloudhead 24bf2826cc
Update build script for 1.77
Remove the `rerun-if-changed` since it was causing problems with test
speed. By default, it will re-run if any file changes, which should be
fine.
2024-03-26 10:35:27 +01:00