Skip to content

Commit 0d1f835

Browse files
Merge branch 'main' into dev
2 parents b81be42 + ed2ee24 commit 0d1f835

File tree

7 files changed

+92
-21
lines changed

7 files changed

+92
-21
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
commit-message:
99
prefix: "build"
1010
target-branch: "dependabotchanges"
11-
open-pull-requests-limit: 15
11+
open-pull-requests-limit: 100
1212

1313
- package-ecosystem: "npm"
1414
directory: "/ResearchAssistant/App/frontend"
@@ -17,7 +17,7 @@ updates:
1717
commit-message:
1818
prefix: "build"
1919
target-branch: "dependabotchanges"
20-
open-pull-requests-limit: 15
20+
open-pull-requests-limit: 100
2121

2222
# 2. Python dependencies
2323
- package-ecosystem: "pip"
@@ -27,7 +27,7 @@ updates:
2727
commit-message:
2828
prefix: "build"
2929
target-branch: "dependabotchanges"
30-
open-pull-requests-limit: 15
30+
open-pull-requests-limit: 100
3131

3232
- package-ecosystem: "pip"
3333
directory: "/ClientAdvisor/AzureFunction"
@@ -36,7 +36,7 @@ updates:
3636
commit-message:
3737
prefix: "build"
3838
target-branch: "dependabotchanges"
39-
open-pull-requests-limit: 15
39+
open-pull-requests-limit: 100
4040

4141
- package-ecosystem: "pip"
4242
directory: "/ClientAdvisor/Deployment/scripts/fabric_scripts"
@@ -45,7 +45,7 @@ updates:
4545
commit-message:
4646
prefix: "build"
4747
target-branch: "dependabotchanges"
48-
open-pull-requests-limit: 15
48+
open-pull-requests-limit: 100
4949

5050
- package-ecosystem: "pip"
5151
directory: "/ClientAdvisor/Deployment/scripts/index_scripts"
@@ -54,7 +54,7 @@ updates:
5454
commit-message:
5555
prefix: "build"
5656
target-branch: "dependabotchanges"
57-
open-pull-requests-limit: 15
57+
open-pull-requests-limit: 100
5858

5959
- package-ecosystem: "pip"
6060
directory: "/ResearchAssistant/App"
@@ -63,7 +63,7 @@ updates:
6363
commit-message:
6464
prefix: "build"
6565
target-branch: "dependabotchanges"
66-
open-pull-requests-limit: 15
66+
open-pull-requests-limit: 100
6767

6868
- package-ecosystem: "pip"
6969
directory: "/ResearchAssistant/Deployment/scripts/aihub_scripts"
@@ -72,7 +72,7 @@ updates:
7272
commit-message:
7373
prefix: "build"
7474
target-branch: "dependabotchanges"
75-
open-pull-requests-limit: 15
75+
open-pull-requests-limit: 100
7676

7777
- package-ecosystem: "pip"
7878
directory: "/ResearchAssistant/Deployment/scripts/fabric_scripts"
@@ -81,7 +81,7 @@ updates:
8181
commit-message:
8282
prefix: "build"
8383
target-branch: "dependabotchanges"
84-
open-pull-requests-limit: 15
84+
open-pull-requests-limit: 100
8585

8686
- package-ecosystem: "pip"
8787
directory: "/ResearchAssistant/Deployment/scripts/index_scripts"

.github/workflows/CAdeploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
2727
export GPT_MIN_CAPACITY="11"
2828
export TEXT_EMBEDDING_MIN_CAPACITY="45"
29+
export AZURE_REGIONS="${{ vars.AZURE_REGIONS_CA }}"
2930
3031
chmod +x ClientAdvisor/Deployment/scripts/checkquota.sh
3132
if ! ClientAdvisor/Deployment/scripts/checkquota.sh; then

