Commit Graph

1102 Commits

Author SHA1 Message Date
Alexis Sellier 97f122c451
cli-test: Build radicle binaries automatically
To avoid having to call `cargo build` before running the tests, we build
the necessary binaries automatically using the `escargot` crate.
2023-05-31 17:21:12 +02:00
Erik Kundt 21533f37eb tui: Add issue page with placeholder 2023-05-30 22:02:44 +02:00
Erik Kundt 56a61b61c9 tui: List issues 2023-05-30 21:30:19 +02:00
Alexis Sellier 5f731fad0e
dag: Improve trait bounds 2023-05-30 16:31:01 +02:00
Alexis Sellier b60569d3cb
cob: Test deterministic traversal order
We test to make sure that in the event of concurrent operations,
traversal order is deterministic.

This required some changes to the testing infrastructure. We're also
able to simplify the `Actor` type that now has redundant functionality.
2023-05-30 16:31:01 +02:00
Alexis Sellier 0e14dacb99
cob: Simplify graph evaluation
Simplify graph traversal and evaluation by building in some of the
functionality into `radicle-dag`, namely the pruning fold.

We avoid building vectors of graph nodes this way, and simply iterate
over the graph in one go.
2023-05-30 16:31:01 +02:00
Erik Kundt 0361ca3818 tui: Use table model in patch browser 2023-05-30 15:03:12 +02:00
Erik Kundt 0a673bc552 tui: Remove page state for patches 2023-05-30 15:03:12 +02:00
Erik Kundt d01028502e tui: Use table model for labeled container 2023-05-30 15:03:12 +02:00
Erik Kundt de6bb8fdb0 tui: Implement table item patches 2023-05-30 15:03:09 +02:00
Erik Kundt 5d7bf9f663 tui: Introduce table item and table model 2023-05-30 14:39:52 +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
Slack Coder 22c7945e7b
cli: Strip html comments 2023-05-30 10:34:36 +02:00
Erik Kundt a4be8f4fa9
tui: Consolidate widgets and components 2023-05-29 22:07:10 +02:00
Slack Coder 02f5596c05
cli: Add state filters for `rad issue list`
Allow filtering the issues by their state.
2023-05-29 19:50:33 +02:00
xphoniex c25450d310
httpd: Return `alias` field on `merges` of a patch
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-05-29 12:48:11 +02:00
Slack Coder 3af53626f0
cli: Reorder method arguments
Reorder the method arguments in the commands to make them consistent.
2023-05-29 12:42:55 +02:00
Slack Coder f2d4b9acc2
cli: Support `rad issue edit`
Support editing an issue via the command line.
2023-05-29 12:22:51 +02:00
Slack Coder 478b61f875
cli: Refactor `rad issue open`
Lift the issue editing logic into its own function.
2023-05-29 12:22:50 +02:00
xphoniex 15070c4074
httpd: Add author to revision of a patch
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-05-29 12:11:13 +02:00
Alexis Sellier 01ab91db86
cli: Fix sort order for patch listing 2023-05-29 12:02:59 +02:00
Alexis Sellier aa8394a838
cob: Make errors more consistent across COBs
Though these are perhaps not the final error types, we name them the same
across COBs and have them work the same way.

All COB modules now have a `Error` enum.

In a future change, we may want the `FromHistory` trait to support
multiple error types, eg. one for `apply` and one for `validate`.
2023-05-29 11:33:29 +02:00
Alexis Sellier eeaf380067
cob: Add validation step when loading COBs
This adds a simple `validate` function to COBs that is run on load. It
allows COBs to check whether they are valid, once all operations are
loaded, and return an error if not.
2023-05-29 11:27:04 +02:00
Alexis Sellier c400961cec
Update `io-reactor` and related dependencies 2023-05-27 20:43:56 +02:00
Alexis Sellier e6baeab0c9
cob: Guarantee there is always a latest revision
We change `Patch::latest` to always return something, because a patch is
malformed if it doesn't have at least one revision, and thus would not
load in the first place.

This also implies that there is a latest revision in the face of
concurrent updates.

Note that currently, traversal order for concurrent updates is still random.
This will be fixed in another patch.
2023-05-26 10:31:00 +02:00
Alexis Sellier 37d6c03026
radicle: Fix a documentation issue 2023-05-26 10:31:00 +02:00
Alexis Sellier e41d67544c
cob: Add `reviewers` field on `Patch`
We aren't ready to support this yet from an end-user perspective, but
we add it in the COB already to prepare.
2023-05-26 10:31:00 +02:00
Alexis Sellier ac60069a33
cob: Remove `description` from `Patch`
Since patches always have a "root" revision, use that revision's description
as the patch description.
2023-05-26 10:31:00 +02:00
Alexis Sellier e18f01cab4
radicle: Be more lenient when applying merge ops
Before this change, if a merge op referred to a commit that was not on
the default branch, the merge op and all descendant ops would be pruned.

