Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Use UUID for Trigger Event IDs #901

Closed
wlynch opened this issue Jan 14, 2021 · 3 comments · Fixed by #926
Closed

Proposal: Use UUID for Trigger Event IDs #901

wlynch opened this issue Jan 14, 2021 · 3 comments · Fixed by #926
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@wlynch
Copy link
Member

wlynch commented Jan 14, 2021

Short proposal I wanted to get feedback on before making a change.

Currently we generate Event IDs similar to generateName by randomly generating a 5 character string to associate to the event. While this has worked so far, we might find that the current 5 character solution isn't sufficient in the future, particularly if/when we start recording events that don't result in runs.

Instead of slowly growing the Event ID over time, I think we should switch over to UUIDs for Event ID generation. This is how k8s objects generate UIDs, and would be a fairly straight forward change for us since we treat these IDs as opaque strings today.

Let me know if anyone has any objections!

@dibyom dibyom added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 15, 2021
@dibyom
Copy link
Member

dibyom commented Jan 15, 2021

Sounds reasonable to me!

@MarcelMue
Copy link
Member

Sounds reasonable - some notes:

  • Is the current ID used in any length limited fields (e.g. name)? Following RFC4122 we would have 36 characters instead of 5
  • Do we expect the hyphens in the UUID to have any impact? It shouldn't in k8s but I am not sure where this ID is currently used
  • I would like to introduce more debug logging in triggers, logging the full UUID might be very spammy. There are multiple solutions to shorten UUIDs for that purpose. We should at least think about it.

@afrittoli
Copy link
Member

We used to have $(uid) in resource names in trigger templates - we still do in the getting started, which with the new uid is not possible, as the resource name becomes too long:

{"level":"error","logger":"eventlistener","caller":"sink/sink.go:237","msg":"couldn't create resource with group version kind \"tekton.dev/v1beta1, Resource=taskruns\": admission webhook \"validation.webhook.pipeline.tekton.dev\" denied the request: validation failed: Invalid resource name: length must be no more than 63 characters: metadata.name","knative.dev/controller":"eventlistener","/triggers-eventid":"06887615-0494-4714-93eb-1e79662ad218","/trigger":"tekton","logging.googleapis.com/labels":{},"logging.googleapis.com/sourceLocation":{"file":"github.com/tektoncd/triggers/pkg/sink/sink.go","line":"237","function":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger"},"stacktrace":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:237\ngithub.com/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\tgithub.com/tektoncd/triggers/pkg/sink/sink.go:125"}

I think new UUID should be introduced as an opt-in, otherwise the new release will break many templates.

dibyom added a commit that referenced this issue Feb 2, 2021
Since $(uid) is now a UUID, this will create names that are too long.
See #901 (comment)
tekton-robot pushed a commit that referenced this issue Feb 2, 2021
Since $(uid) is now a UUID, this will create names that are too long.
See #901 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants