Commit Graph

315 Commits

Author SHA1 Message Date
Fintan Halpenny f038b7ee5c
cli: watch for upload-pack events in `rad init`
To improve the user experience of `rad init`, the events listener waits for
upload-pack messages indefinitely. The spinner reports back the upload progress
over time.

This process can be cancelled via Ctrl+C without affecting the announcement,
since that is happening in the background.

To also improve the experience, the remote NIDs that have successfully synced
are reported to the terminal.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-05-15 10:07:56 +01:00
cloudhead 21cced05c1
node: Allow for "WAL" mode in sqlite
This solves concurrency issues between the node and http daemon.
2024-05-14 16:34:30 +02:00
cloudhead 2ca1e74707
cli: Have way to delete payload field in `rad id`
Allow for deleting a field by setting it to `null`.
2024-05-13 16:12:41 +02:00
Fintan Halpenny e8f2f88bf6
cli: Add test for unknown field in identity doc
Add a test to confirm that the identity can still be deserialized when an
unknown field is added.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-05-07 10:21:07 +02:00
cloudhead a54180199e
node: Further increase the rate-limit defaults
The rate-limitter gets hit on connect, due to historical gossip messages
being exchanged. This results in a high initial burst that needs to be
accounted for.
2024-05-02 13:43:09 +02:00
cloudhead a9b94b0ad6
node: New relay configuration for nodes
Relay now has three values: "always", "never" and "auto".

The first two operate like the previous `true`/`false`. The
new (default) value turns relaying on for nodes with public (external)
addresses and off for nodes without. This should reduce redundant traffic on
the network, that was causing the rate limiters to trigger.
2024-05-02 11:45:29 +02:00
cloudhead abf89438ea
node: Increase default rate-limiter config
With the increase in traffic on the network after launch, the old
defaults don't make sense anymore.

Longer term, we should look into throttling outgoing messages as well,
prioritizing original messages over relayed messages.
2024-05-01 11:06:28 +02:00
cloudhead b31fbde159
node: Add `log` to node config 2024-04-29 15:59:17 +02:00
cloudhead deeb39c558
node: Support "transparent" Tor
This allows for configuring your node such that `.onion` addresses
encountered are treated as regular DNS names.
2024-04-26 10:37:41 +02:00
cloudhead 0b5fa51a92
helper: Allow pushing a raw SHA-1 2024-04-18 17:09:45 +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 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
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
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 057af40ea3
radicle: Fix config loading with bad alias
Previously, a config would load fine with an invalid alias,
due to how serde is configured for the `Alias` type. This fixes it.
2024-03-21 14:44:04 +01:00
Alexis Sellier ddd4bde302
node: Make worker count configurable 2024-03-19 16:34:15 +01:00
Alexis Sellier 5ae617abf0
helper: Don't sync if we aren't seeding 2024-03-18 13:04:48 +01:00
cloudhead 752656fbfa
cli: Fix output of `rad auth`
The `rad help` command was not the right one.
2024-03-15 10:20:28 +01:00
Fintan Halpenny 14ce5fe7b1
cli: show reviews on `rad patch list`
When running `rad patch list`, show the set of delegate reviews for
each patch, with the following meaning for the symbols:

- ✔: delegate has accepted the patch
- ✗: delegate has rejected the patch
- -: delegate has not made a verdict on the patch

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 13:22:14 +01:00
josibake ce1e1f71ae
cli: Improve `rad init` wording
If the user passes a <path> argument to init, it is incorrect and a
bit confusing to reference the "current directory" or "this directory"
e.g. "run rad . in current directory" when the repo was not created in the
current directory and was created with a path argument instead.

Use the path provided by the user in help text, otherwise reference
the current directory.
2024-03-11 13:08:03 +01:00
Fintan Halpenny 18fc41c53f
cli: error on no id update
If `rad id` is called with no arguments, or just `--title` and
`--description`, then it will fail because there were no changes made
to the identity.

Check if the `proposal` document is the same the `current` document,
and if so supply a hint and a better error.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 13:05:01 +01: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
Fintan Halpenny 87d1cb50a0
fetch: allow fetch of annotated tags
If an ancestry check of an annotated tag was triggered then the fetch
from that peer would fail. This is due to `graph_ahead_behind` only
working for commit-ish objects.

To allow for annotated tags, and other object that peel to commits,
the check now peels the two objects to commits before getting their
`Oid`s. The call to `graph_ahead_behind` can take these two `Oid`s
instead.

A test for annotated tags is included as part of the `examples/git`
suite in the CLI tests.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-11 11:13:26 +01:00
cloudhead b917c1b411
cli: Rename `rad ls --seeds` flag
Rename to `--seeded` as per our discussion in Zulip.
2024-03-11 10:46:09 +01:00
cloudhead d1e2e3b61e
cli: Fix some tests 2024-03-09 14:01:30 +01:00
Fintan Halpenny 3bba7d1634
cli: test rad patch delete
No tests for `rad patch delete` existed.

