community icon indicating copy to clipboard operation
community copied to clipboard

Add VELA_BUILD_SENDER_EMAIL

Open xordspar0 opened this issue 2 years ago • 3 comments

Description

There is a VELA_BUILD_SENDER variable available in pipelines. It would be really useful to have a VELA_BUILD_SENDER_EMAIL variable as well.

Value

I would use this in the vela-slack plugin. You can use the VELA_BUILD_AUTHOR_EMAIL to look up the user's sAM account name and tag a person in Slack to send them a notification:

  - name: slack-failure
    image: target/vela-slack:latest
    ruleset:
      event: [ push, deployment ]
      status: [ failure ]
    parameters:
      text: '${VELA_BUILD_EVENT} by {{"<@{{.BuildAuthorSAMAccountName|lower}}>"}} failed'

The issue today is that the build author field is not filled in for deployments. If there were a VELA_BUILD_SENDER_EMAIL field, I would like to do this:

   - name: slack-failure
     image: target/vela-slack:latest
     ruleset:
       event: [ push, deployment ]
       status: [ failure ]
     parameters:
-       text: '${VELA_BUILD_EVENT} by {{"<@{{.BuildAuthorSAMAccountName|lower}}>"}} failed'
+       text: '${VELA_BUILD_EVENT} by {{"<@{{.BuildSenderSAMAccountName|lower}}>"}} failed'

Definition of Done

  • A VELA_BUILD_SENDER_EMAIL variable should be available in pipelines.
  • The variable reference documentation needs to be updated with VELA_BUILD_SENDER_EMAIL added to the list of available variables.

Effort (Optional)

Unknown. If I understand correctly, VELA_BUILD_SENDER is a field provided by the Github webhook. It would require extra code to look up the email of the user that Github provides if Vela does not already has a mechanism to do that.

Impacted Personas (Optional)

  • Users
  • Plugin authors

xordspar0 avatar Mar 31 '22 17:03 xordspar0