Skip to content

Commit 2b38b32

Browse files
NirajC-MicrosoftRoopan-MicrosoftAjitPadhi-MicrosoftPavan-Microsoftross-p-smith
authored
chore: Dev to main (#2079)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Co-authored-by: Ajit Padhi <v-padhiajit@microsoft.com> Co-authored-by: Roopan P M <v-roopanpm@microsoft.com> Co-authored-by: Pavan-Microsoft <v-kupavan@microsoft.com> Co-authored-by: Ross Smith <ross-p-smith@users.noreply.github.com> Co-authored-by: gpickett <122489228+gpickett@users.noreply.github.com> Co-authored-by: Francia Riesco <friesco@microsoft.com> Co-authored-by: Francia Riesco <Fr4nc3@users.noreply.github.com> Co-authored-by: Prajwal D C <v-dcprajwal@microsoft.com> Co-authored-by: Harmanpreet-Microsoft <v-harmanprka@microsoft.com> Co-authored-by: UtkarshMishra-Microsoft <v-utkamishra@microsoft.com> Co-authored-by: Priyanka-Microsoft <v-prisinghal@microsoft.com> Co-authored-by: Prasanjeet-Microsoft <v-singhprasa@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiran-Siluveru-Microsoft <v-ksiluveru@microsoft.com> Co-authored-by: Prashant-Microsoft <v-pmalusare@microsoft.com> Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com> Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com> Co-authored-by: RaviKiran-Microsoft <v-ravikirans@microsoft.com> Co-authored-by: Somesh Joshi <v-somejoshi@microsoft.com> Co-authored-by: Himanshi Agrawal <v-himagrawal@microsoft.com> Co-authored-by: pradeepjha-microsoft <v-pradeepjha@microsoft.com> Co-authored-by: Harmanpreet Kaur <v-harmanpkau@microsoft.com> Co-authored-by: Bangarraju-Microsoft <v-golib@microsoft.com> Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com> Co-authored-by: Kanchan-Microsoft <v-knagshetti@microsoft.com> Co-authored-by: Cristopher Coronado <cristofima@hotmail.com> Co-authored-by: Cristopher Coronado Moreira <crcorona@pichincha.com> Co-authored-by: Vamshi-Microsoft <v-vamolla@microsoft.com> Co-authored-by: Thanusree-Microsoft <168087422+Thanusree-Microsoft@users.noreply.github.com> Co-authored-by: Rohini-Microsoft <168007985+Rohini-Microsoft@users.noreply.github.com> Co-authored-by: Kingshuk-Microsoft <v-kidatta@microsoft.com> Co-authored-by: Ayaz-Microsoft <v-ayazkhan@microsoft.com> Co-authored-by: Abdul-Microsoft <v-amujeebta@microsoft.com> Co-authored-by: Prekshith-Microsoft <v-pdj@microsoft.com> Co-authored-by: Rafi-Microsoft <v-rafmd@microsoft.com> Co-authored-by: Ragini-Microsoft <v-raginich@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Atulku-Microsoft <v-atulku@microsoft.com> Co-authored-by: Akhileswara-Microsoft <v-golnaidu@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 583871e commit 2b38b32

38 files changed

Lines changed: 4395 additions & 2749 deletions

.github/workflows/bicep-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
security-events: write
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v5
22+
uses: actions/checkout@v6
2323

2424
- name: Run Microsoft Security DevOps Analysis
2525
uses: microsoft/security-devops-action@preview

.github/workflows/broken-links-checker.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Broken Link Checker
22

33
on:
44
pull_request:
5-
paths:
6-
- '**/*.md'
75
workflow_dispatch:
86

97
permissions:
@@ -16,7 +14,7 @@ jobs:
1614

1715
steps:
1816
- name: Checkout Repo
19-
uses: actions/checkout@v5
17+
uses: actions/checkout@v6
2018
with:
2119
fetch-depth: 0
2220

@@ -28,14 +26,19 @@ jobs:
2826
with:
2927
files: |
3028
**/*.md
29+
30+
- name: Skip - No Markdown Files Changed
31+
if: github.event_name == 'pull_request' && steps.changed-markdown-files.outputs.any_changed != 'true'
32+
run: echo "No markdown files changed. Skipping broken link check."
33+
3134
# For PR: Check broken links only in changed files
3235
- name: Check Broken Links in Changed Markdown Files
3336
id: lychee-check-pr
3437
if: github.event_name == 'pull_request' && steps.changed-markdown-files.outputs.any_changed == 'true'
3538
uses: lycheeverse/lychee-action@v2.7.0
3639
with:
3740
args: >
38-
--verbose --no-progress --exclude ^https?://
41+
--verbose --exclude-mail --no-progress --exclude ^https?://
3942
${{ steps.changed-markdown-files.outputs.all_changed_files }}
4043
failIfEmpty: false
4144
env:
@@ -48,7 +51,7 @@ jobs:
4851
uses: lycheeverse/lychee-action@v2.7.0
4952
with:
5053
args: >
51-
--verbose --no-progress --exclude ^https?://
54+
--verbose --exclude-mail --no-progress --exclude ^https?://
5255
'**/*.md'
5356
failIfEmpty: false
5457
env:

.github/workflows/build-docker-images.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ on:
66
- main
77
- dev
88
- demo
9-
paths:
10-
- 'code/**'
11-
- '!code/tests/**'
12-
- 'docker/**'
13-
- 'package.json'
14-
- 'pyproject.toml'
15-
- '.github/workflows/build-docker-images.yml'
16-
- '.github/workflows/build-docker.yml'
179
pull_request:
1810
branches:
1911
- main
@@ -28,7 +20,37 @@ on:
2820
workflow_dispatch:
2921

3022
jobs:
23+
check-changes:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
should_build: ${{ steps.filter.outputs.docker_related }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Check for relevant changes
34+
id: filter
35+
uses: dorny/paths-filter@v3
36+
with:
37+
filters: |
38+
docker_related:
39+
- 'code/**'
40+
- '!code/tests/**'
41+
- 'docker/**'
42+
- 'package.json'
43+
- 'pyproject.toml'
44+
- '.github/workflows/build-docker-images.yml'
45+
- '.github/workflows/build-docker.yml'
46+
47+
- name: Skip - No Relevant Changes
48+
if: steps.filter.outputs.docker_related != 'true' && github.event_name != 'workflow_dispatch'
49+
run: echo "No relevant changes detected. Skipping docker build."
50+
3151
docker-build:
52+
needs: check-changes
53+
if: needs.check-changes.outputs.should_build == 'true' || github.event_name == 'workflow_dispatch'
3254
strategy:
3355
matrix:
3456
include:

.github/workflows/ci.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ on:
66
- main
77
- dev
88
- demo
9-
paths:
10-
- 'infra/**'
11-
- 'scripts/**'
12-
- 'azure.yaml'
13-
- 'pyproject.toml'
14-
- 'Makefile'
15-
- '.github/workflows/ci.yml'
169
schedule:
1710
- cron: '0 8,20 * * *' # Runs at 8:00 AM and 8:00 PM GMT
1811
workflow_dispatch:
@@ -25,7 +18,36 @@ concurrency:
2518
group: ${{ github.workflow }}-${{ github.ref }}
2619

2720
jobs:
21+
check-changes:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
should_deploy: ${{ steps.filter.outputs.deploy_related }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Check for relevant changes
32+
id: filter
33+
uses: dorny/paths-filter@v3
34+
with:
35+
filters: |
36+
deploy_related:
37+
- 'infra/**'
38+
- 'scripts/**'
39+
- 'azure.yaml'
40+
- 'pyproject.toml'
41+
- 'Makefile'
42+
- '.github/workflows/ci.yml'
43+
44+
- name: Skip - No Relevant Changes
45+
if: steps.filter.outputs.deploy_related != 'true' && github.event_name != 'workflow_dispatch' && github.event_name != 'schedule'
46+
run: echo "No relevant changes detected. Skipping deployment validation."
47+
2848
deploy:
49+
needs: check-changes
50+
if: needs.check-changes.outputs.should_deploy == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
2951
runs-on: ubuntu-latest
3052
env:
3153
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
@@ -387,17 +409,17 @@ jobs:
387409

388410

389411
e2e-test:
390-
needs: deploy
391-
if: needs.deploy.outputs.DEPLOYMENT_SUCCESS == 'true'
412+
needs: [check-changes, deploy]
413+
if: always() && needs.deploy.result == 'success' && needs.deploy.outputs.DEPLOYMENT_SUCCESS == 'true'
392414
uses: ./.github/workflows/test-automation.yml
393415
with:
394416
web_url: ${{ needs.deploy.outputs.web_url }}
395417
admin_url: ${{ needs.deploy.outputs.admin_url }}
396418

397419

398420
cleanup:
399-
if: always()
400-
needs: [deploy, e2e-test]
421+
if: always() && needs.deploy.result != 'skipped'
422+
needs: [check-changes, deploy, e2e-test]
401423
runs-on: ubuntu-latest
402424

403425
env:

code/backend/batch/add_url_embeddings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ def process_url_contents_directly(url: str, env_helper: EnvHelper):
5959

6060
def download_url_and_upload_to_blob(url: str):
6161
try:
62-
response = requests.get(url)
62+
# Add User-Agent header to avoid being blocked by websites (e.g., Wikipedia)
63+
headers = {
64+
'User-Agent': 'cwyd-admin-user'
65+
}
66+
response = requests.get(url, headers=headers)
6367
parsed_data = BeautifulSoup(response.content, "html.parser")
6468
with io.BytesIO(parsed_data.get_text().encode("utf-8")) as stream:
6569
blob_client = AzureBlobStorageClient()
66-
blob_client.upload_file(stream, url, metadata={"title": url})
70+
blob_client.upload_file(stream, url)
6771
return func.HttpResponse(f"URL {url} added to knowledge base", status_code=200)
6872

6973
except Exception:

0 commit comments

Comments
 (0)