Add a test where two peers interact on a patch and one decides to
delete the patch. It ensures that the patch is still visible to the
peer that did not delete the patch.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-08 23:43:19 +01:00
Alexis Sellier 1c4a2cd167
helper: Fix error message
Git was outputting a confusing message when an unuspported option was
used:

  fatal: helper rad does not support 'push-option'

This fixes it.
2024-03-08 23:25:31 +01:00
Alexis Sellier 786ce40f95
node: Add connection limits
The limits are roughly modeled after the Bitcoin network.
2024-03-08 23:24:34 +01:00
cloudhead a48081f271
cli: Move node addresses command
To make things a little more consistent, move the `rad self --address`
command to `rad node config --addresses`, since it's more about
externally-facing configuration of the node, rather than your local user
or profile.
2024-02-26 14:23:13 +01:00
cloudhead 9c96b46c59
cli: Show full path in `rad init`
Instead of showing a '.'
2024-02-26 12:40:17 +01:00
cloudhead 9c9bbbe7bb
node: Expose listen addresses 2024-02-26 12:35:20 +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 c63aaaceac
cli: Fix `id` COB notifications in `rad inbox` 2024-02-23 11:35:54 +01:00
cloudhead eff40166c9
cli: Add `rad unseed` command
This replaces the `-d` flag of `rad seed`, making it more like `rad
unfollow`.
2024-02-22 16:02:40 +01:00
cloudhead e06dd208f4
cli: `rad seed` output improvement
Better colors, and re-order fields to have policy before scope.
2024-02-22 16:02:38 +01:00
cloudhead 9767b485c2
cli: Improve `rad inbox` output
* Add change authors
* Add object status
* Add colors
2024-02-12 14:03:14 +01:00
cloudhead b477864b83
cli: Stabilize sort order of inbox repos
Sort repositories before displaying them.
2024-02-12 12:01:54 +01:00
cloudhead 664cf20c92
Change default seeding scope to 'all'
This makes the default policy `block` with scope `all`. The good thing
about this is that you don't have to manage individual nodes in the
beginning. You simply seed the repos you want, and everything is
followed within those repos. This matches user expectations, as `rad
seed` does what you expect it to do.

For open-policy seed nodes, it also means that simply changing `block`
to `allow` from the default config is all you need.

This leaves the non-default `followed` scope as a more "advanced"
setting, since it is much more cumbersome: it forces you to follow a
user before you can see their issues/patches, which is not something
most users expect coming from old-shcool forges.
2024-02-12 10:56:21 +01:00
cloudhead 137961c1f7
cli: Add `rad config get`
Gets a specific config value.
2024-02-07 17:12:45 +01:00
cloudhead e5fcbba4c0
cli: Implement `rad block` command
Blocks repos & nodes from beeing seeded/followed.
2024-02-07 15:51:05 +01:00
cloudhead fe55de181d
cli: Add new `rad inbox` command
Shows you updates on local repositories.

Included here is a basic implementation of a notification system. A new
database is created and updated after every fetch, with refs that have
changed.

The `rad inbox` command can then list items in the database and delete
them.
2024-02-06 11:40:58 +01:00
cloudhead 0a3da17fad
cli: Add `--seeds` option to `ls`
Small addition that is useful.
2024-01-31 17:24:59 +01:00
cloudhead 1ece339eac
cli: Hint to install ssh-agent 2024-01-31 14:07:28 +01:00
cloudhead 3560e0066d
Fix preferred seeds configuration
When using `network: "test"`, we shouldn't default to any public seed
node. This change makes sure that the "preferredSeeds" configuration var
is only given a value when `network` is `main`.
2024-01-31 12:09:09 +01:00
cloudhead b994c4a6ef
cli: Rework `rad sync`
The command now works with both a replica target *and* a seeds target.
This is especially useful to eg. ensure that a preferred seed has been
synced, while still trying to hit a higher replica count.
2024-01-26 15:22:10 +01:00
cloudhead c13c658f4e
cli: Add `rad self --address` command
Useful when running seed nodes.
2024-01-25 21:16:58 +01:00
Fintan Halpenny 49584f4e73
radicle: pinned repositories configuration
Introduce pinned repositories to the `profile::Config`, i.e.
`config.json`.

This is used for pinning repositories in the httpd `/projects` handle.

To allow returning all repositories, an `all` query parameter is also
included.

This is non-backwards compatible change, since we introduce the `show`
query parameter which, if not supplied, will default to `pinned`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-24 10:55:27 +01:00