Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
http: Update radicle crate to v0.13.0
Open did:key:z6MkkfM3...sVz5 opened 1 year ago
16 files changed +63 -61 a34056b2 82ca7c3e
modified config/default.json
@@ -1,7 +1,7 @@
{
  "nodes": {
    "fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
-
    "apiVersion": "5.0.0",
+
    "apiVersion": "6.0.0",
    "defaultHttpdPort": 443,
    "defaultHttpdScheme": "https"
  },
modified http-client/lib/repo/commit.ts
@@ -142,23 +142,23 @@ const diffChangesetSchema = object({
});

const diffAddedChangesetSchema = diffChangesetSchema.merge(
-
  object({ state: literal("added"), new: diffFileSchema }),
+
  object({ status: literal("added"), new: diffFileSchema }),
);

const diffDeletedChangesetSchema = diffChangesetSchema.merge(
-
  object({ state: literal("deleted"), old: diffFileSchema }),
+
  object({ status: literal("deleted"), old: diffFileSchema }),
);

const diffModifiedChangesetSchema = diffChangesetSchema.merge(
  object({
-
    state: literal("modified"),
+
    status: literal("modified"),
    new: diffFileSchema,
    old: diffFileSchema,
  }),
);

const diffCopiedChangesetSchema = object({
-
  state: literal("copied"),
+
  status: literal("copied"),
  newPath: string(),
  oldPath: string(),
});
@@ -173,7 +173,7 @@ const diffCopiedWithModificationsChangesetSchema =
  );

