Commit d1937408 by Dimitris Sotirakis Committed by GitHub

Replace PR with Commit truncated hash when build fails (#31177)

* Replace PR with Commit truncated hash when build fails

* Make commit literal lower case
parent 100e7eb9
...@@ -690,7 +690,7 @@ steps: ...@@ -690,7 +690,7 @@ steps:
image: plugins/slack image: plugins/slack
settings: settings:
channel: grafana-ci-notifications channel: grafana-ci-notifications
template: "Build {{build.number}} failed for PR {{build.pull}}: {{build.link}}\nAuthor: {{build.author}}" template: "Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nAuthor: {{build.author}}"
webhook: webhook:
from_secret: slack_webhook from_secret: slack_webhook
...@@ -1609,7 +1609,7 @@ steps: ...@@ -1609,7 +1609,7 @@ steps:
image: plugins/slack image: plugins/slack
settings: settings:
channel: grafana-ci-notifications channel: grafana-ci-notifications
template: "Build {{build.number}} failed for PR {{build.pull}}: {{build.link}}\nAuthor: {{build.author}}" template: "Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nAuthor: {{build.author}}"
webhook: webhook:
from_secret: slack_webhook from_secret: slack_webhook
...@@ -2511,7 +2511,7 @@ steps: ...@@ -2511,7 +2511,7 @@ steps:
image: plugins/slack image: plugins/slack
settings: settings:
channel: grafana-ci-notifications channel: grafana-ci-notifications
template: "Build {{build.number}} failed for PR {{build.pull}}: {{build.link}}\nAuthor: {{build.author}}" template: "Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nAuthor: {{build.author}}"
webhook: webhook:
from_secret: slack_webhook from_secret: slack_webhook
...@@ -3309,7 +3309,7 @@ steps: ...@@ -3309,7 +3309,7 @@ steps:
image: plugins/slack image: plugins/slack
settings: settings:
channel: grafana-ci-notifications channel: grafana-ci-notifications
template: "Build {{build.number}} failed for PR {{build.pull}}: {{build.link}}\nAuthor: {{build.author}}" template: "Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nAuthor: {{build.author}}"
webhook: webhook:
from_secret: slack_webhook from_secret: slack_webhook
......
...@@ -71,7 +71,7 @@ def slack_step(channel): ...@@ -71,7 +71,7 @@ def slack_step(channel):
'from_secret': 'slack_webhook', 'from_secret': 'slack_webhook',
}, },
'channel': channel, 'channel': channel,
'template': 'Build {{build.number}} failed for PR {{build.pull}}: {{build.link}}\nAuthor: {{build.author}}', 'template': 'Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nAuthor: {{build.author}}',
}, },
} }
...@@ -205,7 +205,7 @@ def enterprise_downstream_step(edition): ...@@ -205,7 +205,7 @@ def enterprise_downstream_step(edition):
}, },
} }
def lint_backend_step(edition): def lint_backend_step(edition):
return { return {
'name': 'lint-backend' + enterprise2_sfx(edition), 'name': 'lint-backend' + enterprise2_sfx(edition),
'image': build_image, 'image': build_image,
...@@ -445,7 +445,7 @@ def build_plugins_step(edition, sign=False): ...@@ -445,7 +445,7 @@ def build_plugins_step(edition, sign=False):
], ],
} }
def test_backend_step(edition): def test_backend_step(edition):
return { return {
'name': 'test-backend' + enterprise2_sfx(edition), 'name': 'test-backend' + enterprise2_sfx(edition),
'image': build_image, 'image': build_image,
...@@ -580,7 +580,7 @@ def gen_version_step(ver_mode, include_enterprise2=False, is_downstream=False): ...@@ -580,7 +580,7 @@ def gen_version_step(ver_mode, include_enterprise2=False, is_downstream=False):
def package_step(edition, ver_mode, variants=None, is_downstream=False): def package_step(edition, ver_mode, variants=None, is_downstream=False):
variants_str = '' variants_str = ''
if variants: if variants:
variants_str = ' --variants {}'.format(','.join(variants)) variants_str = ' --variants {}'.format(','.join(variants))
if ver_mode in ('master', 'release', 'test-release', 'release-branch'): if ver_mode in ('master', 'release', 'test-release', 'release-branch'):
sign_args = ' --sign' sign_args = ' --sign'
...@@ -644,9 +644,9 @@ def package_step(edition, ver_mode, variants=None, is_downstream=False): ...@@ -644,9 +644,9 @@ def package_step(edition, ver_mode, variants=None, is_downstream=False):
'commands': cmds, 'commands': cmds,
} }
def e2e_tests_server_step(edition, port=3001): def e2e_tests_server_step(edition, port=3001):
package_file_pfx = '' package_file_pfx = ''
if edition == 'enterprise2': if edition == 'enterprise2':
package_file_pfx = 'grafana' + enterprise2_sfx(edition) package_file_pfx = 'grafana' + enterprise2_sfx(edition)
elif edition == 'enterprise': elif edition == 'enterprise':
package_file_pfx = 'grafana-' + edition package_file_pfx = 'grafana-' + edition
...@@ -724,13 +724,13 @@ def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publis ...@@ -724,13 +724,13 @@ def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publis
ubuntu_sfx = '' ubuntu_sfx = ''
if ubuntu: if ubuntu:
ubuntu_sfx = '-ubuntu' ubuntu_sfx = '-ubuntu'
settings = { settings = {
'dry_run': not publish, 'dry_run': not publish,
'edition': edition, 'edition': edition,
'ubuntu': ubuntu, 'ubuntu': ubuntu,
} }
if publish: if publish:
settings['username'] = { settings['username'] = {
...@@ -836,7 +836,7 @@ def deploy_to_kubernetes_step(edition, is_downstream=False): ...@@ -836,7 +836,7 @@ def deploy_to_kubernetes_step(edition, is_downstream=False):
], ],
} }
def enterprise2_sfx(edition): def enterprise2_sfx(edition):
if edition == 'enterprise2': if edition == 'enterprise2':
return '-{}'.format(edition) return '-{}'.format(edition)
return '' return ''
...@@ -844,7 +844,7 @@ def enterprise2_sfx(edition): ...@@ -844,7 +844,7 @@ def enterprise2_sfx(edition):
def upload_packages_step(edition, ver_mode, is_downstream=False): def upload_packages_step(edition, ver_mode, is_downstream=False):
if ver_mode == 'master' and edition in ('enterprise', 'enterprise2') and not is_downstream: if ver_mode == 'master' and edition in ('enterprise', 'enterprise2') and not is_downstream:
return None return None
packages_bucket = ' --packages-bucket grafana-downloads' + enterprise2_sfx(edition) packages_bucket = ' --packages-bucket grafana-downloads' + enterprise2_sfx(edition)
if ver_mode == 'test-release': if ver_mode == 'test-release':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment