100 Commits
Author SHA1 Message Date
Sebastian Martinez 57da779949 radicle: Add a load method to radicle::profile::Home
radicle: refactor `Home::load`

- Refactor out getting the subdirectories to ensure they are the same
across `new` and `load`
- Return all missing directories in the error message
- Document `load` and make it `pub`
2026-03-13 14:47:24 +01:00
Sebastian MartinezandLorenz Leutgeb 7e5a1ababc radicle: Skip invalid named folders
Instead of failing with an `InvalidId` error in
`radicle::storage::ReadStorage::repositories` for repos that don't have
a valid repository ID, skip them and log a warning.


Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-11-28 20:31:06 +01:00
Sebastian Martinez 6d0c571ea9 radicle: Return individual results for repo in repositories_by_id
Change `repositories_by_id` to return `impl Iterator<Item = Result<RepositoryInfo,
RepositoryError>>`
instead of `Result<Vec<RepositoryInfo>, RepositoryError>`.
This allows callers to handle failures on a per-repository basis rather
than having the
entire operation fail if a single repository lookup fails.

Previously, the method would stop processing and return an error as soon
as any repository failed to load. Now it processes all repositories and
returns individual results, making the API more resilient and giving
callers
more control over error handling.
2025-11-06 10:43:04 +01:00
Sebastian Martinez 9bcdd353c9 cli/inbox: Use clap 2025-10-28 12:11:37 +00:00
Sebastian Martinez f8fe296ceb radicle/rad: Fix typo 2025-10-20 15:09:43 +01:00
Sebastian Martinez 8604d3bcc7 cli/config: Use clap 2025-10-20 12:04:31 +01:00
Sebastian Martinez c1d9f04963 cli/self: Use clap 2025-10-17 16:45:20 +01:00
Sebastian MartinezandLorenz Leutgeb 5fea9ac05c node: Add --log-logger structured and --log-format json
Optionally depend on crate `structured-logger`. Allow enabling it via
`--log-logger structured`. For future compatibility, provide
`--log-format` which currently only supports JSON.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2025-09-23 16:33:50 +02:00
Sebastian Martinez 19210faab8 protocol/service: Change Routing table updated.. from info to debug 2025-09-16 13:38:26 +01:00
Sebastian MartinezandFintan Halpenny 1d7478cd90 radicle: introduce cob::common::Title
This patch adds the `cob::common::Title` struct, this allows instead of
using `std::str::String` or generics and traits for it, to define more
precisely what a title should be.
It trims the provided string and makes sure it contains no carriage
return or new line characters.

Where a `std::str::String` makes more sense so it's easier to mutate it,
we keep the code as is.

Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2025-08-19 17:05:33 +02:00
Sebastian Martinez efeefd0daa chore(debian/changelog): update package version to match upstream 2025-07-23 11:34:20 +02:00
Sebastian Martinez 4e08eef8d5 radicle: add missing review_react methods 2025-07-15 11:37:04 +02:00
Sebastian Martinez 570bfc3bbd debian: add missing env variables to debian build
During the build of heartwood there are a few environment variables in
particular `GIT_HEAD` and `RADICLE_VERSION` that are added during build
to be part of the final binary.

This wasn't the case so far with the debian packages, this patch exports
the needed vars for `override_dh_auto_build` so commands like `rad
--version` display the values.
2025-06-25 13:46:44 +02:00
Sebastian Martinez 6686f86c67 radicle: fix small typo 2025-06-24 13:50:37 +02:00
Sebastian Martinez a8ab718b98 chore(debian/changelog): update package version to match upstream 2025-06-03 17:55:02 +02:00
Sebastian Martinez 7380e2118b chore(debian/control): add sebastinez to Uploaders 2025-06-03 17:54:55 +02:00
Sebastian Martinez 985987468d radicle: add list_by_status method to cob::issue::Issues
Provides the same `list_by_status` and `<status>` methods that
`cob::patch::Patches` has to `Issues`
2025-01-14 13:36:14 +01:00
Sebastian Martinez 7c902b6905 radicle: Add resolves and labels method to cob::patch::Revision
To be able to query the `BTreeSet` that shows which comments are
resolved by a specific revision and the `Iterator` of `Label` we require
some methods to obtain them.
2025-01-14 13:34:38 +01:00
Sebastian Martinez b6cf6fea8d cli: Fix rad ls help message
If the user wants to see all `seeded` repositories, we should tell them
to use the `--seeded` option instead of the `--all` option.

Since `--all` also shows repos that aren't being seeded.
2025-01-14 12:18:40 +01:00
Sebastian Martinez a7e96131ce radicle: add notification count grouped by repo
While the total notification count and the notification count by repo
are needed, for most UIs users will want to see the total notification
count grouped by repo.