This is a bad idea because the state of the default branch can change
*after* the merge op is created, which is out of the control of the
merge op author.

Therefore, instead of exiting, we keep processing ops (but ignore the
merge), in case the merge is invalid for this specific reason.
2023-05-25 11:29:54 +02:00
Alexis Sellier ac06e319cd
remote-helper: Delete patch branches after merge
This cleans up the branches that were created during patch open, when a
patch is merged.
2023-05-25 10:07:02 +02:00
Alexis Sellier 4722b9b417
scripts: Add `delete-remote-branches` script
This is useful for cleaning up remote branches that are no longer used.
2023-05-25 10:07:02 +02:00
Alexis Sellier 4176d62e38
remote-helper: Add `no-sync` push option
This is mainly useful for scripting, when for eg. you want to push
multiple things and sync only once, at the end.
2023-05-25 10:07:02 +02:00
Alexis Sellier 664aa570e6
node: Spawn a thread for each control connection
Previously, only one connection to the node control socket could be
handled at a time. This usually worked fine, but if one connection hangs
for whatever reason, no other process can access the node.
2023-05-24 11:33:55 +02:00
Alexis Sellier b8c2f2a647
node: Rename `InvalidPacketLine` error variant
In case of timeout on reading the packet-line, we would get this error.
It would be confusing, as the packet-line wasn't invalid, just never
received.
2023-05-24 11:33:55 +02:00
Alexis Sellier 366e61a053
cli: Improve error output of commands
Previously, we would sometimes get very repetitive error messages. This
change prevents that from happening.
2023-05-24 11:33:55 +02:00
Alexis Sellier 5fa677c5fb
node: Fix worker fetch deadlock
It turns out it's possible to create a deadlock when using
`child.wait()` with `Stdio::piped()`, if we don't read the output while
the child process is running. This is because the pipe has an internal
kernel buffer that will eventually fill up, causing the child process to
block on writing to stdout and never exit.

To remedy this situation, we read the stdout in a thread while the child
process is running.
2023-05-23 16:12:52 +02:00
Alexis Sellier 4bf15bf7ca
remote-helper: Don't use external command for sync
We use the library function which gives us more control over the output
and removes the need to create a sub-process.
2023-05-23 16:11:42 +02:00
Alexis Sellier cfc386ed0e
term: Add configurable output stream for `Spinner` 2023-05-23 16:11:42 +02:00
Alexis Sellier 45a4578724
cli: Move `announce` function to `node` library
This will be used in more than one place.
2023-05-23 16:11:42 +02:00
Alexis Sellier 8e89976937
cli: Verify merge, remove `rad merge` command
When applying a `Merge` action, we verify that the commit is in the
history of the default branch of that user.

Since this is not the case when issuing a `rad merge`, and since that
command is no longer needed with the push-based merge, we remove the
`rad merge` command completely.
2023-05-23 16:11:42 +02:00
Erik Kundt 376adde1f9
tui: Redraw on resize 2023-05-23 12:33:31 +02:00
Alexis Sellier 29507b550d
ci: Fix release pipeline for linux 2023-05-22 17:09:18 +02:00
Alexis Sellier 5a46ded318
node: Allow seed not to be connected on fetch
See code comment for explanation.
2023-05-22 15:30:27 +02:00
xphoniex 95e3b9673d
cli: Show alias on `rad issue` and `rad patch`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-05-22 15:13:28 +02:00
Adam Szkoda 216f48b7f1
ci: Build a debug binary of the CLI 2023-05-22 14:39:53 +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
Alexis Sellier 2d55ffba81
cob: Redesign merge state
Move `merges` from `Revision` to `Patch`, and key them by actor.

This ensures that only one merge is possible per actor. We also make
sure that only one revision can be merged at a time, and signal a
conflict if more than one revision is considered merged.

Finally, we make sure that merges have the same target-branch commit
to be considered equal.
2023-05-19 18:40:46 +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
Alexis Sellier 90237e8e9d
cli: Fix some tests that are no longer valid 2023-05-17 16:54:30 +02:00
Alexis Sellier 0c41de1433
term: Fix editor closing `stderr` stream 2023-05-16 21:11:57 +02:00