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

Switch to UUID for event IDs #926

Merged
merged 1 commit into from
Jan 26, 2021
Merged

Conversation

MarcelMue
Copy link
Member

@MarcelMue MarcelMue commented Jan 25, 2021

Changes

Switches the 5 character random string UIDs to RFC 4122 UUIDs.

Closes: #901

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

Change the event ID representation from a 5 character random string to a UUID. 

@tekton-robot tekton-robot added the release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. label Jan 25, 2021
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 25, 2021
// UID generates a random string like the Kubernetes apiserver generateName metafield postfix.
var UID = func() string { return rand.String(5) }
// UUID generates a Universally Unique IDentifier following RFC 4122.
var UUID = func() string { return uuid.New().String() }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have currently changed the naming everywhere from uid to uuid - I am not certain if this is really required.

uuid is more clear as to what it is.
uid is a less breaking change (and is the name k8s uses AFAIK).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @wlynch in case you have suggestions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - I'm leaning towards leaving things as uid based on your reasoning + so we don't have to bother with deprecation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done now - the change is not only very internal, renaming only the internal functions properly.

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up!

// UID generates a random string like the Kubernetes apiserver generateName metafield postfix.
var UID = func() string { return rand.String(5) }
// UUID generates a Universally Unique IDentifier following RFC 4122.
var UUID = func() string { return uuid.New().String() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - I'm leaning towards leaving things as uid based on your reasoning + so we don't have to bother with deprecation.

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 25, 2021
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels Jan 25, 2021
@MarcelMue
Copy link
Member Author

I am not aware of any docs which should be changed. None that I could find mention the ID structure.

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2021
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wlynch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2021
@tekton-robot tekton-robot merged commit 1066d18 into tektoncd:master Jan 26, 2021
@MarcelMue MarcelMue deleted the switch-uuid branch January 27, 2021 08:52
solsson added a commit to Yolean/ystack that referenced this pull request Mar 13, 2021
resulting from our use of $(uid) with tektoncd/triggers#926.

Long pod names work, but usability suffers. In particular with
tasks in a pipeline we no longer see the task name in kubectl watch.

For Dashboard it's also impractical because the pod name is the
headline of the taskrun page.

A solution could be based on generateName, like Triggers' PR 939.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Use UUID for Trigger Event IDs
3 participants