Commit Graph

1251 Commits

Author SHA1 Message Date
cloudhead 1b9906db09
Remove `radicle-tui` crate
This crate is now in its own repository:

  rid:z39mP9rQAaGmERfUMPULfPUi473tY
2023-08-08 16:31:25 +02:00
cloudhead b456d3a401
Prepare crates for publishing to `crates.io` 2023-08-07 11:31:11 +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 0974a4a164
Cleanup .gitignore 2023-08-04 12:50:08 +02:00
Slack Coder 0141313b35
cli: Refactor git diff encoding
Move code for writing radicle_surf diff's in git's unified diff format
into its own module.  Lean on the type system by defining a
`UnifiedDiff` trait to provide a method `encode` to encode to the
format and another default method to convert to a git 'unified' diff
string.

Additionally a `Header` struct is added to support processing Unified
Diff files.  The Header's line numbers must be tracked and modified to
produce legal diff files.

This is in preparation for DDiff support.  Upcoming improvements will
include parse unified diff's into these types to support test data.
2023-08-04 12:45:53 +02:00
Slack Coder 6ed3ab914d
cli: Vanity update for review
Reduce duplicate hard to read code by using a closure.
2023-08-04 12:44:28 +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 6b143f5f8f
term: Some updates to the spinner code
This ensures we don't output progress messages on a non-TTY.
2023-08-04 12:23:58 +02:00
cloudhead c30f137bb1
cli: Add `--timeout` and `--count` to `node events` 2023-08-04 12:23:58 +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
cloudhead aea7fb0e42
scripts: Fix delete-remote-branches script
We were deleting patch branches, oops.
2023-08-04 12:19:27 +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 df5c8c7d4f
docker: Make Dockerfile easier to read
Avoid long lines by separating commands and arguments with '\'.
2023-08-03 13:43:20 +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
Vincenzo Palazzo f91ef2963e
cli: Fix partial matching for the --seed flag
This commit addresses the inconsistent parsing of the command by fixing the
partial matching behavior for the `--seed` flag. Previously, specifying
the seed value resulted in an invalid option error, as shown in the example below:

```
➜ ~ rad sync --seed z6MksmpU5b1dS7oaqF2bHXhQi1DWy2hB7Mh9CuN7y1DN6QSz
✗ Error: rad sync: invalid option '--seed'
```

With this fix, there are no restrictions on when the seed can be specified.

In a future change, we plan to implement a custom error message when a
match case does not meet specific requirements, such as `rad --fetch --announce`,
which will return a more informative error message. However, this
enhancement is left for a derived solution.

```
➜  ~ rad sync --fetch --announce
✗ Error: rad sync: invalid option '--announce'
```

Fixes: d6cebf613f
Suggested-by: Slack Coder
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-08-03 13:34:23 +02:00
Sebastian Martinez f418b5268c
httpd: Add socketAddress to `/node` endpoint
This allows us in the web client to show and let user copy the node id
together with the correct port number

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-08-03 13:30:55 +02:00
cloudhead d0fdd0b6a3
cli: Make `rad patch checkout` idempotent
Fixes an error when you checkout an already checked out patch.
2023-08-02 11:17:16 +02:00
Alexis Sellier b953e9f6b5
node: Use `camelCase` for control socket data
It's easier if we use camel-case everywhere, because some types may be
used on the web as well as on the control socket. This way, all
json-encoded data looks the same.
2023-08-01 15:48:44 +02:00
Alexis Sellier 8a3133e137
node: Include addresses in `Command::Seeds` result
This will allow the CLI to connect to seeds on the go.

We also do some refactoring of some of the code involved in fulfilling
the `Seeds` command.
2023-08-01 15:48:44 +02:00
Alexis Sellier 26e3c0fbff
Use numbers for `LocalTime` timestamps
Instead of using strings, use numbers.

*This is a breaking change and affects `config.json` parsing.*