This new method will provide this without the need of checking all
possible repos to see if they have notifications.
2024-11-21 12:04:32 +01: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
Sebastian Martinez dff6df10fb httpd: Add /raw route to get file at canonical head
Instead of requiring to specify a commit to obtain a file through the
/raw route, this commit allows to prefix `/head` to get the file at the
current canonical head commit.
2024-06-04 14:19:11 +02:00
Sebastian Martinez 5727359319 httpd: Validate blob sizes 2024-05-15 13:03:28 +02:00
Sebastian Martinez 5ffbf7545f httpd: Add apiVersion to root handler and node information
This will help consumers of the httpd to check if they are on the right
version of the API
2024-05-02 13:09:00 +02:00
Sebastian Martinez d04d9d7d1f httpd: Add threshold to project info 2024-05-02 14:43:12 +02:00
Sebastian Martinez c4d4ad7008 httpd: Add alias to project delegates 2024-05-02 14:43:12 +02:00
Sebastian Martinez 854fc9af8e httpd: Decouple repo stats from tree endpoint 2024-05-02 14:41:27 +02:00
Sebastian Martinez 7fc3b73e88 Update radicle-surf to 0.21 2024-04-24 11:51:25 +02:00
Sebastian Martinez 574ac3566b httpd: Remove diff and branches from history route 2024-04-10 11:44:00 +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
Sebastian Martinez 0581c017ae cli: Add rad patch archive --undo
Allows archived patches to be reverted to open state.
2024-03-21 20:33:15 +01:00
Sebastian Martinez 3aca2a11b0 httpd: Only return cache header on success 2024-03-21 12:45:13 +01:00
Sebastian Martinez 98bb91680d httpd: Update stats to count all repos
Instead of filtering private repos for a total count, we should count
all repos.
2024-03-11 12:38:00 +01:00
Sebastian Martinez 955c942c18 httpd: Improve alias use in tests 2024-03-11 12:31:28 +01:00
Sebastian Martinez 088549a333 httpd: Add support for submodules 2024-03-11 12:27:27 +01:00
Sebastian Martinez bdd1b238fc Bump radicle-surf to 0.19.0 2024-03-11 12:27:27 +01:00
Sebastian Martinez 325289d28f httpd: Insert test node into node db in test::profile fn
To allow the `AliasStore` to retrieve an alias from the node db, we need
to insert it manually into the database in the `profile` function, else
we won't find any Aliases there.
2024-03-11 11:52:46 +01:00
Sebastian Martinez 9950182ee0 cli: Remove rad-web from help
Due to it not being stable, and eventually the auth flow to be
rewritten, it should be removed.
2024-03-11 11:06:32 +01:00
Sebastian Martinez 5bdc2ad1fb httpd: Add author alias to reactions 2024-03-08 23:20:38 +01:00
Sebastian Martinez 501b6ba9eb httpd: Add author information to assignees 2024-03-08 23:15:34 +01:00
Sebastian Martinez e799a7ccba httpd: Add --path param to rad-web
This passes a `path` variable to the `auth_url` so consumers can open
desired pages directly.
Also checks the cwd to start rad web with a path corresponding to it.
2024-02-01 17:33:21 +01:00
Sebastian Martinez 29cb5c085d httpd: Add /nodes/:nid and /nodes/:nid/inventory endpoints to get info on other nodes 2024-02-01 17:29:10 +01:00
Sebastian Martinez db6cb55d6c httpd: Add review ids to review json 2024-02-01 17:25:18 +01:00
Sebastian Martinez 921f9f2d76 cli: Display rad-web in rad --help
Only show `rad-web` in help, if we are able to run the binary.
2024-01-31 13:30:40 +01:00
Sebastian Martinez 5333f8217a httpd: Add reactions to revisions, improve json for comment reactions
Instead of using tuples and lots of arrays, this commit tries to use
`BTreeMap`s to provide more context to review, issues, patch and other
comments.

Also the returned object by the httpd is more aligned with what is
needed by the consumer, so less recomputation is needed for display.
2024-01-31 12:14:05 +01:00
Sebastian Martinez c4afd897f9 web: Using connect address in auth_url
Due to only using the `options.listen` address in the creation of the
`auth_url` we aren't able to authenticate with an existing httpd instance
if the instance isn't the default value.
2024-01-19 11:27:16 +01:00
Sebastian Martinez 14b90ffbf9 httpd: Change node id in / and add version to /node 2024-01-09 13:59:23 +01:00
Sebastian Martinez 9b98542692 httpd: Add /api/v1/profile route to get entire profile
That route is limited for requests that come from a loopback IP.
2024-01-09 13:59:23 +01:00
Sebastian Martinez 1bb400c278 httpd: Add edits field to revision json 2023-12-22 15:17:25 +01:00
Sebastian Martinez ee3dcfacf0 httpd: Allow edit revision embeds 2023-12-22 15:09:20 +01:00
Sebastian Martinez 5331cf3bcf radicle: Move DataUri to common::DataUri 2023-12-22 15:09:20 +01:00
Sebastian Martinez a3a8060e5c radicle: Add Vec<Edit> to revision description
This allows us to have embeds on a patch revision, and eventually also
show the edits that have been made to a revision description.
2023-12-22 15:08:35 +01:00
Sebastian Martinez 1f36879aa2 cob: improve Comment generics
`Infallible` is a more appropriate type in comparsion to `()` for
comments that do not require a `CodeLocation`.

