2023-11-15 02:48:13 -05:00
|
|
|
name: notify e2e failure
|
2023-04-12 10:06:26 -04:00
|
|
|
description: "Post a failure message to project board and teams"
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
projectWriteToken:
|
|
|
|
description: "Token to write to the project board"
|
|
|
|
required: true
|
|
|
|
test:
|
|
|
|
description: "Test name"
|
|
|
|
required: true
|
|
|
|
provider:
|
|
|
|
description: "CSP"
|
|
|
|
required: true
|
|
|
|
refStream:
|
|
|
|
description: "RefStream of the run"
|
|
|
|
required: false
|
|
|
|
kubernetesVersion:
|
|
|
|
description: "Kubernetes version"
|
|
|
|
required: false
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation:
|
|
|
|
description: "How the infrastructure for the e2e test was created. One of [cli, self-managed, terraform]."
|
2023-10-30 09:33:58 -04:00
|
|
|
default: "false"
|
2023-04-12 10:06:26 -04:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Pick assignee
|
|
|
|
id: pick-assignee
|
|
|
|
uses: ./.github/actions/pick_assignee
|
|
|
|
|
2023-11-22 11:45:50 -05:00
|
|
|
- name: Get the current date
|
|
|
|
id: date
|
|
|
|
shell: bash
|
|
|
|
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Create body template
|
|
|
|
id: body-template
|
2023-11-28 03:41:01 -05:00
|
|
|
shell: bash
|
2023-11-22 11:45:50 -05:00
|
|
|
run: |
|
|
|
|
# TODO(katexochen): add job number when possible
|
|
|
|
jobURL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
2024-01-10 03:49:47 -05:00
|
|
|
|
|
|
|
# OpenSearch instance details
|
|
|
|
instance=search-e2e-logs-y46renozy42lcojbvrt3qq7csm
|
|
|
|
region=eu-central-1
|
|
|
|
|
|
|
|
# UUID of index "logs-*"
|
|
|
|
a="(metadata:(indexPattern:'9004ee20-77cc-11ee-b137-27c60b9ad4a4',view:discover))"
|
|
|
|
|
|
|
|
# Default window: last 7 days
|
|
|
|
g='(time:(from:now-7d,to:now))'
|
|
|
|
|
|
|
|
# Query with filters for this workflow run
|
2023-11-22 11:45:50 -05:00
|
|
|
# TODO(msanft): Add Self-managed param once logcollection is fixed.
|
2024-01-10 03:49:47 -05:00
|
|
|
q=$(echo "(filters:!(
|
|
|
|
(query:(match_phrase:(cloud.provider:${{ inputs.provider }}))),
|
|
|
|
(query:(match_phrase:(metadata.github.run-id:${{ github.run_id }}))),
|
|
|
|
(query:(match_phrase:(metadata.github.ref-stream:${{ inputs.refStream }}))),
|
|
|
|
(query:(match_phrase:(metadata.github.kubernetes-version:${{ inputs.kubernetesVersion }}))),
|
|
|
|
(query:(match_phrase:(metadata.github.e2e-test-payload:${{ inputs.test }})))
|
|
|
|
))" | tr -d "\t\n ")
|
|
|
|
|
|
|
|
# URL construction
|
|
|
|
opensearchURL="https://${instance}.${region}.es.amazonaws.com/_dashboards/app/data-explorer/discover/#?_a=${a}&_q=${q}&_g=${g}"
|
2023-11-22 11:45:50 -05:00
|
|
|
cat << EOF > header.md
|
|
|
|
|
|
|
|
## Metadata
|
|
|
|
|
|
|
|
* [Job URL](${jobURL})
|
2024-01-10 03:49:47 -05:00
|
|
|
* [OpenSearch URL](${opensearchURL})
|
2023-11-22 11:45:50 -05:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat header.md .github/failure_project_template.md > body.md
|
|
|
|
echo "BODY_PATH=$(pwd)/body.md" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- uses: ./.github/actions/gh_create_issue
|
|
|
|
id: gh_create_issue
|
|
|
|
with:
|
|
|
|
title: "${{ env.CURRENT_DATE }}"
|
|
|
|
body-file: ${{ env.BODY_PATH }}
|
|
|
|
repo: issues
|
|
|
|
label: "e2e failure"
|
|
|
|
assignee: ${{ steps.pick-assignee.outputs.assignee }}
|
|
|
|
project: Constellation bugs
|
|
|
|
fields: |
|
|
|
|
workflow: ${{ github.workflow }}
|
|
|
|
kubernetesVersion: ${{ inputs.kubernetesVersion }}
|
|
|
|
cloudProvider: ${{ inputs.provider }}
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation: ${{ inputs.clusterCreation }}
|
2023-11-22 11:45:50 -05:00
|
|
|
test: ${{ inputs.test }}
|
|
|
|
refStream: ${{ inputs.refStream }}
|
|
|
|
token: ${{ inputs.projectWriteToken }}
|
|
|
|
|
|
|
|
- name: Issue URL ${{ steps.gh_create_issue.outputs.issue-url }}
|
|
|
|
shell: bash
|
|
|
|
run: echo ${{ steps.gh_create_issue.outputs.issue-url }}
|