Commit Graph

344 Commits

Author SHA1 Message Date
Alexis Sellier 0f3212a1b2
cli: `rad self` improvements
* Add `--home` flag
* Organize the information better

Now looks like this:

    DID             did🔑z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
    └╴Node ID (NID) z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
    SSH             running (823)
    ├╴Key (hash)    SHA256:UIedaL6Cxm6OUErh9GQUzzglSk7VpQlVTI1TAFB/HWA
    └╴Key (full)    ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHahWSBEpuT1ESZbynOmBNkLBSnR32Ar4woZqSV2YNH1
    Home            [..]
    ├╴Storage       [..]/storage
    ├╴Keys          [..]/keys
    └╴Node          [..]/node
2023-06-30 14:41:00 +02:00
Alexis Sellier 613e3e5269
cli: Show logs after `rad node start`
When the node is started, we show the first few log lines.
2023-06-29 18:45:16 +02:00
Alexis Sellier 2e6c9827a9
cli: Show logs in `rad node status` 2023-06-29 18:01:49 +02:00
Alexis Sellier e32e28f8b4
cli: Implement `rad node stop` 2023-06-29 17:58:07 +02:00
Alexis Sellier 0d0d354d55
cli: Ask for passphrase upfront in `node start` 2023-06-29 15:02:08 +02:00
Alexis Sellier ba9c5997b7
cli: Add `rad node logs` sub-command
Prints the last `n` lines and follows the log.
2023-06-29 14:58:11 +02:00
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 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
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 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
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 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
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
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
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
Alexis Sellier 4652f309b4
Update to Rust 1.70 2023-06-02 14:40:44 +02:00
Slack Coder 1c9670b90f
cli: Fix `rad issue edit`
Make the `rad issue edit` subcommand accessible to users.
2023-06-01 14:00:33 +02:00
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
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
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
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
Alexis Sellier 01ab91db86
cli: Fix sort order for patch listing 2023-05-29 12:02:59 +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 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 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 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 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 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 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