Commit Graph
1093 Commits
Author SHA1 Message Date
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
Alexis Sellier 94cd7658b1 cli: Merge patches on git push
Allows patches to have their state updated to `Merged` with a `git push`
to the default branch.

Currently, due to the limitations of the COB store, this requires a
linear search through all patches. This will eventually become a problem
when projects have thousands of patches, so we should look into
long-term solutions.
2023-05-16 21:11:57 +02:00
Alexis Sellier c267ff71f1 remote-helper: Don't update patch if up-to-date
If the patch has a revision with a matching commit, there's no need to
update it again.
2023-05-16 21:11:57 +02:00
Alexis Sellier a1674600e9 cli: Fix merge commit oid
We were storing the commit *before* the merge in the COB, instead of
storing the commit *after* the merge.
2023-05-16 21:11:57 +02:00
xphoniex ae5982cd6b httpd: Add alias field to certain routes
* `/patches`, `/issues`, `/remotes`

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-05-16 12:40:07 +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
Alexis Sellier 8202495e24 cli: Rework rad sync command
By default, `rad sync` will both fetch and announce now.

To only fetch or only announce, the `--fetch` or `--announce` flags
can be used.
2023-05-15 15:34:45 +02:00
Adam Szkoda fc951b82c6 ci: Update latest symlink only if build succeeded 2023-05-15 12:27:33 +02:00
Alexis Sellier f72b448114 cli: Fix rad patch show with merged patches
We were not correctly calculating the base commit. Simply
using the latest revision base does the job for now.
2023-05-15 12:22:09 +02:00
Alexis Sellier a9c0152a99 cli: Use library for updating patch
Also improves the message from a bare revision id.
2023-05-15 12:22:09 +02:00