.github/workflows/RAdeploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
2626
export GPT_MIN_CAPACITY="30"
2727
export TEXT_EMBEDDING_MIN_CAPACITY="45"
28+
export AZURE_REGIONS="${{ vars.AZURE_REGIONS_RA }}"
2829
2930
chmod +x ResearchAssistant/Deployment/scripts/checkquota.sh
3031
if ! ResearchAssistant/Deployment/scripts/checkquota.sh; then

.github/workflows/stale-bot.yml

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,82 @@
1-
name: 'Stale Bot'
1+
name: "Manage Stale Issues, PRs & Unmerged Branches"
22
on:
33
schedule:
4-
- cron: '30 1 * * *'
5-
4+
- cron: '30 1 * * *' # Runs daily at 1:30 AM UTC
5+
workflow_dispatch: # Allows manual triggering
66
permissions:
77
contents: write
88
issues: write
99
pull-requests: write
10-
1110
jobs:
1211
stale:
1312
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/stale@v9
14+
- name: Mark Stale Issues and PRs
15+
uses: actions/stale@v9
1616
with:
17-
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
17+
stale-issue-message: "This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or it will be closed in 30 days."
18+
stale-pr-message: "This PR is stale because it has been open 180 days with no activity. Please update or it will be closed in 30 days."
1819
days-before-stale: 180
1920
days-before-close: 30
21+
exempt-issue-labels: "keep"
22+
exempt-pr-labels: "keep"
23+
cleanup-branches:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # Fetch full history for accurate branch checks
30+
- name: Fetch All Branches
31+
run: git fetch --all --prune
32+
- name: List Merged Branches With No Activity in Last 3 Months
33+
run: |
34+
35+
echo "Branch Name,Last Commit Date,Committer,Committed In Branch,Action" > merged_branches_report.csv
36+
37+
for branch in $(git for-each-ref --format '%(refname:short) %(committerdate:unix)' refs/remotes/origin | awk -v date=$(date -d '3 months ago' +%s) '$2 < date {print $1}'); do
38+
if [[ "$branch" != "origin/main" && "$branch" != "origin/dev" ]]; then
39+
branch_name=${branch#origin/}
40+
# Ensure the branch exists locally before getting last commit date
41+
git fetch origin "$branch_name" || echo "Could not fetch branch: $branch_name"
42+
last_commit_date=$(git log -1 --format=%ci "origin/$branch_name" || echo "Unknown")
43+
committer_name=$(git log -1 --format=%cn "origin/$branch_name" || echo "Unknown")
44+
committed_in_branch=$(git branch -r --contains "origin/$branch_name" | tr -d ' ' | paste -sd "," -)
45+
echo "$branch_name,$last_commit_date,$committer_name,$committed_in_branch,Delete" >> merged_branches_report.csv
46+
fi
47+
done
48+
- name: List PR Approved and Merged Branches Older Than 30 Days
49+
run: |
50+
51+
for branch in $(gh api repos/${{ github.repository }}/pulls --jq '.[] | select(.merged_at != null and (.base.ref == "main" or .base.ref == "dev")) | select(.merged_at | fromdateiso8601 < (now - 2592000)) | .head.ref'); do
52+
# Ensure the branch exists locally before getting last commit date
53+
git fetch origin "$branch" || echo "Could not fetch branch: $branch"
54+
last_commit_date=$(git log -1 --format=%ci origin/$branch || echo "Unknown")
55+
committer_name=$(git log -1 --format=%cn origin/$branch || echo "Unknown")
56+
committed_in_branch=$(git branch -r --contains "origin/$branch" | tr -d ' ' | paste -sd "," -)
57+
echo "$branch,$last_commit_date,$committer_name,$committed_in_branch,Delete" >> merged_branches_report.csv
58+
done
59+
env:
60+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
- name: List Open PR Branches With No Activity in Last 3 Months
62+
run: |
63+
64+
for branch in $(gh api repos/${{ github.repository }}/pulls --state open --jq '.[] | select(.base.ref == "main" or .base.ref == "dev") | .head.ref'); do
65+
# Ensure the branch exists locally before getting last commit date
66+
git fetch origin "$branch" || echo "Could not fetch branch: $branch"
67+
last_commit_date=$(git log -1 --format=%ci origin/$branch || echo "Unknown")
68+
committer_name=$(git log -1 --format=%cn origin/$branch || echo "Unknown")
69+
if [[ $(date -d "$last_commit_date" +%s) -lt $(date -d '3 months ago' +%s) ]]; then
70+
# If no commit in the last 3 months, mark for deletion
71+
committed_in_branch=$(git branch -r --contains "origin/$branch" | tr -d ' ' | paste -sd "," -)
72+
echo "$branch,$last_commit_date,$committer_name,$committed_in_branch,Delete" >> merged_branches_report.csv
73+
fi
74+
done
75+
env:
76+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
- name: Upload CSV Report of Inactive Branches
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: merged-branches-report
81+
path: merged_branches_report.csv
82+
retention-days: 30

ClientAdvisor/Deployment/scripts/checkquota.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# List of Azure regions to check for quota (update as needed)
4-
REGIONS=("eastus" "westus" "northcentralus" "uksouth" "swedencentral")
4+
IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS"
55

66
SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}"
77
GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"
@@ -18,7 +18,7 @@ if ! az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET
1818
fi
1919

