Skip to content

Commit 1d19b29

Browse files
Merge branch 'main' into dev
2 parents 8b50482 + bb6d517 commit 1d19b29

Some content is hidden

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

69 files changed

+3840
-164
lines changed

.devcontainer/devcontainer.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
{
2-
"name": "Multi Agent Custom Automation Engine Solution Accelerator",
3-
"image": "mcr.microsoft.com/devcontainers/python:3.10",
4-
"features": {
5-
"ghcr.io/devcontainers/features/azure-cli:1.0.8": {},
6-
"ghcr.io/azure/azure-dev/azd:latest": {},
7-
"ghcr.io/rchaganti/vsc-devcontainer-features/azurebicep:1.0.5": {}
8-
},
9-
10-
"postCreateCommand": "sudo chmod +x .devcontainer/setupEnv.sh && ./.devcontainer/setupEnv.sh",
11-
12-
"customizations": {
13-
"vscode": {
14-
"extensions": [
15-
"ms-azuretools.azure-dev",
16-
"ms-azuretools.vscode-bicep",
17-
"ms-python.python"
18-
]
19-
},
20-
"codespaces": {
21-
"openFiles": [
22-
"README.md"
23-
]
24-
}
25-
},
26-
27-
"remoteUser": "vscode",
28-
"hostRequirements": {
29-
"memory": "8gb"
30-
}
31-
}
1+
{
2+
"name": "Multi Agent Custom Automation Engine Solution Accelerator",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.10",
4+
"features": {
5+
"ghcr.io/devcontainers/features/azure-cli:1.0.8": {},
6+
"ghcr.io/azure/azure-dev/azd:latest": {},
7+
"ghcr.io/rchaganti/vsc-devcontainer-features/azurebicep:1.0.5": {}
8+
},
9+
10+
"postCreateCommand": "sudo chmod +x .devcontainer/setupEnv.sh && ./.devcontainer/setupEnv.sh",
11+
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-azuretools.azure-dev",
16+
"ms-azuretools.vscode-bicep",
17+
"ms-python.python"
18+
]
19+
},
20+
"codespaces": {
21+
"openFiles": [
22+
"README.md"
23+
]
24+
}
25+
},
26+
27+
"remoteUser": "vscode",
28+
"hostRequirements": {
29+
"memory": "8gb"
30+
}
31+
}

.devcontainer/setupEnv.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ pip install --upgrade pip
55

66
(cd ./src/frontend; pip install -r requirements.txt)
77

8-
(cd ./src/backend; pip install -r requirements.txt)
8+
9+
(cd ./src/backend; pip install -r requirements.txt)
10+
11+

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
max-line-length = 88
33
extend-ignore = E501
44
exclude = .venv, frontend
5-
ignore = E203, W503, G004, G200
5+
ignore = E203, W503, G004, G200, E402

.github/workflows/docker-build-and-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: docker/setup-buildx-action@v1
3333

3434
- name: Log in to Azure Container Registry
35-
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix') }}
35+
if: ${{ (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix') }}
3636
uses: azure/docker-login@v2
3737
with:
3838
login-server: ${{ secrets.ACR_LOGIN_SERVER }}

.github/workflows/stale-bot.yml

Lines changed: 70 additions & 7 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: '0 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
19-
days-before-close: 30
20+
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

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
run: |
3838
python -m pip install --upgrade pip
3939
pip install -r src/backend/requirements.txt
40-
pip install pytest-cov
41-
pip install pytest-asyncio
4240
4341
- name: Check if test files exist
4442
id: check_tests
@@ -50,7 +48,6 @@ jobs:
5048
echo "Test files found, running tests."
5149
echo "skip_tests=false" >> $GITHUB_ENV
5250
fi
53-
5451
- name: Run tests with coverage
5552
if: env.skip_tests == 'false'
5653
run: |
@@ -59,4 +56,4 @@ jobs:
5956
- name: Skip coverage report if no tests
6057
if: env.skip_tests == 'true'
6158
run: |
62-
echo "Skipping coverage report because no tests were found."
59+
echo "Skipping coverage report because no tests were found."

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ To add your newly created backend image:
177177
name: 'FRONTEND_SITE_NAME'
178178
value: 'https://<website Name>.azurewebsites.net'
179179

180-
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
181-
value: <Application Insights Instrumentation Key>
180+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
181+
value: <Application Insights Connection String>
182182

183183
- Click 'Save' and deploy your new revision
184184

deploy/macae-continer-oc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
367367
},
368368
{
369-
"name": "APPLICATIONINSIGHTS_INSTRUMENTATION_KEY",
369+
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
370370
"value": "[reference('appInsights').ConnectionString]"
371371
}
372372
]

deploy/macae-continer.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
276276
value: 'https://${format(uniqueNameFormat, 'frontend')}.azurewebsites.net'
277277
}
278278
{
279-
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
279+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
280280
value: appInsights.properties.ConnectionString
281281
}
282282
]

documentation/LocalDeployment.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Local setup
1010

1111
> **Note for macOS Developers**: If you are using macOS on Apple Silicon (ARM64) the DevContainer will **not** work. This is due to a limitation with the Azure Functions Core Tools (see [here](https://github.com/Azure/azure-functions-core-tools/issues/3112)). We recommend using the [Non DevContainer Setup](./NON_DEVCONTAINER_SETUP.md) instructions to run the accelerator locally.
12+
1213
The easiest way to run this accelerator is in a VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):
1314

1415
1. Start Docker Desktop (install it if not already installed)
@@ -96,8 +97,8 @@ The files for the dev container are located in `/.devcontainer/` folder.
9697
**Using a Different Database in Cosmos:**
9798
9899
You can set the solution up to use a different database in Cosmos. For example, you can name it something like autogen-dev. To do this:
99-
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
100-
2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled “_+ New Container_” and provide all the necessary details.
100+
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
101+
2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled “_+ New Container_” and provide all the necessary details.
101102
102103
6. **Create a `.env` file:**
103104

0 commit comments

Comments
 (0)