That is because if the type for `location` is `Option<()>`, this means
that `Some(())` can be constructed, however, we never intend to
construct that variant. On the other hand, `Infallible` can never be
constructed, and so, only `None` can be used.

This requires updates to some functions to use the generic `T` and
also handle the different kinds of `Comment`s -- `Infallible` and
`CodeLocation`.

X-Co-Authored-By: Fintan Halpenny <fintan.halpenny@gmail.com>
2023-12-22 14:09:02 +01:00
Sebastian Martinez bdcaa60474 httpd: Update axum and hyper dependency 2023-12-15 12:08:43 +01:00
Sebastian Martinez 53c08f5d26 httpd: Cleaning up api::json and review comments 2023-12-13 12:37:10 +01:00
Sebastian Martinez 3e07808ee5 httpd: Add node policies endpoint
New endpoint on `PUT api/v1/node/policies/repos/:rid` and `DELETE api/v1/node/policies/repos/:rid`,
that allows to track and untrack a project.

For tracking a project we also accept `?from=<nid>` to specify
where we should fetch from after tracking a repo.
2023-12-05 16:07:22 +01:00
Sebastian Martinez f8005c74c6 httpd: Add comment edits to serialized json
This allows the display of any edits done to comments,
replies and issue descriptions.

This commit doesn't remove the body property
which is the latest comment body but adds a edits property.

Also adds an author property to the `Edit` struct,
which allows us to see the author of an edit action.
2023-12-05 16:01:50 +01:00
Sebastian Martinez 9ae7fd702e httpd: Add endpoint with tracking information
This allows us to check which projects are really tracked by the node
and which aren't and with which scopes and policies.
2023-11-30 12:30:07 +01:00
Sebastian Martinez 638c2a3e4c httpd: Announce refs in project POST/PATCH routes 2023-11-24 13:47:14 +01:00
Sebastian Martinez 1cbca28b7c httpd: Use a simpler way of obtaining a Blob without a commit 2023-11-24 13:42:30 +01:00
Sebastian Martinez 8277559ee0 Update radicle-surf to 0.17.1 2023-11-24 13:42:30 +01:00
Sebastian Martinez b64fc22c18 httpd: Show private projects in project listing
We check if the `SocketAddr` from the request is equal to `127.0.0.1`
and if so we also list private repos.
2023-11-22 12:36:22 +01:00
Sebastian Martinez 193ed2f675 radicle: Add missing embeds in RevisionComment 2023-11-06 14:51:33 +01:00
Sebastian Martinez 15cf5c6100 httpd: Parse git URIs into Embed
Currently we only handle data Uris, but when a user sends a comment that
has a existing git Oid, due to editing a comment we also need to handle
this case.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-30 15:41:34 +01:00
Sebastian Martinez 504a198cec Update radicle-surf to v0.17
This commit introduces the `FileStats` struct, that adds the insertions
and deletions for each file to `DiffContent`.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-11 14:29:34 +02:00
Sebastian Martinez 9a1a216f70 httpd: Add configuration to /node endpoint
Adds the "config" key containing node configuration.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-11 13:51:38 +02:00
Sebastian Martinez 78e6833672 httpd: Add missing COB actions
Handles missing issue and patch actions. Adds embeds to patch comments.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-11 13:36:48 +02:00
Sebastian Martinez 35da28d8af httpd: Return entire files from commit handler
Used for syntax highlighting.

