payload: {"action":"created","issue":{"url":"https://api.github.com/repos/tektoncd/triggers/issues/50","repository_url":"https://api.github.com/repos/tektoncd/triggers","labels_url":"https://api.github.com/repos/tektoncd/triggers/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/tektoncd/triggers/issues/50/comments","events_url":"https://api.github.com/repos/tektoncd/triggers/issues/50/events","html_url":"https://github.com/tektoncd/triggers/issues/50","id":474729837,"node_id":"MDU6SXNzdWU0NzQ3Mjk4Mzc=","number":50,"title":"Add Support For Naming Modifiers","user":{"login":"vtereso","id":22847291,"node_id":"MDQ6VXNlcjIyODQ3Mjkx","avatar_url":"https://avatars2.githubusercontent.com/u/22847291?v=4","gravatar_id":"","url":"https://api.github.com/users/vtereso","html_url":"https://github.com/vtereso","followers_url":"https://api.github.com/users/vtereso/followers","following_url":"https://api.github.com/users/vtereso/following{/other_user}","gists_url":"https://api.github.com/users/vtereso/gists{/gist_id}","starred_url":"https://api.github.com/users/vtereso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtereso/subscriptions","organizations_url":"https://api.github.com/users/vtereso/orgs","repos_url":"https://api.github.com/users/vtereso/repos","events_url":"https://api.github.com/users/vtereso/events{/privacy}","received_events_url":"https://api.github.com/users/vtereso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-07-30T18:03:31Z","updated_at":"2019-07-31T20:21:49Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# Expected Behavior\r\nResources that are created by `TriggerTemplates` will clash if the names defined in the resources are static. Add some postfix/modifier (uuid/timestamp) to resources to prevent naming collisions.\r\n\r\n# Actual Behavior\r\nCurrently, nothing does this.\r\n\r\n# Additional Info\r\nIf all resources get an automatic and unknown name modifier (like a postfix), it will be impossible to refer to them from other resources. For this reason, it is important that the same mechanism that uniquely names resources also allows this (sort of uuid) to be exposed for usage throughout the `TriggerTemplate`.\r\n\r\nThis can be accomplished by exposing another interpolation variable within the `TriggerTemplate` or also extending the `TriggerTemplate` struct.\r\n\r\nFor example, a variable such as `${id}` (or any such name like `${unique}`) could be utilized throughout a `TriggerTemplate` as follows:\r\n```\r\napiVersion: tekton.dev/v1alpha1\r\nkind: TriggerTemplate\r\nmetadata:\r\n  name: simple-pipeline-template\r\n  namespace: default\r\nspec:\r\n  params:\r\n    - name: gitrevision\r\n      description: The git revision\r\n      default: master\r\n    - name: gitrepositoryurl\r\n      description: The git repository url\r\n    - name: namespace\r\n      description: The namespace to create the resources\r\n  resourcetemplates:\r\n    - apiVersion: tekton.dev/v1alpha1\r\n      kind: PipelineResource\r\n      metadata:\r\n        name: git-source${id.one}\r\n        namespace: ${params.namespace}\r\n        labels:\r\n            triggertemplated: true\r\n      spec:\r\n        type: git\r\n        params:\r\n        - name: revision\r\n          value: ${params.gitrevision}\r\n        - name: url\r\n          value: ${params.gitrepositoryurl}\r\n    - apiVersion: tekton.dev/v1alpha1\r\n      kind: PipelineRun\r\n      metadata:\r\n        name: simple-pipeline-run${id.two}\r\n        namespace: default\r\n        labels:\r\n            triggertemplated: true\r\n      spec:\r\n        pipelineRef:\r\n            name: simple-pipeline\r\n        trigger:\r\n          type: event\r\n        resources:\r\n        - name: git-source\r\n          resourceRef:\r\n            name: git-source${id.two}\r\n```\r\nIn this way, some interpolation base (like `${id}`) would have fields that could be implicitly referenced throughout the template (maybe as valid [here](https://github.com/tektoncd/triggers/blob/master/pkg/parse/validate.go#L17)). In any case, this is similar to how `${params}` is functioning.\r\n\r\nTo be more explicit, we could add another `TriggerTemplateSpec` field like Params where users would specify exactly what unique field names they want to expose. For example:\r\n```\r\nspec:\r\n  params:\r\n    - name: gitrevision\r\n      description: The git revision\r\n      default: master\r\n    - name: gitrepositoryurl\r\n      description: The git repository url\r\n    - name: namespace\r\n      description: The namespace to create the resources\r\n  id:\r\n    - idOne\r\n    - idTwo\r\n```\r\nThese are not functionally surfaced to the `TriggerBinding` however, so maybe creating explicit fields is annoying and verbosity isn't good/as valuable?\r\n\r\nThis could also be done in a similar way, but instead of providing access to some randomly generated variable that is used for naming, resources names could be automatically modified and resources themselves (which still functionally evaluates to their name) could have some identifier to be used within the template. Regarding the prior example, it could look something like this:\r\n```\r\napiVersion: tekton.dev/v1alpha1\r\nkind: TriggerTemplate\r\nmetadata:\r\n  name: simple-pipeline-template\r\n  namespace: default\r\nspec:\r\n  params:\r\n    - name: gitrevision\r\n      description: The git revision\r\n      default: master\r\n    - name: gitrepositoryurl\r\n      description: The git repository url\r\n    - name: namespace\r\n      description: The namespace to create the resources\r\n  resourcetemplates:\r\n    - apiVersion: tekton.dev/v1alpha1\r\n      kind: PipelineResource\r\n      metadata:\r\n        name: git-source\r\n        namespace: ${params.namespace}\r\n        labels:\r\n            triggertemplated: true\r\n      spec:\r\n        type: git\r\n        params:\r\n        - name: revision\r\n          value: ${params.gitrevision}\r\n        - name: url\r\n          value: ${params.gitrepositoryurl}\r\n    - apiVersion: tekton.dev/v1alpha1\r\n      kind: PipelineRun\r\n      metadata:\r\n        name: simple-pipeline-run\r\n        namespace: default\r\n        labels:\r\n            triggertemplated: true\r\n      spec:\r\n        pipelineRef:\r\n            name: simple-pipeline\r\n        trigger:\r\n          type: event\r\n        resources:\r\n        - name: git-source\r\n          resourceRef:\r\n            name: ${1}\r\n```\r\n\r\nDocumentation should be DEFINITELY be included for this one. Discussion is good 😄 "},"comment":{"url":"https://api.github.com/repos/tektoncd/triggers/issues/comments/517005487","html_url":"https://github.com/tektoncd/triggers/issues/50#issuecomment-517005487","issue_url":"https://api.github.com/repos/tektoncd/triggers/issues/50","id":517005487,"node_id":"MDEyOklzc3VlQ29tbWVudDUxNzAwNTQ4Nw==","user":{"login":"vtereso","id":22847291,"node_id":"MDQ6VXNlcjIyODQ3Mjkx","avatar_url":"https://avatars2.githubusercontent.com/u/22847291?v=4","gravatar_id":"","url":"https://api.github.com/users/vtereso","html_url":"https://github.com/vtereso","followers_url":"https://api.github.com/users/vtereso/followers","following_url":"https://api.github.com/users/vtereso/following{/other_user}","gists_url":"https://api.github.com/users/vtereso/gists{/gist_id}","starred_url":"https://api.github.com/users/vtereso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtereso/subscriptions","organizations_url":"https://api.github.com/users/vtereso/orgs","repos_url":"https://api.github.com/users/vtereso/repos","events_url":"https://api.github.com/users/vtereso/events{/privacy}","received_events_url":"https://api.github.com/users/vtereso/received_events","type":"User","site_admin":false},"created_at":"2019-07-31T20:21:49Z","updated_at":"2019-07-31T20:21:49Z","author_association":"CONTRIBUTOR","body":"Many ways to tackle this one 🤔, but discussion definitely necessary immediately after we have resource creation."}}
other: {"actor":{"display_login":"vtereso"}}