Skip to content

Commit 71bef87

Browse files
BCDA-9397: Make sure lambda workflow verify steps run on call (#1202)
## 🎫 Ticket https://jira.cms.gov/browse/BCDA-9397 ## 🛠 Changes Adjust cclf import and opt-out lambda integration test workflows to make sure the verify process works when called via on_dispatch. ## ℹ️ Context Recent manual runs of both have skipped the verify step: https://github.com/CMSgov/bcda-app/actions/runs/17273221595 <!-- If any of the following security implications apply, this PR must not be merged without Stephen Walter's approval. Explain in this section and add @SJWalter11 as a reviewer. - Adds a new software dependency or dependencies. - Modifies or invalidates one or more of our security controls. - Stores or transmits data that was not stored or transmitted before. - Requires additional review of security implications for other reasons. --> ## 🧪 Validation Workflow run on push: - cclfhttps://github.com/CMSgov/bcda-app/actions/runs/17274630077/job/49028241943?pr=1202 (cclf import)
1 parent e773188 commit 71bef87

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
**/test_results
1212
!./bcdaworker/data/test/test.ndjson
1313
**/bcda/pending_delete_dir/*
14+
15+
**/.DS_Store

.github/workflows/cclf-import-integration-test.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
defaults:
3636
run:
3737
working-directory: bcda
38-
outputs:
39-
cclffilename: ${{ steps.createfile.outputs.cclffilename }}
40-
csvfilename: ${{ steps.createfile.outputs.csvfilename }}
4138
steps:
4239
- uses: actions/checkout@v4
4340
- uses: aws-actions/configure-aws-credentials@v4
@@ -59,21 +56,20 @@ jobs:
5956
role-chaining: true
6057
role-skip-session-tagging: true
6158
- name: Upload test file to the BFD bucket to trigger lambda function via SNS message
62-
id: createfile
6359
run: |
6460
year=$(date +'%y')
6561
date=$(date +'%y%m%d')
6662
time=$(date +'%H%M%S')
6763
6864
fname=T.BCD.A0001.ZCY${year}.D${date}.T${time}1
6965
cclf8_fname=T.BCD.A0001.ZC8Y${year}.D${date}.T${time}1
70-
echo "CCLFFILENAME=$cclf8_fname" >> "$GITHUB_OUTPUT"
66+
echo "CCLFFILENAME=$cclf8_fname" >> "$GITHUB_ENV"
7167
7268
csvname=T.PCPB.M${year}11.D${date}.T${time}1
73-
echo "CSVFILENAME=$csvname" >> "$GITHUB_OUTPUT"
69+
echo "CSVFILENAME=$csvname" >> "$GITHUB_ENV"
7470
7571
guidecsvname=T.GUIDE.GUIDE-00001.Y${year}.D${date}.T${time}1
76-
echo "GUIDEFILENAME=$guidecsvname" >> "$GITHUB_OUTPUT"
72+
echo "GUIDEFILENAME=$guidecsvname" >> "$GITHUB_ENV"
7773
7874
mv ../shared_files/cclf/archives/csv/P.PCPB.M2411.D181120.T1000000 ${csvname}
7975
@@ -97,16 +93,8 @@ jobs:
9793
9894
aws s3 cp --no-progress ${guidecsvname} \
9995
s3://bfd-test-eft/bfdeft01/bcda/in/test/${guidecsvname}
100-
101-
102-
103-
verify:
104-
needs: trigger
105-
runs-on: codebuild-bcda-app-${{github.run_id}}-${{github.run_attempt}}
106-
env:
107-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: "true"
108-
steps:
109-
- uses: actions/checkout@v3
96+
# Give a bit of time for lambdas to process files
97+
- run: sleep 60
11098
- uses: aws-actions/configure-aws-credentials@v4
11199
with:
112100
aws-region: ${{ vars.AWS_REGION }}
@@ -124,17 +112,11 @@ jobs:
124112
CONNECTION_INFO=/bcda/test/api/DATABASE_URL
125113
- name: Verify CCLF file was ingested
126114
env:
127-
CCLFFILENAME: ${{ needs.trigger.outputs.cclffilename }}
128-
CSVFILENAME: ${{ needs.trigger.outputs.csvfilename }}
129-
GUIDEFILENAME: ${{ needs.trigger.outputs.guidefilename }}
130115
PGSSLMODE: require
131116
# CAUTION: if changing the script below, validate that sensitive information is not printed in the workflow
132117
run: |
133118
HOST=$(aws rds describe-db-cluster-endpoints --db-cluster-identifier bcda-test-aurora 2>&1 | jq -r '.DBClusterEndpoints[0].Endpoint' 2>&1)
134-
echo $HOST | cut -c -10
135119
CONNECTION_URL=$(echo $CONNECTION_INFO 2>&1 | sed -E "s/@.*\/bcda/\@$HOST\/bcda/" 2>&1)
136-
echo $CONNECTION_URL | cut -c -5
137-
echo $CCLFFILENAME
138120
139121
# Verify that we have a record of the CCLF file in the database
140122
CCLF_FILE=`psql -t "$CONNECTION_URL" -c "SELECT id FROM cclf_files WHERE name = '$CCLFFILENAME' LIMIT 1" 2>&1`

.github/workflows/opt-out-import-integration-test.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,19 @@ jobs:
3636
defaults:
3737
run:
3838
working-directory: ./optout
39-
outputs:
40-
filename: ${{ steps.createfile.outputs.FILENAME }}
4139
steps:
4240
- uses: actions/checkout@v4
4341
- uses: aws-actions/configure-aws-credentials@v4
4442
with:
4543
aws-region: ${{ vars.AWS_REGION }}
46-
role-to-assume: arn:aws:iam::${{ secrets.NON_PROD_ACCOUNT_ID }}:role/delegatedadmin/developer/bcda-test-opt-out-export-function
44+
role-to-assume: arn:aws:iam::${{ secrets.NON_PROD_ACCOUNT_ID }}:role/delegatedadmin/developer/bcda-test-opt-out-import-function
4745
- name: Get BFD Account
4846
uses: cmsgov/cdap/actions/aws-params-env-action@main
4947
env:
5048
AWS_REGION: ${{ vars.AWS_REGION }}
5149
with:
5250
params: |
5351
BFD_ACCOUNT_ID=/bfd/account-id
54-
5552
- uses: aws-actions/configure-aws-credentials@v4
5653
with:
5754
aws-region: ${{ vars.AWS_REGION }}
@@ -60,20 +57,13 @@ jobs:
6057
role-chaining: true
6158
role-skip-session-tagging: true
6259
- name: Upload test file to the BFD bucket to trigger lambda function via SNS message
63-
id: createfile
6460
run: |
6561
fname=T\#EFT.ON.ACO.NGD1800.DPRF.D$(date +'%y%m%d').T$(date +'%H%M%S')1
66-
echo "FILENAME=$fname" >> "$GITHUB_OUTPUT"
67-
aws s3 cp ../shared_files/synthetic1800MedicareFiles/test/T\#EFT.ON.ACO.NGD1800.DPRF.D181120.T1000009 \
62+
echo "FILENAME=$fname" >> "$GITHUB_ENV"
63+
aws s3 cp --no-progress ../shared_files/synthetic1800MedicareFiles/test/T\#EFT.ON.ACO.NGD1800.DPRF.D181120.T1000009 \
6864
s3://bfd-test-eft/bfdeft01/bcda/in/test/$fname
69-
70-
verify:
71-
needs: trigger
72-
runs-on: codebuild-bcda-app-${{github.run_id}}-${{github.run_attempt}}
73-
env:
74-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: "true"
75-
steps:
76-
- uses: actions/checkout@v3
65+
# Give a bit of time for lambdas to process files
66+
- run: sleep 60
7767
- uses: aws-actions/configure-aws-credentials@v4
7868
with:
7969
aws-region: ${{ vars.AWS_REGION }}
@@ -86,18 +76,15 @@ jobs:
8676
uses: cmsgov/cdap/actions/aws-params-env-action@main
8777
env:
8878
AWS_REGION: ${{ vars.AWS_REGION }}
89-
9079
with:
9180
params: |
9281
CONNECTION_INFO=/bcda/test/api/DATABASE_URL
9382
- name: Verify suppression file was ingested
94-
env:
95-
FILENAME: ${{needs.trigger.outputs.filename}}
9683
# CAUTION: if changing the script below, validate that sensitive information is not printed in the workflow
9784
run: |
9885
HOST=$(aws rds describe-db-cluster-endpoints --db-cluster-identifier bcda-test-aurora 2>&1 | jq -r '.DBClusterEndpoints[0].Endpoint' 2>&1)
9986
CONNECTION_URL=$(echo $CONNECTION_INFO 2>&1 | sed -E "s/@.*\/bcda/\@$HOST\/bcda/" 2>&1)
100-
echo $FILENAME
87+
10188
SUPPRESSION_FILE=`psql -t "$CONNECTION_URL" -c "SELECT id FROM suppression_files WHERE name = '$FILENAME' LIMIT 1" 2>&1`
10289
if [[ $? -ne 0 || -z $SUPPRESSION_FILE ]]; then
10390
echo "suppression_file query returned zero results or command failed"
@@ -109,4 +96,3 @@ jobs:
10996
exit 1
11097
fi
11198
fi
112-

0 commit comments

Comments
 (0)