Skip to content

Commit d913614

Browse files
authored
[CAI-720] test cron job (#1967)
* Update cron job schedule and add testing steps for chatbot vector index refresh * Add environment check for production in chatbot vector index refresh test
1 parent 9fa183e commit d913614

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

.github/workflows/chatbot_refresh_vector_index.yaml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
- add missing static
2626

2727
schedule:
28-
- cron: '0 22 * * *' # Run daily at 10:00 PM UTC (11:00 PM CEST) to refresh the index in prod
28+
- cron: '*/5 * * * *' # Run every 5 minutes # Run daily at 10:00 PM UTC (11:00 PM CEST) to refresh the index in prod
2929

3030
permissions:
3131
id-token: write
@@ -72,7 +72,7 @@ jobs:
7272
scheduled_refresh:
7373
name: Chatbot Refresh All Docs Vector Index (scheduled on prod)
7474
if: github.event_name == 'schedule'
75-
runs-on: codebuild-prod-github-runner-${{ github.run_id }}-${{ github.run_attempt }}
75+
runs-on: ubuntu-24.04
7676
outputs:
7777
environment: 'prod'
7878
environment: 'prod'
@@ -89,7 +89,28 @@ jobs:
8989
aws_region: eu-south-1
9090
role_to_assume: ${{ secrets.IAM_ROLE_CHATBOT_REINDEX }}
9191

92-
- name: Refresh All Docs Vector Index
93-
uses: ./.github/actions/refresh-all-docs-vector-index
94-
with:
95-
chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }}
92+
- name: Test bash
93+
run: |
94+
echo "Scheduled refresh job running..."
95+
96+
# - name: Refresh All Docs Vector Index
97+
# uses: ./.github/actions/refresh-all-docs-vector-index
98+
# with:
99+
# chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }}
100+
101+
scheduled_test:
102+
name: Test
103+
runs-on: ubuntu-24.04
104+
outputs:
105+
environment: 'prod'
106+
environment: 'prod'
107+
env:
108+
SITEMAP_URL: https://developer.pagopa.it/sitemap.xml
109+
110+
steps:
111+
- name: Test bash
112+
run: |
113+
echo "github.event_name ${{ github.event_name }} is equal to schedule ${{ github.event_name == 'schedule' }}"
114+
echo "environment ${{ environment }} should be equal to prod"
115+
echo "CHATBOT_LAMBDA_NAME ${{ vars.CHATBOT_LAMBDA_NAME }}"
116+
echo "IAM_ROLE_CHATBOT_REINDEX ${{ secrets.IAM_ROLE_CHATBOT_REINDEX != '' }}"

0 commit comments

Comments
 (0)