Commit Graph

179 Commits

Author SHA1 Message Date
cloudhead c94bd50666
cob: Better distinguish patch revisions
The `Patch` API and semantics are changed a little bit:

* It's now valid again to propose a revision without being the patch
  author.
* To get revisions by the patch author, `Patch::updates` is used.
* `Patch::latest` now only looks at revisions by the patch author.
* Added `Patch::revisions_by`, `Patch::authors` and `Patch::latest_by`.
* The merge behavior on git-push is improved to favor revisions that
  merge more recent commits. We also allow for merging the non-latest
  revision.
2023-09-21 13:51:55 +02:00
cloudhead 5078396028
cli: Move commenting to patch/issue commands
Instead of having `rad comment`, move the command to the respect COBs,
ie. `rad issue comment` and `rad patch comment`.
2023-09-19 14:33:40 +02:00
cloudhead 2c4e93b3d2
cli: Show issue comments
When `rad issue show` is run, the issue comments are shown by default.
This can be tweaked using the `--format` option. A value of "header"
only shows the header, while the default which is "full", shows the
header and comments.
2023-09-19 14:22:45 +02:00
cloudhead c903a958e7
cob: Implement action authorization
Add `authorization` functions to `Patch` and `Issue` COBs.

Co-authored-by: Arastoo Bozorgi <ab1502@mun.ca>
2023-09-09 18:31:52 +02:00
cloudhead 112c940d81
cli: Add tests for `rad publish` 2023-09-05 11:16:09 +02:00
cloudhead 45a2c05a9e
cli: Explain how to publish a repo on `rad init` 2023-09-05 11:16:09 +02:00
cloudhead 1acbe39340
cli: Adjust output of `rad sync` slightly 2023-09-05 11:16:09 +02:00
cloudhead ba5ed58997
cli: Show repo visibility in `rad ls` 2023-09-03 17:21:39 +02:00
cloudhead befc76e030
cli: Move `init` errors up so it fails sooner 2023-09-03 17:21:39 +02:00
cloudhead f2e74fdad2
cli: Choose repo visibility on init
This allows a user to choose private or public visibility on `rad init`.
It also improves the output to tell the user what happened due to this
choice.
2023-09-03 17:21:37 +02:00
cloudhead 4fb5f6c172
cli: Simplify fatal error output
It didn't make sense to get eg. `Patch failed` when listing patches
failed. We change all fatal errors to simply "Error:", giving more
control over the individual commands.
2023-09-01 15:17:41 +02:00
cloudhead 46b0dfb11c
cli: Improve `rad init` error when not in Git repo 2023-09-01 15:17:41 +02:00
cloudhead 6c5cba3ca6
cli: Improve patch and issue outputs
* Add author to `issue show`
* Improve author display with alias
* Fix consistency issues when printing authors
2023-09-01 12:26:43 +02:00
cloudhead a46057da1f
cli: Update `rad ls` to look like other commands
We render the output of `ls` as a bordered table, like other tabular
data in the CLI.
2023-09-01 12:26:41 +02:00
cloudhead e59e196da8
cli: Show repo summary on `rad clone`
After cloning, we show a cool little summary with some repo stats.

We had to make some adjustments to the way visual width is calculated
due to a bug surfaced around emoji width calculation. Unfortunately
there isn't a perfect solution that works across terminals yet, so the
"variation selector 16" code-point is filtered out for now.
2023-09-01 12:22:50 +02:00
cloudhead 0c43b05066
cli: Improve `rad node` output 2023-09-01 12:22:50 +02:00
cloudhead df0b5da559
cli: Improve node connection error 2023-09-01 12:22:50 +02:00
cloudhead 6fcdb95f0a
cli: Improve `rad init` help output 2023-09-01 12:22:50 +02:00
cloudhead 09a284f09c
node: Make fetch timeout configurable
When a fetch is user-requested, a timeout can be supplied that is passed
down to the worker.

When a fetch is service-requested, a default timeout is used.
2023-09-01 12:13:45 +02:00
cloudhead a1df6d3748
cli: Add private repo support to `rad sync`
We can't use `node::seeds` for private repos.
2023-09-01 12:13:45 +02:00
cloudhead 47f09e6ff4
cli: Don't test Git hints in test
These hints are not stable and change with different Git versions. We
ignore them in the test output.
2023-09-01 12:13:05 +02:00
cloudhead f282e09dce
cli: Fix test speed regression
These two tests were holding everything up.
2023-08-21 11:57:32 +02:00
cloudhead 9bc636ae6e
cli: Write test for merge commits with patches 2023-08-16 16:23:32 +02:00
cloudhead 38f326948f
cli: Improvements to `inspect` command
* Add `--delegates` option
* Add `--policy` option
2023-08-16 15:00:23 +02:00
cloudhead d973fd42f2
cli: Auto-connect on sync
This adds functionality so that on `rad sync` and `rad clone`, we
connect to known seeds if necessary, before attempting to fetch.

