Commit Graph

1159 Commits

Author SHA1 Message Date
Alexis Sellier 63ff4717dc
cli: Implement hunk-based code review
Review code with an interface similar to `git add -p`.
2023-06-22 11:15:42 +02:00
Alexis Sellier 22360f8c25
radicle: Change review data in patch COB
* `CodeLocation` had a `blob` and `commit` field. These are redundant,
  since the review lives under a revision.
  We also change the line range to be diff-compatible, with an old and
  new range. The ranges are optional to account for different scenarios
  like file deletion, move etc.
* `CodeComment` had redundant getters which were removed in favor of
  public fields. We also remove the `timestamp` field, as it will be
  the same as the review timestamp.
2023-06-22 11:15:42 +02:00
Alexis Sellier d4e073fe4e
cli-test: Add easy file creation syntax
Eg. the following will create `FILE.txt`:

``` ./FILE.txt
Some content...
```
2023-06-22 11:15:42 +02:00
Alexis Sellier e700608095
Update `radicle-surf` 2023-06-22 11:15:42 +02:00
Alexis Sellier e325fa8621
cli: Turn `patch update` into a plumbing command
Remove most of the user-friendly functionality and simplify this command
so that it is only used for scripting.

`git push rad` is now the proper way of updating patches.
2023-06-21 17:02:00 +02:00
Alexis Sellier b25c2e452b
cli: Setup tracking branch on `rad patch checkout`
Just like when opening a new patch, we setup a tracking branch on patch
checkout, so that patches can be updated via a push.
2023-06-21 17:01:56 +02:00
Alexis Sellier 1e948485be
cli: Make some UX improvements to `rad auth`
Better errors, messaging etc.
2023-06-20 16:05:35 +02:00
Alexis Sellier 074b0e55c1
cli: Add user alias to `rad auth`
We were outputting `(me)` previously.
2023-06-20 15:45:14 +02:00
Adam Szkoda 8c701dc908
ci: Move shell scripts into standalone files 2023-06-20 13:16:57 +02:00
Alexis Sellier 9418a20cae
term: Ensure `Editor` gets a TTY
Some text editors don't work correctly if `stdin` is not a TTY device.
2023-06-20 12:18:23 +02:00
Alexis Sellier bb099faa4f
node: Give useful thread names
For the purposes of debugging running nodes, it's useful to know which
threads are doing what. This allows tools like `htop` to reveal which
threads are running.
2023-06-20 11:18:14 +02:00
Alexis Sellier 765823c686
node: Add timeouts to daemon connection 2023-06-16 09:42:34 +02:00
Alexis Sellier cb576cf8c3
cli: Allow setting a different patch base on push
Using `-o patch.base=<oid>`, users can specify a different patch base,
when creating or updating a patch.
2023-06-15 10:25:32 +02:00
Alexis Sellier a6782ac2d6
cli: Add `-v` flag to `rad patch show`
With this flag, additional data such as the patch base is shown.
2023-06-13 13:17:07 +02:00
Alexis Sellier 48f44f4af5
cli: Fix ahead/behind and diff behavior
In certain cases, eg. after a rebase, or when patches are stacked, the
"ahead/behind" and/or the diff stats can be wrong.

This fixes it.
2023-06-13 13:16:00 +02:00
Alexis Sellier ec064891cd
cli: Setup tracking branch on `rad remote add` 2023-06-13 11:09:42 +02:00
Alexis Sellier e9ef0f4aa4
cli: Consolidate working copy remote setup
We consolidate the setup done by `rad checkout`, `rad clone` and `rad
remote add`, so that they all check for node aliases, and are all
capable of setting up tracking branches etc.
2023-06-13 11:09:42 +02:00
Alexis Sellier 5502676aa7
Fixes and improvements to alias handling
* Return the correct alias from a node announcement, stripping '\0'
  bytes.
* Accept `AliasStore` types as references and as owned.
* Store a `null` in the database if the alias received is empty.
2023-06-13 11:09:42 +02:00
Alexis Sellier 50a97d9add
cli: Add `--scope` flag to `rad init`
Defaults to `all`.
2023-06-13 11:09:42 +02:00
Alexis Sellier 06566dac6f
cli: Add `--scope` flag for `rad clone`
This allows for a scope to be specified when cloning.

We also change the default scope when cloning to 'all' to more closely
match user expectations.
2023-06-13 11:09:42 +02:00
Erik Kundt df5cf4023b tui: Add detail widget to issue page 2023-06-08 22:08:05 +02:00
Erik Kundt 3b88e13e91 tui: Implement larger list on issue page 2023-06-08 22:05:35 +02:00
Erik Kundt c2b6fefb8e tui: Select correct list item on issue page 2023-06-08 21:55:00 +02:00
Erik Kundt dd16ed780e tui: Implement larger list on issue page 2023-06-08 21:54:57 +02:00
Erik Kundt 8e7d53aa9a tui: Fire proper list selection messages 2023-06-08 21:51:09 +02:00
Erik Kundt a3077d5b15 tui: Improve cob retrieval 2023-06-08 21:47:26 +02:00
Erik Kundt 0d652d78e9 tui: Make patch and issue items sortable 2023-06-08 20:42:30 +02:00
Erik Kundt 78344f8a9f tui: Use application context in widgets 2023-06-08 20:42:30 +02:00
Erik Kundt 0eb37431ff tui: Move application context to separate module 2023-06-08 20:42:30 +02:00
Alexis Sellier 64708954ca
cli: Remove redundant newline in patch message
There was an extra newline in the patch creation message due to not
accounting for commit messages with newlines at the end.

