Radish alpha
r
rad:z2UcCU1LgMshWvXj6hXSDDrwB8q8M
Radicle Job Collaborative Object
Radicle
Git
Could `rad job show` be made to also understand a job COB id?
Open levitte opened 8 months ago

I have a use cases:

The Radicle inbox gets a short notification for a job COB, like this (this is in heartwood):

$ rad inbox show 2012
{
  "Cob": {
    "id": "7e688acc3cd75cbbe3f82ff7cd4ddbca1a5a1b0a",
    "type_name": "xyz.radworks.job"
  }
}

However, it turns out that the id that’s shown isn’t a commit id:

$ rad job show 7e688acc3cd75cbbe3f82ff7cd4ddbca1a5a1b0a
ERROR: no job was found for the commit 7e688acc3cd75cbbe3f82ff7cd4ddbca1a5a1b0a

My suggestion is to have rad job show figure out if the given id is a commit id or a job COB id, and to display the associated job COB in both cases.

levitte commented 8 months ago

Of course there’s a workaround, but I hope you agree that it’s… a tad cumbersome:

$ rad job show $(JID=$(rad inbox show 2012 | jq -r .Cob.id); rad job list | jq -r '.jobs.[] | select(.job_id == "'$JID'") | .oid')
{
  "job_id": "7e688acc3cd75cbbe3f82ff7cd4ddbca1a5a1b0a",
  "oid": "881fe12072cea5faeecd7c66f0bf08a9898c0c20",
  "runs": [
    {
      "node_id": "z6MkkYez6QAFWvmdudjrfMXySu1NTpSrraJotCJFwGgkmgx8",
      "runs": [
        {
          "run_id": "87a1bdf3-178c-49a9-b057-50afb8b47530",
          "status": {
            "Finished": "Failed"
          },
          "log": "https://ci0.liw.fi//ambient-log/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/dc2b1453-a222-4bfa-b04f-3f36a878cbfa.html"
        }
      ]
    }
  ]
}