Commit Graph

2183 Commits

Author SHA1 Message Date
Fintan Halpenny c2863c08ab radicle: extend emoji support
Extend the ranges of emojis that are supported, listed
[below](#new-emojis-supported).

To ensure that single `char` emojis are supported, the `emojis` crate
is added as a dev dependency, using it to check that a `Reaction` can
be constructed for the two groups `SmileysAndEmotion` and
`PeopleAndBody`.

### New Emojis Supported

'🩵' 0x1FA75
'🩶' 0x1FA76
'🩷' 0x1FA77
'🫀' 0x1FAC0
'🫁' 0x1FAC1
'🫂' 0x1FAC2
'🫃' 0x1FAC3
'🫄' 0x1FAC4
'🫅' 0x1FAC5
'🫆' 0x1FAC6
'🫠' 0x1FAE0
'🫡' 0x1FAE1
'🫢' 0x1FAE2
'🫣' 0x1FAE3
'🫤' 0x1FAE4
'🫥' 0x1FAE5
'🫦' 0x1FAE6
'🫨' 0x1FAE8
'🫩' 0x1FAE9
'🫰' 0x1FAF0
'🫱' 0x1FAF1
'🫲' 0x1FAF2
'🫳' 0x1FAF3
'🫴' 0x1FAF4
'🫵' 0x1FAF5
'🫶' 0x1FAF6
'🫷' 0x1FAF7
'🫸' 0x1FAF8
2025-04-10 15:18:31 +02:00
Lorenz Leutgeb a9a4aac322
docs, cli: Mention feedback, also via e-mail 2025-04-10 15:04:52 +02:00
Fintan Halpenny a723068246 cli: provide error context for ssh-agent connect
Provide more context to the ssh-agent error for easier debugging when `rad auth`.
fails.
2025-04-10 14:48:37 +02:00
Yorgos Saslis ffc86f8a96
build: ensure zigbuild install doesn't break reproducible build
In trying to rebuild the radicle 1.1.0 version now (2025-02-26), some months after 1.1.0 has been released, I see in my pipelines that the `cargo install cargo-zigbuild@0.19.3` instruction is now failing.

This is because `home@0.5.11` has been released and this *patch* version bump requires a newer version of rust (1.81) (0.5.9 was ok with 1.80). See https://github.com/rust-lang/cargo/issues/14944 for more details.

Adding `--locked` here prevents this issue from happening in the future.

Importantly: newer versions of other crates being picked up by cargo here means the build isn't bit-for-bit reproducible.

The error itself is:

```
[1/2] STEP 14/17: RUN curl -sSf -o zig.tar.xz         https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz &&     curl -sSf -o zig.tar.xz.minisig https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz.minisig &&     minisign -Vm zig.tar.xz -P RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U &&     xz -d -c zig.tar.xz | tar -x &&     mv zig-linux-x86_64-0.12.0/zig /usr/bin/zig &&     mv zig-linux-x86_64-0.12.0/lib /usr/lib/zig &&     cargo install cargo-zigbuild@0.18.3
Signature and comment signature verified
Trusted comment: timestamp:1713604063   file:zig-linux-x86_64-0.12.0.tar.xz     hashed
    Updating crates.io index
 Downloading crates ...
  Downloaded cargo-zigbuild v0.18.3
  Installing cargo-zigbuild v0.18.3
    Updating crates.io index
     Locking 83 packages to latest compatible versions
      Adding cargo-platform v0.1.9 (latest: v0.2.0)
      Adding cargo-zigbuild v0.18.3 (latest: v0.19.8)
      Adding cargo_metadata v0.18.1 (latest: v0.19.1)
      Adding dirs v5.0.1 (latest: v6.0.0)
      Adding dirs-sys v0.4.1 (latest: v0.5.0)
      Adding fs-err v2.11.0 (latest: v3.1.0)
      Adding getrandom v0.2.15 (latest: v0.3.1)
      Adding linux-raw-sys v0.4.15 (latest: v0.9.0)
      Adding redox_users v0.4.6 (latest: v0.5.0)
      Adding target-lexicon v0.12.16 (latest: v0.13.2)
      Adding thiserror v1.0.69 (latest: v2.0.11)
      Adding thiserror-impl v1.0.69 (latest: v2.0.11)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.14.1+wasi-0.2.3)
      Adding which v6.0.3 (latest: v7.0.2)
      Adding windows-sys v0.48.0 (latest: v0.59.0)
      Adding windows-targets v0.48.5 (latest: v0.53.0)
      Adding windows-targets v0.52.6 (latest: v0.53.0)
      Adding windows_aarch64_gnullvm v0.48.5 (latest: v0.53.0)
      Adding windows_aarch64_gnullvm v0.52.6 (latest: v0.53.0)
      Adding windows_aarch64_msvc v0.48.5 (latest: v0.53.0)
      Adding windows_aarch64_msvc v0.52.6 (latest: v0.53.0)
      Adding windows_i686_gnu v0.48.5 (latest: v0.53.0)
      Adding windows_i686_gnu v0.52.6 (latest: v0.53.0)
      Adding windows_i686_gnullvm v0.52.6 (latest: v0.53.0)
      Adding windows_i686_msvc v0.48.5 (latest: v0.53.0)
      Adding windows_i686_msvc v0.52.6 (latest: v0.53.0)
      Adding windows_x86_64_gnu v0.48.5 (latest: v0.53.0)
      Adding windows_x86_64_gnu v0.52.6 (latest: v0.53.0)
      Adding windows_x86_64_gnullvm v0.48.5 (latest: v0.53.0)
      Adding windows_x86_64_gnullvm v0.52.6 (latest: v0.53.0)
      Adding windows_x86_64_msvc v0.48.5 (latest: v0.53.0)
      Adding windows_x86_64_msvc v0.52.6 (latest: v0.53.0)
      Adding winsafe v0.0.19 (latest: v0.0.22)
 Downloading crates ...
  Downloaded anstyle v1.0.10
  Downloaded anstyle-query v1.1.2
  Downloaded cargo-platform v0.1.9
  Downloaded bitflags v2.8.0
  Downloaded cargo_metadata v0.18.1
  Downloaded is_terminal_polyfill v1.70.1
  Downloaded option-ext v0.2.0
  Downloaded scroll_derive v0.12.0
  Downloaded strsim v0.11.1
  Downloaded autocfg v1.4.0
  Downloaded anstream v0.6.18
  Downloaded camino v1.1.9
  Downloaded dirs-sys v0.4.1
  Downloaded heck v0.5.0
  Downloaded itoa v1.0.14
  Downloaded home v0.5.11
  Downloaded thiserror-impl v1.0.69
  Downloaded which v6.0.3
  Downloaded utf8parse v0.2.2
  Downloaded either v1.14.0
  Downloaded colorchoice v1.0.3
  Downloaded clap_lex v0.7.4
  Downloaded errno v0.3.10
  Downloaded dirs v5.0.1
  Downloaded fs-err v2.11.0
  Downloaded shlex v1.3.0
  Downloaded rustc_version v0.4.1
  Downloaded path-slash v0.2.1
  Downloaded thiserror v1.0.69
  Downloaded terminal_size v0.4.1
  Downloaded anstyle-parse v0.2.6
  Downloaded clap_derive v4.5.28
  Downloaded target-lexicon v0.12.16
  Downloaded fat-macho v0.4.9
  Downloaded semver v1.0.25
  Downloaded scroll v0.12.0
  Downloaded log v0.4.26
  Downloaded proc-macro2 v1.0.93
  Downloaded quote v1.0.38
  Downloaded anyhow v1.0.96
  Downloaded clap v4.5.31
  Downloaded ryu v1.0.19
  Downloaded serde_derive v1.0.218
  Downloaded unicode-ident v1.0.17
  Downloaded serde v1.0.218
  Downloaded memchr v2.7.4
  Downloaded serde_json v1.0.139
  Downloaded clap_builder v4.5.31
  Downloaded goblin v0.9.3
  Downloaded syn v2.0.98
  Downloaded rustix v0.38.44
  Downloaded libc v0.2.170
  Downloaded plain v0.2.3
  Downloaded cargo-options v0.7.5
  Downloaded linux-raw-sys v0.4.15
error: failed to compile `cargo-zigbuild v0.18.3`, intermediate artifacts can be found at `/tmp/cargo-installZ4q2vb`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  rustc 1.80.1 is not supported by the following package:
    home@0.5.11 requires rustc 1.81
  Try re-running `cargo install` with `--locked`
Error: building at STEP "RUN curl -sSf -o zig.tar.xz         https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz &&     curl -sSf -o zig.tar.xz.minisig https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz.minisig &&     minisign -Vm zig.tar.xz -P RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U &&     xz -d -c zig.tar.xz | tar -x &&     mv zig-linux-x86_64-0.12.0/zig /usr/bin/zig &&     mv zig-linux-x86_64-0.12.0/lib /usr/lib/zig &&     cargo install cargo-zigbuild@0.18.3": while running runtime: exit status 101
```

Signed-off-by: Yorgos Saslis <yorgos.work@proton.me>
2025-02-26 09:32:00 +02:00
Lorenz Leutgeb 3b5fac178e
crypto: RefCell instead of Mutex in Agent 2025-01-28 14:05:45 +01:00
Fintan Halpenny 62d000f7cb radicle: fix `parse_ref_*` documentation
The `parse_ref` and `parse_ref_namespaced` documentation used 4 space
indentation for the reference names. Unfortunately, `cargo test` attempts to
interpret this as code.

Use triple-backtick code fencing, with `text` and `no_run`, instead.
2025-01-16 11:08:35 +00:00
Fintan Halpenny ee0d19f2eb
man: make a note on draft patches
Include a note on making draft patches – whether via the remote helper, or via
the CLI – in the section on opening patches.
2025-01-14 14:05:21 +01:00
Fintan Halpenny 4cced3ddb8
cli: add remaining patch actions
Add the remaining `Patch` actions to the CLI interface. These include:

- React to a revision
- Edit a comment
- React to a comment
- Redact a comment

The `react` subcommand is added in a straight-forward manner.

The comment commands are slightly less straight-forward. In order to
keep to one layer of subcommands, these variants are done through the
`rad patch comment` subcommand. They are accessed via options:
`--edit`, `--react`, and `--redact`, respectively. Each of these
options takes the `CommentId` for which the action is affecting. The
`message`, `react` (introduced for `rad patch react`), and `undo`
variables repurposed for this subset of actions.
2025-01-14 14:00:57 +01:00
Lars Wirzenius 7d28d1e648
ci: don't build docs for depedencies
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-14 13:45:34 +01:00
Lars Wirzenius dfe89fb303
ci: only deny warnings, not all clippy lints
Change configuration of native CI to only deny warnings from the
compiler, but no all clippy lints.

Previously we ran "cargo clippy --all-targets --workspace -- --deny
clippy::all", which overrides the allows for specific clippy lints in
the source code. We don't want that.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-14 13:45:34 +01:00
Yorgos Saslis a1cd0e2fdc
cli: Add `--title` and `--description` edit option
These were missing, causing an `invalid option` error.

Signed-off-by: Yorgos Saslis <yorgos.work@proton.me>
2025-01-14 13:44:16 +01:00
Fintan Halpenny f0390e00d9
cli: print success to console on `rad issue state`
Indicate that the `rad issue state` operation was successful to the
user by printing a message to the console.

Solves:

    rad issue show 71020de8478b15b3f7a619f2f93d3cfb8771cde2
2025-01-14 13:41:13 +01:00
Fintan Halpenny ffbdabe432
cli: add comment edit for rad issue
Add the ability to edit an issue comment to the `rad issue` command.

This is achieved by adding an `--edit` option to `rad issue
comment`. Note that if `--reply-to` and `--edit` are both specified,
then this results in an error.
2025-01-14 13:39:09 +01:00
Sebastian Martinez 985987468d
radicle: add `list_by_status` method to `cob::issue::Issues`
Provides the same `list_by_status` and `<status>` methods that
`cob::patch::Patches` has to `Issues`
2025-01-14 13:36:14 +01:00
Sebastian Martinez 7c902b6905
radicle: Add `resolves` and `labels` method to `cob::patch::Revision`
To be able to query the `BTreeSet` that shows which comments are
resolved by a specific revision and the `Iterator` of `Label` we require
some methods to obtain them.
2025-01-14 13:34:38 +01:00
Fintan Halpenny 6598243465
radicle: document `parse_ref` and `parse_ref_namespaced`
Provide better documentation for the two methods.

Solves the issue:
```
rad issue show 4603f55d97a0776f37bae2f9d2ba7d455d8a4c83
```

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2025-01-14 13:34:13 +01:00
Leah Neukirchen 41c33901ff
radicle: use rlim_t when working with limits
rlimit values have different types on Linux and FreeBSD, as well as
64-bit and 32-bit platforms, so stick to the type rlim_t provided by the
libc crate.
2025-01-14 13:29:03 +01:00
Lars Wirzenius c8062bc4a7
docs: note that node logs may also be in the system journal
See https://radicle.zulipchat.com/#narrow/channel/369873-support/topic/I.20cannot.20access.20logs.20on.20a.20node/near/480509559

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-14 13:27:33 +01:00
Lars Wirzenius 4c82bb4c4e
radicle: add some documentation for node::events::Event
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-14 13:24:11 +01:00
Lars Wirzenius 2929146c49
radicle: clarify RefsAt description
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-14 13:22:51 +01:00
Sebastian Martinez b6cf6fea8d
cli: Fix `rad ls` help message
If the user wants to see all `seeded` repositories, we should tell them
to use the `--seeded` option instead of the `--all` option.

Since `--all` also shows repos that aren't being seeded.
2025-01-14 12:18:40 +01:00
Yorgos Saslis 87cb7bf52d
build: Update zig installation method
This simplifies the Dockerfile a little , as the zig package (0.12.0) is available on alpine 3.20
https://repology.org/project/zig/versions

parent image is also updated to current rust-toolchain

Signed-off-by: Yorgos Saslis <yorgos.work@proton.me>
2024-12-16 11:09:19 +01:00
cloudhead 87f6956e49
build: Fixes to release script 2024-12-16 11:08:27 +01:00
cloudhead d274b28ae0
scripts: Small fix to contributor count 2024-12-05 14:25:28 +01:00
Fintan Halpenny d9c76893a1
cli: bump version to 0.12.1 2024-12-04 12:47:00 +01:00
Fintan Halpenny 19bbdbca24
cli: fix syntax highlighting
There was mishap in updating the parameters of highlight configuration – so many
string types!

This is fixed by adding the correct `name` parameter, reusing the `language`
variable that is being matched on.
2024-12-04 12:47:00 +01:00
cloudhead 7ed72ec918
cli: Fix some clippy lints 2024-12-04 12:46:47 +01:00
Fintan Halpenny 61865b5b5a
cob: fix documentation
`no_run` will compile but not run the code. Use `ignore` instead, and also added
`rust` for syntax highlighting.
2024-12-04 12:40:40 +01:00
cloudhead 8e2fe6449e
scripts: Improve changelog script
* Add number of commits and contributors
* Default to the latest version tag as the "current"
2024-12-04 12:40:10 +01:00
cloudhead 5fe3d5a7ab
cli: Handle broken pipe in `cob show`
When piping the output in for eg. `head -n 1`, the `head` utility
might close down the pipe at some point, yielding a broken pipe error.
We catch that and simply return if that's the case.
2024-12-03 12:36:57 +01:00
Lorenz Leutgeb 7616dcb793
cli/cob: Output JSON Lines 2024-12-03 12:36:02 +01:00
Lorenz Leutgeb 8865b5596e
cli/cob: Allow showing multiple COBs at once 2024-12-03 12:12:50 +01:00
cloudhead 289e59bbfa
term: Bump version to 0.12.0 2024-12-02 13:03:25 +01:00
Lorenz Leutgeb b4f18f43d3
cli: Bump to 0.12.0 2024-11-29 16:31:52 +01:00
Lorenz Leutgeb 1fa1cafee9
cli: Update tree-sitter
Bump `tree-sitter` from 0.20 to 0.24 and replace `tree-sitter-toml` with
the fork `tree-sitter-toml-ng`.
2024-11-29 16:09:53 +01:00
cloudhead fd892d006f
Update `radicle` to 0.14 2024-11-29 15:25:09 +01:00
cloudhead 70f0cc354d
cob: Fix `serde` instances for `ObjectId`
The type now serializes the same as `Oid`.
2024-11-28 15:19:56 +01:00
Lorenz Leutgeb f58af8fef4
cli: Use `term::Table::header` where possible 2024-11-28 14:35:24 +01:00
cloudhead bcba8f5a21
scripts: Add `--from-version` to changelog script
This allows generating changelogs from eg. version 1.1 to 1.2 combining
any pre-releases.
2024-11-27 17:25:02 +01:00
cloudhead 47b200988c
cli: Fix `rad cob migrate` test 2024-11-27 10:19:51 +01:00
Arnaud Bailly 0ecdc76422
cli: Improve `rad node logs` error message
If the rad node is spawned by systemd there won't be any logs file
to read and `rad node logs` command will fail with the standard
error message from fs.
2024-11-27 10:19:04 +01:00
cloudhead 3ad84420bd
cli: Implement `rad cob migrate`
Adds the new `migrate` sub-command to migrate the COB database.
Checks for version when opening the COBs database and suggests the
command on out of date version.

Also adds the 2nd migration to the COBs cache, which updates the patch
JSON schema.
2024-11-22 21:27:45 +01:00
cloudhead 2d13591ec2
radicle: Fix flaky test `counts_by_repo` 2024-11-21 16:05:01 +01:00
Sebastian Martinez a7e96131ce
radicle: add notification count grouped by repo
While the total notification count and the notification count by repo
are needed, for most UIs users will want to see the total notification
count grouped by repo.

This new method will provide this without the need of checking all
possible repos to see if they have notifications.
2024-11-21 12:04:32 +01:00
Fintan Halpenny 259adf7dc2
cob: mutable stable time for testing
The `radicle-cob` crate provides a feature flag, `stable-commit-ids` to allow
for `Oid`s to remain stable for testing by always using the same author and
timestamp when creating commits.

This can be an issue when it interplays with COB related tests that are relying
on the ordering for the DAG walk. If the `Oid` values change and get re-ordered
then the test will fail. The DAG for COBs are now ordered via the `Oid` and
`Timestamp`.

In this change, a global timestamp is introduced that is initialised
per thread. The value is read, via `read_timestamp`, and can be
advanced using `with_advanced_timestamp` – while performing an action
that creates a new commit.
2024-11-18 16:11:44 +01:00
cloudhead cab56c1113
helper: Use the correct head when merging a patch
Fixes a bug where the wrong head would be used as part of the merge
action.

Use the head of the revision instead of the head of the canonical
branch.
2024-11-18 16:10:13 +01:00
Fintan Halpenny 91914d9345
radicle: improve quorum copy
The `no quorum found` error can be opaque and lead to a lot of confusion. It is
better to give more information for this error so that it leads to easier
debugging, since it can be quite a common warning/error.

Instead of a single error, there are two cases provided: `NoCandidates` and
`Diverging`, to capture the two different variants of errors that can occur.

`Display` implementations are provided for both to provide more information.
2024-11-18 12:32:44 +01:00
Fintan Halpenny e412168be3
node: do not fail on `set_head`
The failure to set a HEAD ref, due to quourum, during a fetch should not fail
the fetch entirely.

Instead, log the success and failure, or return an error in other cases.

In fact, any failure to set the head could have resulted in notifications not
being sent, nor caching to occur.
2024-11-18 12:32:40 +01:00
Fintan Halpenny 159d3fce93
dag: test contains
Test coverage for the `Dag::contains` method were not covered. Add tests for the
method to cover an empty and filled `Dag`.
2024-11-18 11:21:17 +01:00
cloudhead 6c8ee4330e
radicle: Implement migration callback mechanism
Add the ability to have native migrations and progress callback
functions in migration code for the COB cache.
2024-11-14 17:21:33 +01:00