2020
echo "🔄 Validating required environment variables..."
21-
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$TEXT_EMBEDDING_MIN_CAPACITY" ]]; then
21+
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$TEXT_EMBEDDING_MIN_CAPACITY" || -z "$REGIONS" ]]; then
2222
echo "❌ ERROR: Missing required environment variables."
2323
exit 1
2424
fi

ResearchAssistant/Deployment/scripts/aihub_scripts/create_ai_hub.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Get Azure Key Vault Client
22
key_vault_name = 'kv_to-be-replaced'
33

4+
import time
45
from azure.ai.ml import MLClient
56
from azure.ai.ml.entities import (
67
Hub,
@@ -73,7 +74,10 @@ def get_secrets_from_kv(kv_name, secret_name):
7374
# construct a hub
7475
my_hub = Hub(name=aihub_name, location=solutionLocation, display_name=aihub_name)
7576

76-
created_hub = ml_client.workspaces.begin_create(my_hub).result()
77+
created_hub = ml_client.workspaces.begin_create(my_hub)
78+
79+
time.sleep(60) # wait for hub to be created
80+
created_hub = ml_client.workspaces.get(name=aihub_name)
7781

7882
# construct the project
7983
my_project = Project(
@@ -83,7 +87,9 @@ def get_secrets_from_kv(kv_name, secret_name):
8387
hub_id=created_hub.id,
8488
)
8589

86-
created_project = ml_client.workspaces.begin_create(workspace=my_project).result()
90+
created_project = ml_client.workspaces.begin_create(workspace=my_project)
91+
92+
time.sleep(30) # wait for hub to be created
8793

8894
open_ai_connection = AzureOpenAIConnection(
8995
name="Azure_OpenAI",

ResearchAssistant/Deployment/scripts/checkquota.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# List of Azure regions to check for quota (update as needed)
4-
REGIONS=("eastus2" "westus" "northcentralus" "uksouth" "francecentral")
4+
IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS"
55

66
SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}"
77
GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"
@@ -18,7 +18,7 @@ if ! az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET
1818
fi
1919

2020
echo "🔄 Validating required environment variables..."
21-
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$TEXT_EMBEDDING_MIN_CAPACITY" ]]; then
21+
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$TEXT_EMBEDDING_MIN_CAPACITY" || -z "$REGIONS" ]]; then
2222
echo "❌ ERROR: Missing required environment variables."
2323
exit 1
2424
fi

0 commit comments

Comments
 (0)