const diffMovedChangesetSchema = object({
-
  state: literal("moved"),
+
  status: literal("moved"),
  newPath: string(),
  oldPath: string(),
  current: diffFileSchema,
modified radicle-httpd/Cargo.lock
@@ -854,9 +854,9 @@ dependencies = [

[[package]]
name = "git2"
-
version = "0.18.3"
+
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70"
+
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
dependencies = [
 "bitflags 2.5.0",
 "libc",
@@ -1129,9 +1129,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"

[[package]]
name = "libgit2-sys"
-
version = "0.16.2+1.7.2"
+
version = "0.17.0+1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
+
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
dependencies = [
 "cc",
 "libc",
@@ -1614,9 +1614,9 @@ dependencies = [

[[package]]
name = "radicle"
-
version = "0.12.0"
+
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "e8dd9d6612b6248f99f98c9e20e84649982e08bb9c35b0fff5aa521dd8f2970a"
+
checksum = "4a818569c11f1bac56f38b002d778ce8ec92e312024b9aebcd68bad5dee6a465"
dependencies = [
 "amplify",
 "base64 0.21.7",
@@ -1645,9 +1645,9 @@ dependencies = [

[[package]]
name = "radicle-cob"
-
version = "0.11.0"
+
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "36d8268661b22cec768bdf687aa9d98db2dcd9c8f974e8208f8658244074b539"
+
checksum = "d4fac94999d8ffb6e88674bee487b080b69bbc9fb1b439ebfa51481ede1a17b3"
dependencies = [
 "fastrand",
 "git2",
@@ -1664,9 +1664,9 @@ dependencies = [

[[package]]
name = "radicle-crypto"
-
version = "0.10.0"
+
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "fb86116dc5d9daa0d0b8e07fb71c9887d537b3fecebffc0cde6624b07176c711"
+
checksum = "d1d6a67969719841ad06049597006368eb4238ca63a02d20207654dfd1d2d6ad"
dependencies = [
 "amplify",
 "cyphernet",
@@ -1694,9 +1694,9 @@ dependencies = [

[[package]]
name = "radicle-git-ext"
-
version = "0.7.0"
+
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "7ba40f0288f73b9464c0f52c09261593777ed6f195ef3be6a12d8f8e920d7885"
+
checksum = "16d2e8a6292811e44388e6068fcaf1040401e1f6a7a58cf48cc121cf7453c19d"
dependencies = [
 "git-ref-format",
 "git2",
@@ -1771,9 +1771,9 @@ checksum = "db20136bbc9ae63f3fec8e5a6c369f4902fac2244501b5dfc6d668e43475aaa4"

[[package]]
name = "radicle-surf"
-
version = "0.21.0"
+
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "5fae23233ff8be809a822d923e93e56e5282179039b19f345f39f592c1ca0765"
+
checksum = "fb308c3989087f71e43d8c7a2737273fdc7fbcd3e6628af81a42f601ae64f314"
dependencies = [
 "anyhow",
 "base64 0.13.1",
@@ -1798,7 +1798,6 @@ dependencies = [
 "anstyle-query",
 "anyhow",
 "crossbeam-channel",
-
 "git2",
 "inquire",
 "libc",
 "once_cell",
modified radicle-httpd/Cargo.toml
@@ -24,7 +24,7 @@ path = "src/main.rs"
anyhow = { version = "1" }
axum = { version = "0.7.2", default-features = false, features = ["json", "query", "tokio", "http1"] }
axum-server = { version = "0.6.0", default-features = false }
-
base64 = "0.21.3"
+
base64 = { version = "0.21.3" }
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }
fastrand = { version = "2.0.0" }
flate2 = { version = "1" }
@@ -32,7 +32,8 @@ hyper = { version = "1.0.1", default-features = false }
lexopt = { version = "0.3.0" }
lru = { version = "0.12.0" }
nonempty = { version = "0.9.0", features = ["serialize"] }
-
radicle-surf = { version = "0.21.0", default-features = false, features = ["serde"] }
+
radicle-surf = { version = "0.22.0", default-features = false, features = ["serde"] }
+
radicle-term = { version = "0.10.0", default-features = false }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
thiserror = { version = "1" }
@@ -46,14 +47,11 @@ ureq = { version = "2.9", default-features = false, features = ["json"] }
url = { version = "2.5.0" }

[dependencies.radicle]
-
version = "0.12.0"
-

-
[dependencies.radicle-term]
-
version = "0.10.0"
+
version = "0.13.0"

[dev-dependencies]
hyper = { version = "1.0.1", default-features = false, features = ["client"] }
pretty_assertions = { version = "1.3.0" }
-
radicle-crypto = { version = "0.10.0", features = ["test"] }
+
radicle-crypto = { version = "0.11.0", features = ["test"] }
tempfile = { version = "3.3.0" }
tower = { version = "0.4", features = ["util"] }
modified radicle-httpd/build/build
@@ -66,6 +66,7 @@ main() {
      --build-arg SOURCE_DATE_EPOCH \
      --build-arg TZ \
      --build-arg LC_ALL \
+
      --build-arg GIT_HEAD=$rev \
      --build-arg RADICLE_VERSION=$version \
      --arch $ARCH --tag $image -f ./build/Dockerfile - <$gitarchive

modified radicle-httpd/src/api.rs
@@ -33,7 +33,7 @@ use crate::Options;

pub const RADICLE_VERSION: &str = env!("RADICLE_VERSION");
// This version has to be updated on every breaking change to the radicle-httpd API.
-
pub const API_VERSION: &str = "5.0.0";
+
pub const API_VERSION: &str = "6.0.0";

#[derive(Clone)]
pub struct Context {
modified radicle-httpd/src/api/json.rs
@@ -5,14 +5,12 @@ use std::path::Path;
use std::str;

use base64::prelude::{Engine, BASE64_STANDARD};
-
use radicle::cob::{CodeLocation, Reaction};
-
use radicle::patch::ReviewId;
use serde_json::{json, Value};

use radicle::cob::issue::{Issue, IssueId};
use radicle::cob::patch::{Merge, Patch, PatchId, Review};
use radicle::cob::thread::{Comment, CommentId, Edit};
-
use radicle::cob::{ActorId, Author};
+
use radicle::cob::{ActorId, Author, CodeLocation, Reaction};
use radicle::git::RefString;
use radicle::node::{Alias, AliasStore};
use radicle::prelude::NodeId;
@@ -139,8 +137,8 @@ pub(crate) fn patch(
                    patch_comment(id, c, aliases)
                }).collect::<Vec<_>>(),
                "timestamp": rev.timestamp().as_secs(),
-
                "reviews": patch.reviews_of(id).map(move |(id, r)| {
-
                    review(id, r, aliases)
+
                "reviews": rev.reviews().into_iter().map(move |(_, r)| {
+
                    review(r, aliases)
                }).collect::<Vec<_>>(),
            })
        }).collect::<Vec<_>>(),
@@ -191,10 +189,10 @@ fn merge(nid: &NodeId, merge: &Merge, aliases: &impl AliasStore) -> Value {
}

/// Returns JSON for a patch `Review` and fills in `alias` when present.
-
fn review(id: &ReviewId, review: &Review, aliases: &impl AliasStore) -> Value {
+
fn review(review: &Review, aliases: &impl AliasStore) -> Value {
    let a = review.author();
    json!({
-
        "id": id,
+
        "id": review.id(),
        "author": author(a, aliases.alias(a.id())),
        "verdict": review.verdict(),
        "summary": review.summary(),
modified radicle-httpd/src/api/v1/repos.rs
@@ -1087,7 +1087,7 @@ mod routes {
              "diff": {
                "files": [
                  {
-
                    "state": "deleted",
+
                    "status": "deleted",
                    "path": "CONTRIBUTING",
                    "diff": {
                      "type": "plain",
@@ -1123,7 +1123,7 @@ mod routes {
                    },
                  },
                  {
-
                    "state": "added",
+
                    "status": "added",
                    "path": "README",
                    "diff": {
                      "type": "plain",
@@ -1159,7 +1159,7 @@ mod routes {
                    },
                  },
                  {
-
                    "state": "added",
+
                    "status": "added",
                    "path": "dir1/README",
                    "diff": {
                      "type": "plain",
@@ -1202,6 +1202,11 @@ mod routes {
                }
              },
              "files": {
+
                "1dd5654ca2d2cf9f33b14c92b5ca9e1d21a91ae1": {
+
                  "id": "1dd5654ca2d2cf9f33b14c92b5ca9e1d21a91ae1",
+
                  "binary": false,
+
                  "content": "Hello World from dir1!\n",
+
                },
                "82eb77880c693655bce074e3dbbd9fa711dc018b": {
                  "id": "82eb77880c693655bce074e3dbbd9fa711dc018b",
                  "binary": false,
@@ -1212,11 +1217,6 @@ mod routes {
                  "binary": false,
                  "content": "Hello World!\n",
                },
-
                "1dd5654ca2d2cf9f33b14c92b5ca9e1d21a91ae1": {
-
                  "id": "1dd5654ca2d2cf9f33b14c92b5ca9e1d21a91ae1",
-
                  "binary": false,
-
                  "content": "Hello World from dir1!\n",
-
                },
              },
              "branches": [
                "refs/heads/master"
@@ -1504,7 +1504,7 @@ mod routes {
                "diff": {
                  "files": [
                    {
-
                      "state": "added",
+
                      "status": "added",
                      "path": "dir1/README",
                      "diff": {
                        "type": "plain",
modified radicle-httpd/src/test.rs
@@ -15,7 +15,7 @@ use radicle::cob::patch::MergeTarget;
use radicle::crypto::ssh::Keystore;
use radicle::crypto::{KeyPair, Seed, Signer};
use radicle::git::{raw as git2, RefString};
-
use radicle::identity::Visibility;
+
use radicle::identity::{project, Visibility};
use radicle::profile::{env, Home};
use radicle::storage::ReadStorage;
use radicle::{node, profile};
@@ -118,7 +118,7 @@ fn seed_with_signer<G: Signer>(dir: &Path, profile: radicle::Profile, signer: &G

    // rad init
    let repo = git2::Repository::open(&workdir).unwrap();
-
    let name = "hello-world-private".to_string();
+
    let name = project::ProjectName::from_str("hello-world-private").unwrap();
    let description = "Private Rad repository for tests".to_string();
    let branch = RefString::try_from(DEFAULT_BRANCH).unwrap();
    let visibility = Visibility::Private {
@@ -126,7 +126,7 @@ fn seed_with_signer<G: Signer>(dir: &Path, profile: radicle::Profile, signer: &G
    };
    let (rid, _, _) = radicle::rad::init(
        &repo,
-
        &name,
+
        name,
        &description,
        branch,
        visibility,
@@ -214,13 +214,13 @@ fn seed_with_signer<G: Signer>(dir: &Path, profile: radicle::Profile, signer: &G

    // rad init
    let repo = git2::Repository::open(&workdir).unwrap();
-
    let name = "hello-world".to_string();
+
    let name = project::ProjectName::from_str("hello-world").unwrap();
    let description = "Rad repository for tests".to_string();
    let branch = RefString::try_from(DEFAULT_BRANCH).unwrap();
    let visibility = Visibility::default();
    let (rid, _, _) = radicle::rad::init(
        &repo,
-
        &name,
+
        name,
        &description,
        branch,
        visibility,
@@ -294,13 +294,13 @@ fn seed_with_signer<G: Signer>(dir: &Path, profile: radicle::Profile, signer: &G

    // rad init
    let repo = git2::Repository::open(&workdir).unwrap();
-
    let name = "again-hello-world".to_string();
+
    let name = project::ProjectName::from_str("again-hello-world").unwrap();
    let description = "Rad repository for sorting".to_string();
    let branch = RefString::try_from(DEFAULT_BRANCH).unwrap();
    let visibility = Visibility::default();
    let (rid, _, _) = radicle::rad::init(
        &repo,
-
        &name,
+
        name,
        &description,
        branch,
        visibility,
modified src/views/repos/Changeset.svelte
@@ -22,8 +22,8 @@
  const diffDescription = (diffFiles: Diff["files"]): string =>
    Object.entries(
      diffFiles.reduce(
-
        (acc, { state }) => {
-
          acc[state]++;
+
        (acc, { status }) => {
+
          acc[status]++;
          return acc;
        },
        { added: 0, modified: 0, deleted: 0, copied: 0, moved: 0 },
@@ -109,7 +109,7 @@
            filePath={path}
            oldFilePath={"oldPath" in file ? file.oldPath : undefined}
            fileDiff={file.diff}
-
            headerBadgeCaption={file.state}
+
            headerBadgeCaption={file.status}
            content={"new" in file ? files[file.new.oid]?.content : undefined}
            oldContent={"old" in file
              ? files[file.old.oid]?.content
@@ -117,7 +117,7 @@
            visible={filesVisibility.has(path)} />
        {:else}
          <FileLocationChange
-
            headerBadgeCaption={file.state}
+
            headerBadgeCaption={file.status}
            oldPath={file.oldPath}
            newPath={file.newPath}
            {repoId}
modified src/views/repos/Changeset/FileDiff.svelte
@@ -28,7 +28,7 @@
  export let content: string | undefined = undefined;
  export let oldFilePath: string | undefined = undefined;
  export let fileDiff: DiffContent;
-
  export let headerBadgeCaption: ChangesetWithDiff["state"];
+
  export let headerBadgeCaption: ChangesetWithDiff["status"];
  export let revision: string | undefined = undefined;
  export let baseUrl: BaseUrl;
  export let repoId: string;
modified src/views/repos/Changeset/FileLocationChange.svelte
@@ -7,7 +7,7 @@
  import Link from "@app/components/Link.svelte";
  import FilePath from "@app/components/FilePath.svelte";

-
  export let headerBadgeCaption: ChangesetWithoutDiff["state"];
+
  export let headerBadgeCaption: ChangesetWithoutDiff["status"];
  export let newPath: string;
  export let oldPath: string;
  export let revision: string | undefined = undefined;
modified tests/e2e/node.spec.ts
@@ -22,7 +22,7 @@ test("node metadata", async ({ page, peerManager }) => {
  await page.goto(peer.uiUrl());

  await expect(page.getByText(shortNodeRemote).first()).toBeVisible();
-
  await expect(page.getByText("/radicle:1.0.0-rc.13/")).toBeVisible();
+
  await expect(page.getByText("/radicle:1.0.0-rc.16/")).toBeVisible();
});

test("node repos", async ({ page }) => {
modified tests/support/fixtures.ts
@@ -282,6 +282,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--message",
      "This is a multiline comment\n\nWith some more text.",
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 2),
  );
@@ -301,6 +302,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--reply-to",
      commentIssueOne,
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 3),
  );
@@ -318,6 +320,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--message",
      "A root level comment after a reply, for margins sake.",
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 4),
  );
@@ -376,6 +379,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--reply-to",
      commentPatchOne,
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 2),
  );
@@ -389,6 +393,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--reply-to",
      commentPatchOne,
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 3),
  );
@@ -414,6 +419,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
      "--reply-to",
      commentTwo,
      "--quiet",
+
      "--no-announce",
    ],
    createOptions(repoFolder, 5),
  );
modified tests/support/heartwood-release
@@ -1 +1 @@
-
1.0.0-rc.13

\ No newline at end of file
+
1.0.0-rc.16

\ No newline at end of file
modified tests/support/radicle-httpd-release
@@ -1 +1 @@
-
0.16.0

\ No newline at end of file
+
0.17.0

\ No newline at end of file