Skip to content

Commit

Permalink
Merge pull request #9211 from department-of-veterans-affairs/chanel-6…
Browse files Browse the repository at this point in the history
…812-automate-notification-release-ticket-to-ssigned-people

Automation/6812-chanel-automation-notification-of-release-ticket-to-assign-people
  • Loading branch information
IsraelleHub authored Sep 20, 2024
2 parents b32bb68 + 0793bf4 commit 3de65e6
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/release_branch_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
ticketNumber: ${{steps.create-issue.outputs.number}}
versionNumber: ${{env.VERSION}}
releaseDate: ${{env.RELEASE_DATE}}
qaDueDate: ${{env.QA_DUE_DATE}}
prodDueDate: ${{env.PROD_DUE_DATE}}
vaDueDate: ${{env.VA_DUE_DATE}}
steps:
- run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- run: echo "QA_DUE_DATE=$(date -d "+2 days" '+%A %b %d, %Y')" >> $GITHUB_ENV
Expand Down Expand Up @@ -72,3 +75,77 @@ jobs:
OLD_BODY=$(echo $(gh issue view $TICKET_NUM --json body | jq -r '.body'))
NEW_BODY=$(echo "$OLD_BODY" | sed -e "s#\^\^\^Testrail-url\^\^\^#$RUN_URL#g")
gh issue edit $TICKET_NUM -b $NEW_BODY
start_slack_thread:
name: Start Slack thread
needs: release_ticket
uses: ./.github/workflows/start_slack_thread.yml
secrets: inherit
with:
channel_name: va-mobile-app
message: '*Release ${{ needs.release_ticket.outputs.versionNumber }} Coordination :thread:'
release_coordination:
name: release coordination
if: ${{ success() }}
needs: [start_slack_thread, release_ticket]
runs-on: ubuntu-latest
steps:
- name: Map GitHub usernames to Slack IDs
id: map_slack_ids
run: |
declare -A GITHUB_TO_SLACK_MAP
GITHUB_TO_SLACK_MAP["DJUltraTom"]="U02BBL9L0CU"
GITHUB_TO_SLACK_MAP["kellylein"]="UJHA49K6X"
GITHUB_TO_SLACK_MAP["dumathane"]="U02RC1BRZBP"
GITHUB_TO_SLACK_MAP["timwright12"]="U01DBDAJZ18"
GITHUB_TO_SLACK_MAP["ala_yna"]="UQC180926"
GITHUB_TO_SLACK_MAP["ajsarkar28"]="U05BNQLJ9UZ"
GITHUB_TO_SLACK_MAP["rachelhanster"]="U047Q1LKDFY"
GITHUB_TO_SLACK_MAP["DonMcCaugheyUSDS"]="U06PCD1R0EL"
GITHUB_TO_SLACK_MAP["IsraelleHub"]="U06N7M2QSUA"
GITHUB_TO_SLACK_MAP["rtwell"]="UEY4D750B"
# Example: Convert mapping to environment variables
for key in "${!GITHUB_TO_SLACK_MAP[@]}"; do
echo "${key}=${GITHUB_TO_SLACK_MAP[$key]}" >> $GITHUB_ENV
done
- name: Notify Slack for release coordination
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_DJUltraTom: $DJUltraTom
SLACK_kellylein: $kellylein
SLACK_dumathane: $dumathane
SLACK_timwright12: $timwright12
SLACK_alayna: $ala_yna
SLACK_ajsarkar28: $ajsarkar28
SLACK_rachelhanster: $rachelhanster
SLACK_DonMcCaugheyUSDS: $DonMcCaugheyUSDS
SLACK_rtwell: $rtwell
run: |
SLACK_MESSAGE=$(cat <<EOF
{
"channel": "va-mobile-app",
"text": "*Release Ticket #:* <https://github.com/department-of-veterans-affairs/va-mobile-app/issues/${{ needs.release_ticket.outputs.ticketNumber }}|${{ needs.release_ticket.outputs.ticketNumber }}>\n\
*Release Report:* Github Report Link to be provided\n\
*Release Date:* ${{ needs.release_ticket.outputs.releaseDate }}\n\n\
*Approval Timing:*\n\
- *QA Approval Due:* ${{ needs.release_ticket.outputs.qaDueDate }}\n\
- *Product Approval Due:* ${{ needs.release_ticket.outputs.prodDueDate }}\n\
- *Release Manager Approval Due:* ${{ needs.release_ticket.outputs.vaDueDate }}\n\
- *Tickets Tagged Appropriately:* ${{ needs.release_ticket.outputs.qaDueDate }}\n\n\
*Contacts:*\n\
- *Release Testing:* <@${SLACK_DJUltraTom}>\n\
- *Release Manager:* <@${SLACK_kellylein}>\n\
- *Release Ticket Validation:* <@${SLACK_dumathane}>\n\
- *Engineering:* <@${SLACK_dumathane}>, <@${SLACK_timwright12}>\n\
- *Mobile Product Approvers:* H&B and Global - <@${SLACK_alayna}> Global - <@${SLACK_ajsarkar28}>\n\
- *VA PO for awareness:* <@${SLACK_rachelhanster}> CC: <@${SLACK_DonMcCaugheyUSDS}>, <@${SLACK_rtwell}>.",
"thread_ts": "${{ needs.start_slack_thread.outputs.thread_ts }}",
"unfurl_links": false,
"unfurl_media": false
}
EOF
)
echo "$SLACK_MESSAGE" | envsubst | curl -X POST \
-H 'Authorization: Bearer '"$SLACK_API_TOKEN" \
-H 'Content-type: application/json' \
-d @- \
https://slack.com/api/chat.postMessage

0 comments on commit 3de65e6

Please sign in to comment.