Also improves the handling of multiple parent commits, by adding all of
them.
2023-10-03 12:19:18 +02:00
Sebastian Martinez 313fc1315d httpd: Increase body size limit for /projects/*
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-03 11:59:11 +02:00
Sebastian Martinez 5acfffb352 httpd: Improve data-uri support
We were just using `strip_prefix` with a hardcoded value, which wasn't
able to adjust to URIs that start with `data:image/png` or other content
and types.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-26 17:33:06 +02:00
Sebastian Martinez 9df1922f15 httpd: Add routes for handling embeds in issues
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-19 10:00:01 +02:00
Sebastian Martinez a3f460e67d httpd: Add node alias to session endpoints
This will allow us to show the alias of an authenticated user in the web
client.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-18 11:18:17 +02:00
Sebastian Martinez 6bb0dd1a28 Update radicle-surf to v0.15.0
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-18 10:57:37 +02:00
Sebastian Martinez d6d280d450 httpd: Return entire files in diff endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-02 19:02:25 +02:00
Sebastian Martinez 994f52d654 httpd: Add reactions and edits to patches
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-08-22 14:42:09 +02:00
Sebastian Martinez 6abbd39926 httpd: Allow removing of reactions from issues
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-08-14 16:41:04 +02:00
Sebastian Martinez f418b5268c httpd: Add socketAddress to /node endpoint
This allows us in the web client to show and let user copy the node id
together with the correct port number

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-08-03 13:30:55 +02:00
Sebastian Martinez 7368e38942 radicle: Disable canonicalize_home tests on macos
We were doing a workaround stripping prefixes, but I think it makes more
sense to skip the test all together.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 1241bbb4e8 docs: Replace deprecated --all flag with --workspace
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 3366535c9d rad: Disable tests that use sed on macos
Due to differences between how BSD sed and GNU sed work, we disable for
now tests that use sed on macos

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 5cb4d5cd76 httpd: Add commit parents vector to /commits/:sha endpoint
So we can act upon the eventual parents of a commit, after fetching a
single commit we need to have the parents of that commit as part of the
json payload.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:21:31 +02:00
Sebastian Martinez 0e0ff38ff7 httpd: Fix commit count in repo stats in history route
Instead of using always the repo HEAD for the commit count with
`repo::stats` we should use `repo::stats_from` and pass the `parent`
commit.

This way we allow e.g. a commit history for a peer with lesser commits
to be counted correctly.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-25 12:34:03 +02:00
Sebastian Martinez 8ed55a1925 cli: Add --to flag to rad issue react
This allows the CLI to create a reaction to a specific comment without showing the
comment selector.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-10 16:41:42 +02:00
Sebastian Martinez 6578fedfbb cli: Add issue id to show_issue function
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-06 11:11:20 +02:00
Sebastian Martinez d2202a07ab httpd: Add validate fn to auth module
Check for AuthState and expiry.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-02 17:34:24 +02:00
Sebastian Martinez c2dd778183 cli: Add --json flag to rad web
This allows third party integrations to read the obtained sessionId and
the signed payload without having to implement it on their own.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-30 10:39:37 +02:00
Sebastian Martinez 76ba25268d cli: Add routing entries per rid and or nid
To allow third party tools read the routing table entries filtered by
rid or nid and if needed in json format.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-22 11:58:43 +02:00
Sebastian Martinez 8d8751655f cli: Add rad node events command
Allows third party implementations to listen to the event stream of a
node.

In case of a serialization error we exit the event subscription and end
the process.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-17 16:55:06 +02:00
Sebastian Martinez d8711a8d43 radicle: ensure stable sigrefs commit
When updating sigrefs with `storage::refs::save` we weren't checking
the `RAD_COMMIT_TIME` variable, so the sigrefs commit was using current
time, and we weren't able to reproduce a deterministic sigrefs commit.

Make `refs::save` reproducible in debug mode using `debug_assertions`
and checking the `RAD_COMMIT_TIME` environment variable.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-16 12:35:16 +02:00
Sebastian Martinez 8667553740 httpd: Add cob state to listing endpoints
This commit adds the cob state of either patches or issues to the
corresponding endpoint.

So we can either query a cob listing with the required state or expect
the default state.
And once filtered by cob state we paginate.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-20 20:38:15 +02:00
Sebastian Martinez 87f47cdc67 Reduce pub accessors in patch and issue cob structs
Replaces pub accessors to struct fields with methods
Also creates some methods to compute necessary information

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-31 13:44:37 +02:00
Sebastian Martinez 91efbd9630 Rename patch::State::Proposed to patch::State::Open`
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-30 10:46:57 +02:00
Sebastian Martinez 8907ddb8a5 httpd: Add patch::Action::Lifecycle
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-30 10:46:57 +02:00
Sebastian Martinez c9aaaec2ee cob: Add patch::Action::EditRevision
To be able to change the description of a patch revision, without the
need to create a new revision.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-30 10:42:49 +02:00
Sebastian MartinezandFintan Halpenny fa15ca59f1 cob: Use LWWReg::new instead of LWWReg::from
Using LWWReg::from was giving subsequent actions
the same clock value as their predecessors.

This resulted in a Reject not being able
to turn into an Accept on a second review of a patch.

The solution is to use the clock value that was produced for the Op
and pass that into new, avoiding the call to from.

Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-30 10:40:21 +02:00