Commit Graph
56 Commits
Author SHA1 Message Date
Sebastian Martinez 609bf226e8 httpd: Add patch::Action::Lifecycle
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-30 10:46:57 +02:00
Sebastian Martinez c809bd5b42 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 8826ec4f9c 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 5d7a2f19d6 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 e4020eaea1 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 2aff899dc2 httpd: Add patch update endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-22 13:53:19 +01:00
Sebastian Martinez 7dabd58aa5 httpd: Add commit diff endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-21 18:50:26 +01:00
Sebastian Martinez fcea4aeb7d 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ņš da96a82fc1 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 3f0141b087 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ņš caa7078d62 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 1c0dd54bbf httpd: Use RID in tests
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-03-13 16:25:26 +01:00
Alexis Sellier 0cf170e6cd 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
Alexis Sellier 2b44ff1b55 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 79934c3dfe 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
Alexis Sellier 11ea75f0ca 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 346737e3f8 Remove need to pass public key in cob store 2023-03-06 10:56:20 +01:00
Sebastian Martinez 970abf96b9 httpd: Add patch creation endpoint
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-06 10:26:38 +01:00
Sebastian Martinez 9efea143ab 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 ac0994a3be httpd: Don't load project payload twice 2023-02-28 18:37:26 +01:00
xphoniex da594fb521 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 7e8030b82f 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 6793b8e7d3 httpd: Add issue and patch counts
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-27 12:57:20 +01:00
xphoniex e7de186e0e httpd: Add /raw route
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-23 06:16:37 +00:00
xphoniex b0b94fea18 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
Sebastian Martinez 3cf1accddd 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 7e9b9c944b httpd: Return correct count for patches
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-16 16:51:02 +01:00
Alexis Sellier 8b90dd674f 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 95dca98a43 httpd: Add delegates to project routes
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-14 14:50:42 +01:00
Sebastian Martinez 43f32c8360 httpd: Add assignees to Issues::create
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-13 13:47:15 +01:00
xphoniex 4a27cc3f6c Update radicle-git and radicle-surf
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-10 22:14:50 +01:00
Sebastian Martinez a6d120fa28 httpd: Add api::test::patch request method
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-10 12:17:03 +01:00
Sebastian Martinez 2335bc7ecc httpd: Add issue endpoints
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-06 14:14:06 +01:00
xphoniex 6d9154d427 httpd: Extract issue json response
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-04 13:46:26 +00:00
xphoniex 49590bc72d httpd: Add routes for patch ops
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-04 13:22:09 +00:00
Alexis Sellier a8a24ec945 node: Check refs when getting local inventory
If we don't do this, we're going to be returning broken repos.
2023-01-30 11:38:00 +01:00
Sebastian Martinez 932d8d2ed8 Add web-based authentication
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-01-27 17:23:05 +01:00
xphoniex 2125128b5f httpd: Remove lastCommit in /tree for entries
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex f9e519296d httpd: Change sha1 into id
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 05da23b707 httpd: Use commits/commit instead of headers/header
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 24d19b69d2 httpd: change committerTime into committer.time
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 59e3afac67 httpd: Update axum from 0.5.x to 0.6.x
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-18 14:09:48 +00:00
Han Xu 64a933dccd httpd: Dogfood the new radicle-surf API
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-01-18 14:22:01 +01:00
xphoniex d98073a55d httpd: Add api tests
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-12 20:30:53 +01:00
Alexis Sellier 134bb7a847 cob: Create proper OpId type
To still access a comment's author, we add a new `author` field.
2022-12-31 09:58:51 +01:00
xphoniex 8e688fef34 Update radicle-git to 79a94721366490053e2d8ac1c1afa14fb0c25f09
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-23 13:22:55 +01:00
Alexis Sellier 10d450c751 cob: Implement comment edit action
This implementation intentionally preserves all edits such that
they may be displayed in an application as an edit history.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-16 12:32:20 +01:00
Alexis Sellier cc942024ce Make Doc type payload generic 2022-12-09 22:05:38 +01:00
xphoniex 0b138f2c0c httpd: Use HashSet instead of BTreeSet
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-09 10:49:28 +01:00
xphoniex a40d53743d httpd: Conform response from issue handlers to previous model
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-09 10:49:09 +01:00