You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Thank you for your contribution to this repo!
4
-
Please help reviewers and future users, providing the following information:
5
-
1. Why is this change required?
6
-
2. What problem does it solve?
7
-
3. What scenario does it contribute to?
8
-
4. If it fixes an open issue, please link to the issue here.
9
-
5. Does this solve an issue or add a feature that *all* users of this sample app can benefit from? Contributions will only be accepted that apply across all users of this app.
10
-
-->
1
+
## Purpose
2
+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3
+
* ...
11
4
12
-
### Description
5
+
## Does this introduce a breaking change?
6
+
<!-- Mark one with an "x". -->
13
7
14
-
<!-- Describe your changes, the overall approach, the underlying design.
15
-
These notes will help understanding how your code works. Thanks! -->
8
+
-[ ] Yes
9
+
-[ ] No
16
10
11
+
<!-- Please prefix your PR title with one of the following:
12
+
* `feat`: A new feature
13
+
* `fix`: A bug fix
14
+
* `docs`: Documentation only changes
15
+
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
16
+
* `refactor`: A code change that neither fixes a bug nor adds a feature
17
+
* `perf`: A code change that improves performance
18
+
* `test`: Adding missing tests or correcting existing tests
19
+
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
20
+
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
21
+
* `chore`: Other changes that don't modify src or test files
22
+
* `revert`: Reverts a previous commit
23
+
* !: A breaking change is indicated with a `!` after the listed prefixes above, e.g. `feat!`, `fix!`, `refactor!`, etc.
24
+
-->
17
25
18
-
### Contribution Checklist
26
+
## Golden Path Validation
27
+
-[ ] I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.
19
28
20
-
<!-- Before submitting this PR, please make sure: -->
29
+
## Deployment Validation
30
+
-[ ] I have validated the deployment process successfully and all services are running as expected with this change.
21
31
32
+
## What to Check
33
+
Verify that the following are valid
22
34
-[ ] I have built and tested the code locally and in a deployed app
23
35
-[ ] For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
24
36
-[ ] This is a change for all users of this app. No code or asset is specific to my use case or my organization.
25
-
-[ ] I didn't break any existing functionality :smile:
37
+
38
+
39
+
## Other Information
40
+
<!-- Add any other helpful information that may be needed here.. -->
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
86
+
if [ "$rg_exists" = "true" ]; then
87
+
echo "Resource group exists. Cleaning..."
88
+
az group delete \
89
+
--name ${{ env.RESOURCE_GROUP_NAME }} \
90
+
--yes \
91
+
--no-wait
92
+
echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}"
93
+
else
94
+
echo "Resource group does not exist."
95
+
fi
96
+
97
+
- name: Wait for Resource Deletion to Complete
98
+
run: |
99
+
# List of resources to check based on SOLUTION_PREFIX
100
+
resources_to_check=(
101
+
"aoai-${{ env.SOLUTION_PREFIX }}"
102
+
"appins-${{ env.SOLUTION_PREFIX }}"
103
+
"db-cosmos-${{ env.SOLUTION_PREFIX }}"
104
+
"${{ env.SOLUTION_PREFIX }}-plan"
105
+
"search-${{ env.SOLUTION_PREFIX }}"
106
+
"webapp-${{ env.SOLUTION_PREFIX }}"
107
+
"worksp-${{ env.SOLUTION_PREFIX }}"
108
+
)
109
+
110
+
# Get the list of resources in YAML format
111
+
resource_list=$(az resource list --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} --output yaml)
112
+
113
+
# Maximum number of retries and retry intervals
114
+
max_retries=3
115
+
retry_intervals=(30 60 120)
116
+
retries=0
117
+
118
+
while true; do
119
+
resource_found=false
120
+
# Iterate through the resources to check
121
+
for resource in "${resources_to_check[@]}"; do
122
+
echo "Checking resource: $resource"
123
+
if echo "$resource_list" | grep -q "name: $resource"; then
124
+
echo "Resource '$resource' exists in the subscription."
125
+
resource_found=true
126
+
else
127
+
echo "Resource '$resource' does not exist in the subscription."
128
+
fi
129
+
done
130
+
131
+
# If any resource exists, retry
132
+
if [ "$resource_found" = true ]; then
133
+
retries=$((retries + 1))
134
+
if [ "$retries" -ge "$max_retries" ]; then
135
+
echo "Maximum retry attempts reached. Exiting."
136
+
break
137
+
else
138
+
echo "Waiting for ${retry_intervals[$retries-1]} seconds before retrying..."
139
+
sleep ${retry_intervals[$retries-1]}
140
+
fi
141
+
else
142
+
echo "No resources found. Exiting."
143
+
break
144
+
fi
145
+
done
146
+
147
+
- name: Purging the Resources
148
+
if: success()
149
+
run: |
150
+
set -e
151
+
# Purging resources based on solution prefix
152
+
echo "Purging resources..."
153
+
154
+
# List of resources to purge
155
+
resources_to_purge=(
156
+
"aoai-${{ env.SOLUTION_PREFIX }}"
157
+
"appins-${{ env.SOLUTION_PREFIX }}"
158
+
"db-cosmos-${{ env.SOLUTION_PREFIX }}"
159
+
"${{ env.SOLUTION_PREFIX }}-plan"
160
+
"search-${{ env.SOLUTION_PREFIX }}"
161
+
"webapp-${{ env.SOLUTION_PREFIX }}"
162
+
"worksp-${{ env.SOLUTION_PREFIX }}"
163
+
)
164
+
165
+
for resource in "${resources_to_purge[@]}"; do
166
+
echo "Purging resource: $resource"
167
+
if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/uksouth/deletedAccounts/$resource --verbose; then
"body": "<p>Dear Team,</p><p>We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
184
+
}
185
+
EOF
186
+
)
187
+
188
+
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
189
+
-H "Content-Type: application/json" \
190
+
-d "$EMAIL_BODY" || echo "Failed to send notification"
0 commit comments