In passing, some related changes were made:

* The `rad sync` command's arguments were reworked:
  `--replicas <count>` can be used to specify a replica count when
    fetching
* The `rad patch` command no longer has a `--fetch` option
* It's now possible to tell the node not to automatically connect to
  peers in the background
* `AddressBook` is being used underneath `Seeds` to allow for shuffled
  iteration
2023-08-11 11:45:27 +02:00
cloudhead fae518bca2
node: Improve `rad node connect` feedback
Only return once the connection is established or failed.

It's still not perfect, as several failure scenarios are not handled,
but it's an improvement.
2023-08-09 12:49:15 +02:00
Alexis Sellier 3bd5589b1a
cob: Stabilize formats
> I'm going to be making a set of breaking changes to COBs in order to
stabilize the data formats. This is hopefully a one-time change that
bundles various breaking changes.

All COBs have been reworked: issue, patch, id.

The changes included are:

* Revise the assign and tag actions to take a single list of
  assignees/tags to set, instead of an "add" and a "remove" list. This
  makes API usage simpler when editing issues, and simplifies the apply
  function
* Rename "tags" to "labels", and the tag action to label. This is
  because tag is confusing in the context of git, as it could mean a git
  tag. Using label removes that confusion.
* Use DIDs instead of PublicKeys for assignees -- this is more
  future-proof
* Modify the manifest file format in the COB tree. Mainly, remove the
  `history_type` key which is redundant, and use camelCase for keys
* Flatten the `Thread` actions into the parent action type
* Ensure that operations on redacted objects do not fail, since
  redactions could have happened concurrently
* Use a consistent naming scheme for actions, using `.` as separator
* Consolidate comment types and remove `CodeComment`, by adding an
  optional `location` field to `Comment`
* Add many placeholder actions that are not yet implemented

To preserve backwards compatibility, a `legacy` module is created with
the old `apply` function. When loading the manifest, we check whether it
is a legacy COB or a "stable" COB, and in the legacy case, use the
legacy code to materialize the state and then convert the object into
the stable type. Eventually, we'll delete the legacy code.
2023-08-07 11:05:14 +02:00
Alexis Sellier 885f4999da
remote-helper: Fix refs advertisement for patches
Some of the old patches had missing objects and that causes problems
during the ref advertisement, as the object is not found.

In this patch, we check that the object exists and also that the patch
is still open. Otherwise a remote tracking branch is created for every
single patch ref.
2023-08-06 17:29:21 +02:00
cloudhead 3898fece08
cli: `git pull` to update patches in working copy
We enable users to pull updates to a patch by calling `git pull`
on the patch branch.
2023-08-04 12:28:22 +02:00
cloudhead 2d79eecd66
cli-test: Update framework with new features
* Ability to switch between environments within the same test file
* Ability to expand env vars in `cd` command
2023-08-04 12:23:49 +02:00
Alexis Sellier 2ea9a911af
remote-helper: Handle patch update after merge
If you accidently merge updated patch code before updating the patch in
storage, you end up in this weird state where you can't update the patch
any longer. This fixes it.
2023-08-03 18:01:04 +02:00
Slack Coder 67a8ee9e86
cli: Remove rad-inspect `tree' dependency
Hard code output similar to the 'tree' command in rust to avoid having
to shell out.
2023-08-03 13:40:48 +02:00
Michail Zampetakis 0e54c4a293
cli: Fix rad-fetch readme link 2023-07-25 11:52:24 +02:00
Alexis Sellier edd70b701e
cli: Give hint on how to start node, when stopped
Also enable some tests that were disabled.
2023-07-20 10:40:24 +02:00
Alexis Sellier eb701be033
node: Make node aliases required
This is a fairly substantial change, which adds a new configuration file
to the user's `$RAD_HOME` that includes node configuration, including
the alias, and also makes node aliases required.

When running `rad auth`, the user is now prompted for an alias, which
defaults to `$USER`.

When running `rad self`, the alias is now shown.

If the user runs radicle without a config file, the defaults are loaded,
and `$USER` is used as the alias.
2023-07-11 18:08:59 +02:00
xphoniex 329ccbb304
cli: Add alias and check `rad patch` & `rad issue`
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-10 16:36:15 +02:00
xphoniex 37847d4c63
cli: Use `.aliases()` store for patches
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-10 16:36:15 +02:00
Alexis Sellier 1a1e63d998
node: Implement `sessions` command
Returns session information through the control socket.

We also update `rad node status` to display sessions.
2023-07-04 00:26:31 +02:00
Alexis Sellier f73389fc62
cli: Make `rad node connect` work like `--connect`
It was using a different syntax.
2023-07-04 00:26:31 +02:00
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 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 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