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 Martinez
a5746b4f08
httpd: Add reactions to issue and patch json
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-25 12:04:53 +01:00
Sebastian Martinez
6b62f5bb28
httpd: Add patch head refs to patch output
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-25 11:54:09 +01:00
Sebastian Martinez
564886b165
httpd: Add `path` property to `CodeLocation`
...
For the web client to be able to show file we need to provide
the web client with the file path.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-23 11:41:13 +01:00
Sebastian Martinez
00ea587c6d
httpd: Add `CorsLayer` to `/raw` endpoint
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-23 11:07:58 +01:00
Sebastian Martinez
f2d31aa9c0
httpd: Add patch update endpoint
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-22 13:53:19 +01:00
Sebastian Martinez
fc724a2333
httpd: Add commit diff endpoint
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-21 18:50:26 +01:00
Sebastian Martinez
73221e43d7
httpd: Add more revision properties to patch
...
For display purposes in the web client, we add with this commit the
some needed properties to the revisions in the patch endpoint.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-20 18:43:06 +01:00
Rūdolfs Ošiņš
d40f40b9af
httpd: Use camelCase in query params
...
It's more ergonomic to consume in JS/TS.
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-03-17 17:11:00 +01:00
Sebastian Martinez
2c0cdcd1c5
httpd: Add timestamp to revisions json
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-17 13:54:48 +01:00
Rūdolfs Ošiņš
fdd6bca311
httpd: Fix status code in commit history endpoint
...
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-03-15 10:17:41 +01:00
xphoniex
29b933e485
httpd: Use `RID` in tests
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-13 16:25:26 +01:00
xphoniex
3ee76c2891
httpd: Separate `Error` types of git route and `/raw`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-13 16:25:26 +01:00
xphoniex
b80fc5437c
httpd: Move `404` test from `git` to root router
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-13 16:25:26 +01:00
Alexis Sellier
7266729924
Make Patch `state` field similar to Issue
...
Since they are similar objects, they should have similar structure.
This also makes it easier to add state metadata like for issues.
2023-03-13 13:55:12 +01:00
xphoniex
9f1896e07f
httpd: Add root handlers for `/api/v1` and `/api`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-12 19:12:40 +01:00
Alexis Sellier
6e90444406
httpd: Basic alias support for git
...
Allows cloning via git using an alias instead of the full RID.
Eg. `git clone https://seed.radicle.xyz/heartwood.git `
2023-03-12 18:31:19 +01:00
Alexis Sellier
aacacf872f
cob: Use `EntryId` as the operation identifier
...
By introducing a small limitation: only allowing entries in the change
graph to be addressable, instead of individual operations; we
drastically simplify the CRDT implementation.
There are four advantages:
1. Op ids are just regular SHA-1s
2. There's no need for relative IDs, ops never refer to other ops within the
same commit
3. There's no need for a nonce, since commits can't collide, and neither can op IDs
4. `OpId` can just be an alias of `EntryId`
The disadvantage of course, is that we have to be mindful of how we
create op transactions, since each transaction creates an addressable
unit. For example, we must not include multiple patch revisions in the
same transaction.
2023-03-09 17:08:56 +01:00
xphoniex
c7a955e9fe
httpd: Run tests off another remote for `test::seed`
...
Keep `test::contributor(..)` to test interactions with a contributor node.
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-08 15:27:13 +01:00
xphoniex
900796956c
httpd: Remove `radicle_cli` from tests
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-07 15:08:11 +01:00
xphoniex
267b0ed312
httpd: Use `radicle-term` instead of `radicle-cli::terminal`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-07 14:49:18 +01:00
xphoniex
488468991c
httpd: Set a max allowed size of 4 MiB when serving files raw
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-07 09:37:02 +01:00
Alexis Sellier
9000a626d7
Use commit oid for COB parent
...
We were using the blob oid, which was causing the commit tree to
be invalid.
2023-03-06 15:39:34 +01:00
Alexis Sellier
be5c9c9258
cli: Add `--verbose` flag to `init`
2023-03-06 15:38:42 +01:00
Alexis Sellier
e69be6051d
cli: Give more control over `init` announcement
...
Instead of always announcing the inventory, by default we don't.
Users can run `rad push` to trigger an announcement.
2023-03-06 15:38:42 +01:00
Alexis Sellier
8c22012d61
Remove need to pass public key in cob store
2023-03-06 10:56:20 +01:00
Sebastian Martinez
05d2487a47
httpd: Add patch creation endpoint
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-06 10:26:38 +01:00
xphoniex
077c040c08
httpd: Change format of tracing messages
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-03 16:13:10 +01:00
Alexis Sellier
5f59493c70
cob: Don't require a local fork to exist
...
Before this change, the identity document would be loaded for the
COB signer. This meant that a fork would be needed for that signer.
After this change, it's no longer necessary, since the identity doc
head is computed from available remotes.
While making those changes, it was also apparent that some of the
identity-related functions had bad names and error types, this
was fixed as well.
2023-03-01 15:40:30 +01:00
Sebastian Martinez
796ae2f96a
httpd: Sort issues and patches by creation date
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-01 13:02:09 +01:00
Alexis Sellier
1bb6f9a921
httpd: Don't load project payload twice
2023-02-28 18:37:26 +01:00
xphoniex
de24a04621
httpd: Use `repo.identity_doc()` instead of `repo.identity_of(..)`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-28 18:08:26 +01:00
Alexis Sellier
06a92d52d9
cob: Use hashes for operation ids
...
It's fairly easy for a user to (by mistake or intentionally) create two
operations with the same OpId. This patch makes it much less likely,
and ensures that if the OpId is equal, it's because the operations
are identical.
2023-02-27 17:11:48 +01:00
Sebastian Martinez
97a2f8c1df
httpd: Add issue and patch counts
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-27 12:57:20 +01:00
xphoniex
34b15f9f16
httpd: Add `/raw` route
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-23 06:16:37 +00:00
xphoniex
2606372a14
httpd: Use `State` instead of `Extension` for `root_handler`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-23 05:54:31 +00:00
xphoniex
6ca1c89610
httpd: Update `/git` test to use `test` helper fns
...
Update `axum` to 0.6.7 to be able to use fix in:
https://github.com/tokio-rs/axum/pull/1767
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex
f290f6b4a5
httpd: Move `test` utility mod from inside `api` to root
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex
c1b6ceb141
httpd: Change `500` into `404` when project doesn't exist
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex
be5afcc600
httpd: Move `git` router & handler into its own file
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
Fintan Halpenny
ef0628c48e
Exchange From for TryFrom for PathBuf and Home
...
The `From` implementation would allow someone to create a `Home` in an
incorrect fashion, for example the path is not canonical.
Exchange `From` for a `TryFrom` implementation.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-17 10:37:39 +01:00
Sebastian Martinez
b04451a1bd
Use `Did` in a bunch more places
...
Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑 ` While we want to maintain
`Author` and `ActorId` for internal use.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-16 18:01:42 +01:00
xphoniex
a1e1e04fd9
httpd: Return correct count for `patches`
...
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-16 16:51:02 +01:00
Alexis Sellier
950fae209d
Make `ReadStorage` more usable
...
Previously, we were not able to access a `ReadRepository` instance
through `ReadStorage`. With this change, we are able to.
2023-02-15 22:08:20 +01:00
Sebastian Martinez
867eea5c38
httpd: Add delegates to project routes
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-14 14:50:42 +01:00
Sebastian Martinez
881e9af219
httpd: Add `assignees` to `Issues::create`
...
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-13 13:47:15 +01:00
Alexis Sellier
27d0c8f235
cli: Track projects we initialize
2023-02-12 16:48:46 +01:00