This is fixed and the tests are updated to be more realistic.
2023-06-08 16:47:30 +02:00
Alexis Sellier a3f8305eb4
node: Reduce test flakiness
Most of the test flakiness was caused by the git-daemon not being able
to bind to a port. It seems like using an RNG was not a good enough
solution.

After this change, tests seem to be passing without issue.
2023-06-08 16:44:04 +02:00
Alexis Sellier 0319bbb903
remote-helper: Don't allow opening an empty patch
If the commit range is empty, return an error.
2023-06-08 16:42:14 +02:00
Vincenzo Palazzo 431a389944
radicle: Use "bundled" sqlite dependency
Our build was faking the inclusion of SQLite and dynamically
linking it in the 'radicle' crate and other components.

This patch solves the following error and requires reinstallation
of the `radicle-cli`, `radicle-node`, and, if used, the `radicle-httpd`

```
✗ Sync failed: internal error: malformed database schema (node-policies) - near "strict": syntax error (code 11): malformed database schema (node-policies) - near "strict": syntax error (code 11)
```

Tested-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-06-08 15:08:22 +02:00
Alexis Sellier 3d803b2498
cli: Remove `rad patch open`
Remove this command in favor of the `git push` flow.

We also remove the `rad/patches` remote configuration which wasn't
working properly with `git fetch --all`.
2023-06-07 15:57:11 +02:00
Alexis Sellier 547fdcc03b
remote-helper: Create patch drafts via `git push`
This is now possible via the `-o patch.draft` push option.
2023-06-07 15:02:05 +02:00
Slack Coder 6bbdc574f0
cli: Use clearer format for string literals
Update the string literals in `rad patch` to use an easier to read
format.
2023-06-07 12:11:36 +02:00
Slack Coder 92648f934e
cli: Patch message from all commits
Help the user when creating a patch by listing the messages of all
commits associated with the patch in almost the same format as git uses
for squashing.
2023-06-07 12:11:33 +02:00
Vincenzo Palazzo 520fb61230
cli: Fix another issue with unspecified editor
This commit includes a fix for another occurrence of
the missing `EDITOR` variable. This time, it was
inside the `rad edit` command.

The fix is trivial, as it simply returns the error to the caller.

Co-Developed-by: Slack Coder <slackcoder@server.ky>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-06-07 11:58:15 +02:00
Michail Zampetakis 75139a6f02
cli: Fix help of the fork command 2023-06-07 11:52:46 +02:00
Slack Coder d335e1f3a5
cli: Use html comments for `rad comment`
Be consistent by using the same message style as 'rad patch' and 'rad
issue'
2023-06-07 11:50:54 +02:00
Slack Coder 16822ff84e
cli: Prevent weird `rad issue open` behavior
Verify special YAML strings '~' and 'null' are filtered out when
processing the input from the editor.

Serde replaces empty strings with their values causing an empty title to
become '~'.  Best to avoid them entirely and be transparent about it.

The solution is not meant to be long term.  This editor format for
getting issue data will be replaced in the near term.
2023-06-07 11:50:27 +02:00
Slack Coder 5d20316c57
cli: Fix accidental issue creation
When a user is creating an issue via the editor, it is very easy to
accidentally create an issue.

To fix this, make the default description also 'empty' and bail out if
either it or the title are empty.

Retain the default 'description' message by providing it as a comment.
2023-06-07 11:48:49 +02:00
Fintan Halpenny 5c3f3c65f9
nix: update toolchain
Update the nix toolchain to be on par with rust-1.70.0

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-06-07 11:44:44 +02:00
Alexis Sellier 91404e4c37
node: Fix regression on control socket delete
The removal of the control socket on shutdown was mistakenly taken out.
We add it back here.
2023-06-07 11:39:23 +02:00
Alexis Sellier ff7338de17
node: Always send node announcement on handshake
Previously, we only sent the announcement when there were external
addresses. But it contains other information like the node alias,
therefore we always send it.

Since the proof-of-work can be expensive to compute everytime, we add
the ability to load the local node announcement from the file system.

We also change the proof-of-work parameters so that they are relaxed
when running in debug mode, instead of when running tests.

Finally, we remove the boolean validation of the PoW. Instead, we store
the work per-node, in the database, to be used in the future in case of
DoS attacks or network congestion.
2023-06-07 11:39:23 +02:00
Alexis Sellier e86e061a12
remote-helper: Patch message option when pushing
Allows for setting a patch message during a push. Eg.:

    $ git push -o patch.message="My Title" -o patch.message="My description" \
      rad HEAD:refs/patches

Works the same way as the `-m` flag of `git commit`.
2023-06-07 11:37:39 +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
Slack Coder 65763a2ad2
cli: Enable redacting patch revisions
Use `rad patch redact <revision-id>` to redact (delete) a patch
revision.
2023-06-02 17:30:13 +02:00
xphoniex 13bea902b2
radicle: Create `Aliases` and use it in `httpd`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-06-02 14:50:49 +02:00