rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood313f23d01b601e74c8af59001d848c1212a266c0
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "442871f5d219dde66a54c0b28a0991f96af5ecce",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"title": "radicle: document `parse_ref` and `parse_ref_namespaced`",
"state": {
"status": "merged",
"conflicts": []
},
"before": "54551b117435a006acddefbf3850b02d6ee84ffa",
"after": "313f23d01b601e74c8af59001d848c1212a266c0",
"commits": [
"313f23d01b601e74c8af59001d848c1212a266c0"
],
"target": "d285eccb23f3986bfa88fc1af033e6dcb0dc3a65",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "442871f5d219dde66a54c0b28a0991f96af5ecce",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Provide better documentation for the two methods.\n\nSolves the issue:\n```\nrad inbox 4603f55d97a0776f37bae2f9d2ba7d455d8a4c83\n```",
"base": "54551b117435a006acddefbf3850b02d6ee84ffa",
"oid": "d6bda007b3f617adf250a78a7c2deab99cef0e09",
"timestamp": 1721646249
},
{
"id": "ab36be98535a055d07a1c6f772fec03909f0b0ad",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Changes:\n* Better explanation of example",
"base": "54551b117435a006acddefbf3850b02d6ee84ffa",
"oid": "313f23d01b601e74c8af59001d848c1212a266c0",
"timestamp": 1726479067
},
{
"id": "9ffc0aa5caf4cbb9213a084c371752326f4b7af0",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Rebase.",
"base": "87cb7bf52da9ea5def8fd6ba80703dbdf5104d21",
"oid": "65982434658b88f5d4ed4e93bef3964e7eb5b645",
"timestamp": 1736858057
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "4af924c5-ded5-41f8-8872-f65a1675de6e"
},
"info_url": "https://cci.rad.levitte.org//4af924c5-ded5-41f8-8872-f65a1675de6e.html"
}
Started at: 2026-09-07 21:02:10.129143+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/4af924c5-ded5-41f8-8872-f65a1675de6e/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 38 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 442871f5d219dde66a54c0b28a0991f96af5ecce
✓ Switched to branch patch/442871f at revision ab36be9
✓ Branch patch/442871f setup to track rad/patches/442871f5d219dde66a54c0b28a0991f96af5ecce
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 313f23d01b601e74c8af59001d848c1212a266c0
HEAD is now at 313f23d0 radicle: document `parse_ref` and `parse_ref_namespaced`
Exit code: 0
$ rad patch show 442871f5d219dde66a54c0b28a0991f96af5ecce -p
╭────────────────────────────────────────────────────────────────────────────────╮
│ Title radicle: document `parse_ref` and `parse_ref_namespaced` │
│ Patch 442871f5d219dde66a54c0b28a0991f96af5ecce │
│ Author fintohaps z6Mkire…SQZ3voM │
│ Head 313f23d01b601e74c8af59001d848c1212a266c0 │
│ Base 54551b117435a006acddefbf3850b02d6ee84ffa │
│ Target master │
│ Branches patch/442871f │
│ Commits ahead 1, behind 1253 │
│ Status merged │
│ │
│ Provide better documentation for the two methods. │
│ │
│ Solves the issue: │
│ ``` │
│ rad inbox 4603f55d97a0776f37bae2f9d2ba7d455d8a4c83 │
│ ``` │
├────────────────────────────────────────────────────────────────────────────────┤
│ 313f23d radicle: document `parse_ref` and `parse_ref_namespaced` │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision 442871f @ 54551b1..d6bda00 by fintohaps z6Mkire…SQZ3voM 2 years ago │
│ ↑ Revision ab36be9 @ 54551b1..313f23d by fintohaps z6Mkire…SQZ3voM 1 year ago │
│ ↑ Revision 9ffc0aa @ 87cb7bf..6598243 by cloudhead z6MksFq…bS9wzpT 1 year ago │
│ └─ ✓ merged by cloudhead z6MksFq…bS9wzpT │
╰────────────────────────────────────────────────────────────────────────────────╯
commit 313f23d01b601e74c8af59001d848c1212a266c0
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Mon Jul 22 11:59:25 2024 +0100
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
diff --git a/radicle/src/git.rs b/radicle/src/git.rs
index ee52d4edc..0d36484fa 100644
--- a/radicle/src/git.rs
+++ b/radicle/src/git.rs
@@ -424,7 +424,19 @@ pub fn remote_refs(url: &Url) -> Result<RandomMap<RemoteId, Refs>, ListRefsError
Ok(remotes)
}
-/// Parse a ref string. Returns an error if it isn't namespaced.
+/// Parse a [`format::Qualified`] reference string while expecting the reference
+/// to start with `refs/namespaces`. If the namespace is not present, then an
+/// error will be returned.
+///
+/// The namespace returned is the path component that is after `refs/namespaces`,
+/// e.g. in the reference below, the segment is
+/// `z6MkvUJtYD9dHDJfpevWRT98mzDDpdAtmUjwyDSkyqksUr7C`:
+///
+/// refs/namespaces/z6MkvUJtYD9dHDJfpevWRT98mzDDpdAtmUjwyDSkyqksUr7C/refs/heads/main
+///
+/// The `T` can be specified when calling the function. For example, if you
+/// wanted to parse the namespace as a `PublicKey`, then you would the function
+/// like so, `parse_ref::<PublicKey>(s)`.
pub fn parse_ref_namespaced<T>(s: &str) -> Result<(T, format::Qualified), RefError>
where
T: FromStr,
@@ -437,7 +449,21 @@ where
}
}
-/// Parse a ref string. Optionally returns a namespace.
+/// Parse a [`format::Qualified`] reference string. It will optionally return
+/// the namespace, if present.
+///
+/// The qualified form could be of the form: `refs/heads/main`,
+/// `refs/tags/v1.0`, etc.
+///
+/// The namespace returned is the path component that is after `refs/namespaces`,
+/// e.g. in the reference below, the segment is
+/// `z6MkvUJtYD9dHDJfpevWRT98mzDDpdAtmUjwyDSkyqksUr7C`:
+///
+/// refs/namespaces/z6MkvUJtYD9dHDJfpevWRT98mzDDpdAtmUjwyDSkyqksUr7C/refs/heads/main
+///
+/// The `T` can be specified when calling the function. For example, if you
+/// wanted to parse the namespace as a `PublicKey`, then you would the function
+/// like so, `parse_ref::<PublicKey>(s)`.
pub fn parse_ref<T>(s: &str) -> Result<(Option<T>, format::Qualified), RefError>
where
T: FromStr,
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name 4af924c5-ded5-41f8-8872-f65a1675de6e -v /opt/radcis/ci.rad.levitte.org/cci/state/4af924c5-ded5-41f8-8872-f65a1675de6e/s:/4af924c5-ded5-41f8-8872-f65a1675de6e/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/4af924c5-ded5-41f8-8872-f65a1675de6e/w:/4af924c5-ded5-41f8-8872-f65a1675de6e/w -w /4af924c5-ded5-41f8-8872-f65a1675de6e/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /4af924c5-ded5-41f8-8872-f65a1675de6e/s/script.sh
+ cargo --version
info: syncing channel updates for '1.77-x86_64-unknown-linux-gnu'
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.77.2 (e52e36006 2024-03-26)
+ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.77-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.77-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}