Skip to content

Commit 4074610

Browse files
committed
2 parents dac6c46 + 3fa6ec0 commit 4074610

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1819
-510
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
]
1717
}
1818
},
19-
"postStartCommand": "git pull origin main && python3 -m pip install -r infra/scripts/index_scripts/requirements.txt && curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash && chmod +x ./infra/scripts/quota_check_params.sh",
19+
"postStartCommand": "bash ./.devcontainer/setup_env.sh",
2020
"remoteUser": "vscode",
2121
"hostRequirements": {
2222
"memory": "4gb"

.devcontainer/setup_env.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
git fetch
4+
git pull
5+
6+
# provide execute permission to quotacheck script
7+
sudo chmod +x ./infra/scripts/checkquota_km.sh
8+
sudo chmod +x ./infra/scripts/quota_check_params.sh

.github/workflows/Scheduled-Dependabot-PRs-Auto-Merge.yml

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# ------------------------------------------------------------------------------
2+
# Scheduled Dependabot PRs Auto-Merge Workflow
3+
#
4+
# Purpose:
5+
# - Automatically detect, rebase (if needed), and merge Dependabot PRs targeting
6+
# the `dependabotchanges` branch, supporting different merge strategies.
7+
#
8+
# Features:
9+
# ✅ Filters PRs authored by Dependabot and targets the specific base branch
10+
# ✅ Rebases PRs with conflicts and auto-resolves using "prefer-theirs" strategy
11+
# ✅ Attempts all three merge strategies: merge, squash, rebase (first success wins)
12+
# ✅ Handles errors gracefully, logs clearly
13+
#
14+
# Triggers:
15+
# - Scheduled daily run (midnight UTC)
16+
# - Manual trigger (via GitHub UI)
17+
#
18+
# Required Permissions:
19+
# - contents: write
20+
# - pull-requests: write
21+
# ------------------------------------------------------------------------------
22+
123
name: Scheduled Dependabot PRs Auto-Merge
224

325
on:
@@ -20,7 +42,6 @@ jobs:
2042
run: |
2143
sudo apt update
2244
sudo apt install -y gh
23-
2445
- name: Fetch & Filter Dependabot PRs
2546
env:
2647
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -41,7 +62,6 @@ jobs:
4162
done <<< "$pr_batch"
4263
echo "👉 Matched PRs:"
4364
cat matched_prs.txt || echo "None"
44-
4565
- name: Rebase PR if Conflicts Exist
4666
if: success()
4767
env:
@@ -53,15 +73,31 @@ jobs:
5373
fi
5474
while IFS= read -r pr_url; do
5575
pr_number=$(basename "$pr_url")
56-
echo "🔁 Rebasing PR #$pr_number if conflicts exist"
76+
echo "🔁 Checking PR #$pr_number for conflicts..."
5777
mergeable=$(gh pr view "$pr_number" --json mergeable --jq '.mergeable')
5878
if [[ "$mergeable" == "CONFLICTING" ]]; then
59-
echo "❌ Merge conflicts detected. Rebasing PR #$pr_number"
60-
gh pr update-branch "$pr_url" || echo "❗ Rebase (update-branch) failed."
79+
echo "⚠️ Merge conflicts detected. Performing manual rebase for PR #$pr_number..."
80+
head_branch=$(gh pr view "$pr_number" --json headRefName --jq '.headRefName')
81+
base_branch=$(gh pr view "$pr_number" --json baseRefName --jq '.baseRefName')
82+
git fetch origin "$base_branch":"$base_branch"
83+
git fetch origin "$head_branch":"$head_branch"
84+
git checkout "$head_branch"
85+
git config user.name "github-actions"
86+
git config user.email "[email protected]"
87+
# Attempt rebase with 'theirs' strategy
88+
if git rebase --strategy=recursive -X theirs "$base_branch"; then
89+
echo "✅ Rebase successful. Pushing..."
90+
git push origin "$head_branch" --force
91+
else
92+
echo "❌ Rebase failed. Aborting..."
93+
git rebase --abort || true
94+
fi
95+
else
96+
echo "✅ PR #$pr_number is mergeable. Skipping rebase."
6197
fi
6298
done < matched_prs.txt
63-
64-
- name: Auto-Merge if Mergeable
99+
100+
- name: Auto-Merge PRs using available strategy
65101
if: success()
66102
env:
67103
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -71,30 +107,38 @@ jobs:
71107
exit 0
72108
fi
73109
while IFS= read -r pr_url; do
74-
echo "🔍 Checking mergeability for $pr_url"
75110
pr_number=$(basename "$pr_url")
111+
echo "🔍 Checking mergeability for PR #$pr_number"
76112
attempt=0
77113
max_attempts=8
78114
mergeable=""
79-
sleep 5 # Initial delay to allow GitHub to compute mergeability
115+
sleep 5 # Let GitHub calculate mergeable status
80116
while [[ $attempt -lt $max_attempts ]]; do
81117
mergeable=$(gh pr view "$pr_number" --json mergeable --jq '.mergeable' 2>/dev/null || echo "UNKNOWN")
82118
echo "🔁 Attempt $((attempt+1))/$max_attempts: mergeable=$mergeable"
83119
if [[ "$mergeable" == "MERGEABLE" ]]; then
84-
echo "🚀 Enabling auto-merge..."
85-
set -x
86-
merge_output=$(gh pr merge --auto --merge "$pr_url" 2>&1)
87-
merge_status=$?
88-
set +x
89-
echo "$merge_output"
90-
if [[ $merge_status -ne 0 ]]; then
91-
echo "❗ Auto-merge failed. Output: $merge_output"
92-
else
93-
echo "✅ Auto-merge succeeded!"
120+
success=0
121+
for strategy in rebase squash merge; do
122+
echo "🚀 Trying to auto-merge PR #$pr_number using '$strategy' strategy..."
123+
set -x
124+
merge_output=$(gh pr merge --auto --"$strategy" "$pr_url" 2>&1)
125+
merge_status=$?
126+
set +x
127+
echo "$merge_output"
128+
if [[ $merge_status -eq 0 ]]; then
129+
echo "✅ Auto-merge succeeded using '$strategy'."
130+
success=1
131+
break
132+
else
133+
echo "❌ Auto-merge failed using '$strategy'. Trying next strategy..."
134+
fi
135+
done
136+
if [[ $success -eq 0 ]]; then
137+
echo "❌ All merge strategies failed for PR #$pr_number"
94138
fi
95139
break
96140
elif [[ "$mergeable" == "CONFLICTING" ]]; then
97-
echo "❌ Cannot merge due to conflicts. Skipping."
141+
echo "❌ Cannot merge due to conflicts. Skipping PR #$pr_number"
98142
break
99143
else
100144
echo "🕒 Waiting for GitHub to determine mergeable status..."

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111
.fake
1212
.azure
1313
.idea
14-
/myenv
14+
/myenv
15+
scriptenv/
16+
__pycache__/

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Analysts working with large volumes of conversational data can use this solution
1515
</div>
1616
<br/>
1717

18-
<h2><img src="./docs/images/readme/solution-overview.png" width="48" />
18+
<h2><img src="./docs/Images/ReadMe/solution-overview.png" width="48" />
1919
Solution overview
2020
</h2>
2121

2222
Leverages Azure AI Content Understanding, Azure AI Search, Azure OpenAI Service, Semantic Kernel, Azure SQL Database, and Cosmos DB to process large volumes of conversational data. Audio and text inputs are analyzed through event-driven pipelines to extract and vectorize key information, orchestrate intelligent responses, and power an interactive web front-end for exploring insights using natural language.
2323

2424
### Solution architecture
25-
|![image](./docs/images/readme/solution-architecture.png)|
25+
|![image](./docs/Images/ReadMe/solution-architecture.png)|
2626
|---|
2727

2828
### Additional resources
@@ -55,7 +55,7 @@ Summarized conversations, topic generation, and key phrase extraction support fa
5555

5656

5757
<br /><br />
58-
<h2><img src="./docs/images/readme/quick-deploy.png" width="48" />
58+
<h2><img src="./docs/Images/ReadMe/quick-deploy.png" width="48" />
5959
Quick deploy
6060
</h2>
6161

@@ -114,12 +114,12 @@ _Note: This is not meant to outline all costs as selected SKUs, scaled use, cust
114114
either by deleting the resource group in the Portal or running `azd down`.
115115

116116
<br /><br />
117-
<h2><img src="./docs/images/readme/business-scenario.png" width="48" />
117+
<h2><img src="./docs/Images/ReadMe/business-scenario.png" width="48" />
118118
Business scenario
119119
</h2>
120120

121121

122-
|![image](./docs/images/readme/ui.png)|
122+
|![image](./docs/Images/ReadMe/ui.png)|
123123
|---|
124124

125125
<br/>
@@ -152,7 +152,7 @@ Clear, contextual insights empower employees to take meaningful action based on
152152

153153
<br /><br />
154154

155-
<h2><img src="./docs/images/readme/supporting-documentation.png" width="48" />
155+
<h2><img src="./docs/Images/ReadMe/supporting-documentation.png" width="48" />
156156
Supporting documentation
157157
</h2>
158158

docs/Fabric_deployment.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
### Fabric deployment is not currently used in this accelerator. The steps below are not applicable and can be ignored, as this functionality is still in development.
2+
13
### How to customize
24

35
If you'd like to customize the solution accelerator, here are some ways you might do that:
4-
- Ingest your own [audio conversation files](./docs/ConversationalDataFormat.md) by uploading them into the `cu_audio_files_all` lakehouse folder and run the data pipeline
5-
- Deploy with Microsoft Fabric by following the steps in [Fabric_deployment.md](./docs/Fabric_deployment.md)
6+
- Ingest your own [audio conversation files](./ConversationalDataFormat.md) by uploading them into the `cu_audio_files_all` lakehouse folder and run the data pipeline
7+
- Deploy with Microsoft Fabric by following the steps in [Fabric_deployment.md](./Fabric_deployment.md)
68

79

810
3. **Create Fabric workspace**
@@ -40,7 +42,7 @@ If you'd like to customize the solution accelerator, here are some ways you migh
4042
3. solutionprefix_param - prefix used to append to lakehouse upon creation
4143
5. **Add App Authentication**
4244

43-
Follow steps in [App Authentication](./docs/AppAuthentication.md) to configure authentication in app service.
45+
Follow steps in [App Authentication](./AppAuthentication.md) to configure authentication in app service.
4446

4547
### Upload additional files
4648

File renamed without changes.

0 commit comments

Comments
 (0)