mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
ci: add missing shell in notify action (#2646)
* Add missing shell * Remove old teams notify action --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems> Co-authored-by: Adrian Stobbe <stobbe.adrian@gmail.com>
This commit is contained in:
parent
97aea98e77
commit
45f6eec0d0
2
.github/actions/gh_create_issue/action.yml
vendored
2
.github/actions/gh_create_issue/action.yml
vendored
@ -39,7 +39,7 @@ inputs:
|
||||
description: "The template to use for the issue."
|
||||
required: false
|
||||
fields:
|
||||
description: "A JSON object containing the fields to use for the issue."
|
||||
description: "A YAML or JSON object containing the fields to use for the issue."
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
|
87
.github/actions/notify_e2e_failure/action.yml
vendored
87
.github/actions/notify_e2e_failure/action.yml
vendored
@ -5,9 +5,6 @@ inputs:
|
||||
projectWriteToken:
|
||||
description: "Token to write to the project board"
|
||||
required: true
|
||||
teamsWebhookUri:
|
||||
description: "URI to send a message to the teams channel"
|
||||
required: true
|
||||
test:
|
||||
description: "Test name"
|
||||
required: true
|
||||
@ -38,6 +35,7 @@ runs:
|
||||
|
||||
- name: Create body template
|
||||
id: body-template
|
||||
shell: bash
|
||||
run: |
|
||||
# TODO(katexochen): add job number when possible
|
||||
jobURL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
@ -65,7 +63,6 @@ runs:
|
||||
assignee: ${{ steps.pick-assignee.outputs.assignee }}
|
||||
project: Constellation bugs
|
||||
fields: |
|
||||
Status: New failures
|
||||
workflow: ${{ github.workflow }}
|
||||
kubernetesVersion: ${{ inputs.kubernetesVersion }}
|
||||
cloudProvider: ${{ inputs.provider }}
|
||||
@ -76,85 +73,3 @@ runs:
|
||||
- name: Issue URL ${{ steps.gh_create_issue.outputs.issue-url }}
|
||||
shell: bash
|
||||
run: echo ${{ steps.gh_create_issue.outputs.issue-url }}
|
||||
|
||||
- name: Create project card in case of failure
|
||||
id: create-project-card
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
env:
|
||||
GHH_TOKEN: ${{ inputs.projectWriteToken }}
|
||||
run: |
|
||||
# TODO(katexochen): add job number when possible
|
||||
jobURL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
# TODO(msanft): Add Self-managed param once logcollection is fixed.
|
||||
opensearchURL="https://search-e2e-logs-y46renozy42lcojbvrt3qq7csm.eu-central-1.es.amazonaws.com/_dashboards/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))&_a=(columns:!(metadata.name,systemd.unit,kubernetes.pod_name,message),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',key:metadata.github.e2e-test-provider,negate:!f,params:(query:${{ inputs.provider }}),type:phrase),query:(match_phrase:(metadata.github.e2e-test-provider:${{ inputs.provider }}))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',key:metadata.github.run-id,negate:!f,params:(query:${{ github.run_id }}),type:phrase),query:(match_phrase:(metadata.github.run-id:${{ github.run_id }}))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',key:metadata.github.ref-stream.keyword,negate:!f,params:(query:'${{ inputs.refStream }}'),type:phrase),query:(match_phrase:(metadata.github.ref-stream.keyword:'${{ inputs.refStream }}'))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',key:metadata.github.kubernetes-version.keyword,negate:!f,params:(query:'${{ inputs.kubernetesVersion }}'),type:phrase),query:(match_phrase:(metadata.github.kubernetes-version.keyword:'${{ inputs.kubernetesVersion }}'))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',key:metadata.github.e2e-test-payload,negate:!f,params:(query:'${{ inputs.test }}'),type:phrase),query:(match_phrase:(metadata.github.e2e-test-payload:'${{ inputs.test }}')))),index:'74517cf0-6442-11ed-acf1-47dda8fdfbbb',interval:auto,query:(language:kuery,query:''),sort:!())"
|
||||
cat << EOF > header.md
|
||||
|
||||
## Metadata
|
||||
|
||||
* [Job URL](${jobURL})
|
||||
* [OpenSearch URL](${opensearchURL// /%20})
|
||||
|
||||
EOF
|
||||
|
||||
cat header.md .github/failure_project_template.md > body.md
|
||||
cp .github/failure_project_metadata.json metadata.json
|
||||
DATE=$(date '+%F %a %T %Z') yq -iP '.issueTitle = env(DATE)' metadata.json
|
||||
yq -iP '.assignees += [ "${{ steps.pick-assignee.outputs.assignee }}" ]' metadata.json
|
||||
yq -iP '.fields.cloudProvider = "${{ inputs.provider }}"' metadata.json
|
||||
if [[ ${{ inputs.selfManagedInfra }} == 'true' ]]; then
|
||||
yq -iP '.fields.test = "${{ inputs.test }} (Self-managed infrastructure)"' metadata.json
|
||||
else
|
||||
yq -iP '.fields.test = "${{ inputs.test }}"' metadata.json
|
||||
fi
|
||||
yq -iP '.fields.workflow = "${{ github.workflow }}"' metadata.json
|
||||
if [[ -n "${{ inputs.kubernetesVersion }}" ]]; then
|
||||
yq -iP '.fields.kubernetesVersion = "${{ inputs.kubernetesVersion }}"' metadata.json
|
||||
fi
|
||||
if [[ -n "${{ inputs.refStream }}" ]]; then
|
||||
yq -iP '.fields.refStream = "${{ inputs.refStream }}"' metadata.json
|
||||
fi
|
||||
|
||||
cat metadata.json
|
||||
|
||||
issueURL=$(
|
||||
bazel run //bazel/ci:ghh -- create-project-issue \
|
||||
--body body.md \
|
||||
--metadata metadata.json \
|
||||
-v
|
||||
)
|
||||
|
||||
echo "jobURL=${jobURL}" | tee -a "$GITHUB_OUTPUT"
|
||||
echo "opensearchURL=${opensearchURL}" | tee -a "$GITHUB_OUTPUT"
|
||||
echo "issueURL=${issueURL}" | tee -a "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create notification fields
|
||||
id: create-fields
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
echo '[ { "title": "CloudProvider", "value": "${{ inputs.provider }}" }, { "title": "Test", "value": "${{ inputs.test }}" } ]' > facts.json
|
||||
if [[ -n "${{ inputs.kubernetesVersion }}" ]]; then
|
||||
yq -oj -iP '. += [ { "title": "KubernetesVersion", "value": "${{ inputs.kubernetesVersion }}" } ]' facts.json
|
||||
fi
|
||||
if [[ -n "${{ inputs.refStream }}" ]]; then
|
||||
yq -oj -iP '. += [ { "title": "RefStream", "value": "${{ inputs.refStream }}" } ]' facts.json
|
||||
fi
|
||||
|
||||
buttons='[
|
||||
{
|
||||
"type": "Action.OpenUrl",
|
||||
"title": "Project board issue",
|
||||
"url": "${{ steps.create-project-card.outputs.issueURL }}",
|
||||
"style": "positive"
|
||||
},
|
||||
{
|
||||
"type": "Action.OpenUrl",
|
||||
"title": "OpenSearch logs",
|
||||
"url": "${{ steps.create-project-card.outputs.opensearchURL }}",
|
||||
"style": "positive"
|
||||
}
|
||||
]'
|
||||
|
||||
echo "additionalFields=$(cat facts.json)" | tee -a "$GITHUB_OUTPUT"
|
||||
echo "additionalButtons=$buttons" | tee -a "$GITHUB_OUTPUT"
|
||||
|
2
.github/workflows/e2e-test-daily.yml
vendored
2
.github/workflows/e2e-test-daily.yml
vendored
@ -119,7 +119,6 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
refStream: ${{ matrix.refStream }}
|
||||
test: ${{ matrix.test }}
|
||||
kubernetesVersion: ${{ matrix.kubernetesVersion }}
|
||||
@ -167,6 +166,5 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
test: "MiniConstellation"
|
||||
provider: "QEMU"
|
||||
|
2
.github/workflows/e2e-test-weekly.yml
vendored
2
.github/workflows/e2e-test-weekly.yml
vendored
@ -287,7 +287,6 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
refStream: ${{ matrix.refStream }}
|
||||
test: ${{ matrix.test }}
|
||||
kubernetesVersion: ${{ matrix.kubernetes-version }}
|
||||
@ -356,7 +355,6 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
test: "MiniConstellation"
|
||||
provider: "QEMU"
|
||||
|
||||
|
1
.github/workflows/e2e-upgrade.yml
vendored
1
.github/workflows/e2e-upgrade.yml
vendored
@ -310,6 +310,5 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
test: "upgrade"
|
||||
provider: ${{ inputs.cloudProvider }}
|
||||
|
1
.github/workflows/e2e-windows.yml
vendored
1
.github/workflows/e2e-windows.yml
vendored
@ -174,6 +174,5 @@ jobs:
|
||||
uses: ./.github/actions/notify_e2e_failure
|
||||
with:
|
||||
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
||||
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
|
||||
test: Windows E2E Test
|
||||
provider: Azure
|
||||
|
Loading…
Reference in New Issue
Block a user