How about change taskid to task-name and runid to auto-increase number

current id:

  • runid: 0000001f0p639-0000000000015
  • taskid: 36e7f0e9-ead5-4907-82c2-94ab2e0e7996

we can see the seq generated in action.go: newRun recreateRun:

	// generate a new run sequence that will be the same for the run and runconfig
	seq, err := sequence.IncSequence(ctx, h.e, common.EtcdRunSequenceKey)
	if err != nil {
		return nil, err
	id := seq.String()

I’ve changed in my case: /user/sam/projects/fk-onemall.proj/runs/0000j/tasks/tsk.603fec4

  • the seq for runid, just got the last 5 chars.
  • the uuid for taskid, just with sha1 and get first 7 chars just like git commit sha1.

@huapox The unique identifier of a run and a task are their ID. What you’re asking is using something different in the agola-web uri (not related to agola gateway API) but I don’t see a great gain changing them to something different. Using the run number could be possible but will require an additional api and using the task name will make ugly urls since task names can be long with all the non “standard” chars URI escaped.

This won’t work: the last 5 chars of a run id are not enough to unique distinguish it (you need the full runid) and the sha1 (both full or truncated) of the task name isn’t reversible so we cannot retrieve the task id from it.