To upgrade, simply unquote any number in your `config.json`.
2023-08-01 15:47:02 +02:00
Alexis Sellier 693f0a2c44
node: Some small UX fixes
Fixes an error which said "invalid argument" the first time the node was
started.
2023-08-01 14:55:20 +02:00
Alexis Sellier 62aaec5f53
node: Delay logging until after version print
Previously we would show some logs before printing the version.
This fixes it.
2023-08-01 14:55:20 +02:00
Alexis Sellier 85b092872d
node: Support DNS address types at the wire level 2023-08-01 14:55:20 +02:00
Alexis Sellier 70e199dd09
node: Fix CLI help message
It was not accurate.
2023-08-01 14:55:20 +02:00
Alexis Sellier f823916ea4
term: Prepare for crate publishing 2023-07-31 14:13:50 +02:00
Alexis Sellier 0acf5fe900
Add a few common/useful files to .gitignore 2023-07-31 14:06:47 +02:00
Sebastian Martinez 7368e38942
radicle: Disable canonicalize_home tests on macos
We were doing a workaround stripping prefixes, but I think it makes more
sense to skip the test all together.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 1241bbb4e8
docs: Replace deprecated `--all` flag with `--workspace`
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 3366535c9d
rad: Disable tests that use `sed` on macos
Due to differences between how BSD sed and GNU sed work, we disable for
now tests that use sed on macos

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:23:15 +02:00
Sebastian Martinez 5cb4d5cd76
httpd: Add commit parents vector to `/commits/:sha` endpoint
So we can act upon the eventual parents of a commit, after fetching a
single commit we need to have the parents of that commit as part of the
json payload.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-26 13:21:31 +02:00
Alexis Sellier 41bff1b3bb
node: Make user connections persistent
While the node is running, connections made via the `Connect` command
should be retried.
2023-07-26 12:52:11 +02:00
Alexis Sellier 840fc496b8
node: Simplify control socket command parsing
Instead of using a command name plus arguments, we use a new `Command`
enum that is similar to the one in `radicle_node::service`. This way,
we're able to have more complex commands and parsing is simplified.
2023-07-26 12:35:55 +02:00
Alexis Sellier 60cc0a8d01
crypto: Improve error for missing passphrase 2023-07-26 12:35:55 +02:00
Alexis Sellier de381cb378
docker: Add `$USER` env var to docker-compose
This ensures the variable is set and can be used as a default for the
node alias.
2023-07-26 12:35:55 +02:00
Alexis Sellier f639192dc6
cob: Remove CRDTs from COB state
It turns out that the CRDT formed by the union of Git DAGs
is enough to guarantee everything we need for COBs.

This changes the following things:
* COB operations no longer need to be commutative
* COB histories are traversed in the same deterministic order on all
  replicas
* It's now possible to implement RSMs on top of COBs, eg. scripting
* Lamport clocks have been removed
* `radicle-crdt` is no longer a dependency of `radicle`
* COBs are no longer instances of `Semilattice`
* The `Ops` type was removed in favor of having `Op` contain multiple
  actions
2023-07-25 15:29:27 +02:00
xphoniex 8a61aece01
httpd: Add a cache for `/tree`
This improves response time of:

- GET /api/v1/projects/<RID>/tree/<OID>/ from 205.71ms down to 376.4µs
- GET /api/v1/projects/<RID>/tree/<OID>/.nix from 111.06ms down to 351.70µs

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-25 13:10:58 +02:00
Vincenzo Palazzo b1f174817c
tui: Fix code format issue
During the testing of my CI proposal code, I discovered that our current
master branch is not building correctly.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-07-25 12:55:05 +02:00
Andrew Cann 49765c961e
Add @canndrew to .gitsigners 2023-07-25 12:51:48 +02:00
Sebastian Martinez 0e0ff38ff7
httpd: Fix commit count in repo stats in history route
Instead of using always the repo HEAD for the commit count with
`repo::stats` we should use `repo::stats_from` and pass the `parent`
commit.

This way we allow e.g. a commit history for a peer with lesser commits
to be counted correctly.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-25 12:34:03 +02:00
Vincenzo Palazzo a41f67d9ef
radicle: Import the new SQLite library with bundled binary
This commit addresses a workaround previously implemented to
include the SQLite library bundled inside the binary.

The upstream have successfully merged the patch that implements this
solution [1], allowing us to safely incorporate it
into our codebase.

[1] Link to the merged patch: https://github.com/stainless-steel/sqlite/pull/71/files

Fixes: 431a389944
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-07-25 12:30:03 +02:00
xphoniex 4869fe26e2
Add `-h` flag to binaries
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-25 11:58:39 +02:00
Michail Zampetakis 0e54c4a293
cli: Fix rad-fetch readme link 2023-07-25 11:52:24 +02:00
Slack Coder 1edab8c9a6
cli: Select review target by Revision ID
Support testing the review system against real world data by accepting
a Revision ID.
2023-07-25 11:45:12 +02:00
Slack Coder 2a0643cf1c
cli: Vanity review.rs update
Absorb a nested `if .. else` block into the match statement.
2023-07-25 11:45:12 +02:00
Slack Coder fe00ed7ca7
cli: `rad issue list` open issues by default
Help the user by reducing the amount of output.  A user is generally
only interested in open issues.  The '--all' flag is provided to list
all issues.
2023-07-25 11:39:39 +02:00
Alexis Sellier 3119294367
Add `--version` flag to binaries
Help users confirm all their radicle binary versions by providing the
'--version' flag.

Move the print_version function to the radicle crate for use by the node
and remote-rad binaries, and remove tests to confirm the output format
as it is deemed redundant.

Co-Developed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-07-25 11:36:50 +02:00
Erik Kundt f24590afe2
tui: Implement container focus on issue page 2023-07-22 22:36:24 +02:00
Erik Kundt 3a7cef8cea
tui: Support container focus 2023-07-22 22:36:24 +02:00
Erik Kundt dcfd481424
tui: Sort issues by time and state 2023-07-22 22:34:51 +02:00