In https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z2UcCU1LgMshWvXj6hXSDDrwB8q8M/tree/src/lib.rs#L139, when we insert a new run to the list of runs for a job, radicle-job requires it to be a Uudi:
pub fn insert(&mut self, uuid: Uuid, run: Run) -> Option<Run> {
On its own, this is fine. The Radicle CI broker assigns a run ID that is a UUID. However, so far, that has been an internal implementation decision for the CI broker. Would it be OK for radicle-job to accept a string instead of a UUID here? If not, I can make the internal implementation decision be an API promise to make sure to stay compatible with radicle-job. It feels important that the CI broker and the COB use the same identifier for a CI run. If they’re not, it will be difficult to programmatically identify which COB refers to which CI run.
I note that being a UUID doesn’t guarantee uniquess, when the same UUID can be reused, so changing it to String doesn’t seem like a significant loss in uniqueness to me.
Ya, so I thought that
Uuidwould be a common identifier for aRun, but I’m happy to change this. Perhaps it can be made generic so that implementors of differentJobs can decide what identifier they are using. Maybe this boils down toString, but I’d prefer let implementors decide what type they use for their own type safety benefits.The only constraints for the keys is to be
Hash + Eqfor the underlyingIndexMap.Tecnically,
radicle-ci-brokerdefinesRunId(in itssrc/msg.rs) as:When
radicle-ci-brokerinvents a new ID, it creates a UUIDv4 and turns that into a string:Uuid::new_v4().to_string()However, run IDs also come from the adapter, which may get them from anywhere, and there is no guarantee they are unique. Hence
StringinRunId.I could split “broker run ID” and “adapter run ID” to be separate types.
So I see three options:
radicle-jobkeepsUuid,radicle-ci-brokeronly gives-jobstrings that are fromUuid, so everything worksRunIdintoRunId(for adapters; type name can’t change without breakage) andBrokerRunIdwhich contains aUuidradicle-jobchanges to contain aStringDo you have preferences?