Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDP-300586: Add team vars to failure handler #426

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/create_jira_ticket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 2. URL encodes the JIRA ticket title.
# 3. Checks if a JIRA ticket with the same title already exists in the specified project (id=10984) and component (id=35986).
# 4. If a ticket already exists, it exits without creating a new ticket.
# 5. If no ticket exists, it creates a new JIRA ticket with the provided title and description.
# 5. If no ticket exists, it creates a new JIRA ticket with the provided title, description and team id.
# 6. Outputs the ID of the created JIRA ticket and sets it as a GitHub Actions output variable.

set -eou pipefail
Expand Down Expand Up @@ -64,7 +64,7 @@ json_response=$(curl --request POST \
},
"customfield_12751": [
{
"id": "22223"
"id": "${JIRA_TEAM_ID:?}"
}
],
"description": "${JIRA_TICKET_DESCRIPTION:?}",
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/failure-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: 'Name of the release.'
required: true
type: string
team_id:
description: 'ID of Jira Team'
required: true
type: string
secrets: # all secrets are passed explicitly in this workflow
jira_api_token:
required: true
Expand Down Expand Up @@ -72,6 +76,7 @@ jobs:
JIRA_API_TOKEN: ${{ secrets.jira_api_token }}
JIRA_TICKET_TITLE: "(${{inputs.env}}) The ${{inputs.release_name}} release has failed. GH Issue: ${{steps.create-issue.outputs.number}}"
JIRA_TICKET_DESCRIPTION: "The release process ${{inputs.release_name}} in [mongodb/openapi|https://github.com/mongodb/openapi] has failed. Please, look at the [issue-${{steps.create-issue.outputs.number}}|https://github.com/mongodb/openapi/issues/${{steps.create-issue.outputs.number}}] for more details."
JIRA_TEAM_ID: ${{ inputs.team_id }}
run: .github/scripts/create_jira_ticket.sh
- name: Add comment to GH Issue
if: ${{ steps.create-issue.outputs.number != null }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-IPA-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ jobs:
with:
env: 'dev'
release_name: "IPA Metrics"
team_id: ${{ vars.JIRA_TEAM_ID_APIX_1 }}
secrets:
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ jobs:
with:
env: "prod"
release_name: "FOASCLI"
team_id: ${{ vars.JIRA_TEAM_ID_APIX_2 }}
secrets:
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/release-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,6 @@ jobs:
with:
env: ${{ inputs.env }}
release_name: "OpenAPI Spec"
team_id: ${{ vars.JIRA_TEAM_ID_APIX_2 }}
secrets:
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
Loading