Skip to content

Commit bd4e9d8

Browse files
committed
Refactor GitHub Actions workflows for improved change detection and quality checks
- Updated change detection logic in `continuous-deployment.yml` and `pr-deploy-and-test.yml` to include `shared/src/common/` directory. - Added a new job for quality checks in `pr-deploy-and-test.yml` to enhance code quality before deployment. - Cleaned up whitespace in `deploy-backend.yml` for better readability. - Minor update to error logging in `batch_processor.py` for clarity.
1 parent eefda9b commit bd4e9d8

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

.github/workflows/continuous-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Detect recordprocessor changes compared to master
2929
id: detect
3030
run: |
31-
if git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -q '^lambdas/recordprocessor/'; then
31+
if git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -Eq '^(lambdas/recordprocessor/|shared/src/common/)'; then
3232
echo "has_changes=true" >> "$GITHUB_OUTPUT"
3333
else
3434
echo "has_changes=false" >> "$GITHUB_OUTPUT"

.github/workflows/deploy-backend.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,11 @@ jobs:
6969
recordprocessor_image_tag: ${{ steps.build-image.outputs.recordprocessor_image_tag }}
7070
name: Build and push recordprocessor image
7171
runs-on: ubuntu-latest
72-
7372
environment:
7473
name: ${{ inputs.environment }}
75-
7674
env:
7775
AWS_REGION: eu-west-2
7876
SUB_ENVIRONMENT: ${{ inputs.sub_environment }}
79-
8077
steps:
8178
- name: Checkout
8279
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98

.github/workflows/pr-deploy-and-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12+
run-quality-checks:
13+
uses: ./.github/workflows/quality-checks.yml
14+
secrets:
15+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
16+
1217
detect-recordprocessor-changes:
1318
runs-on: ubuntu-latest
1419
if: github.event.action == 'synchronize'
@@ -25,17 +30,12 @@ jobs:
2530
run: |
2631
git fetch origin "${{ github.event.pull_request.base.ref }}"
2732
28-
if git diff --name-only "origin/${{ github.event.pull_request.base.ref }}" "${{ github.sha }}" | grep -q '^lambdas/recordprocessor/'; then
33+
if git diff --name-only "origin/${{ github.event.pull_request.base.ref }}" "${{ github.sha }}" | grep -Eq '^(lambdas/recordprocessor/|shared/src/common/)'; then
2934
echo "has_changes=true" >> "$GITHUB_OUTPUT"
3035
else
3136
echo "has_changes=false" >> "$GITHUB_OUTPUT"
3237
fi
3338
34-
run-quality-checks:
35-
uses: ./.github/workflows/quality-checks.yml
36-
secrets:
37-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38-
3939
deploy-pr-backend:
4040
needs: [run-quality-checks, detect-recordprocessor-changes]
4141
if: ${{ always() && !failure() && !cancelled() }}

lambdas/recordprocessor/src/batch_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def process_csv_to_fhir(incoming_message_body: dict) -> int:
3131
incoming_message_body["encoder"] = encoder
3232
interim_message_body = file_level_validation(incoming_message_body=incoming_message_body)
3333
except Exception as e: # pylint: disable=broad-exception-caught
34-
logger.error(f"File level validation failed: {e}") # If the file is invalid, processing should cease
34+
logger.error(f"File level validation failed: {e}") # If the file is invalid, processing should cease.
3535
return 0
3636

3737
file_id = interim_message_body.get("message_id")

0 commit comments

Comments
 (0)