Skip to content

Commit

Permalink
updated github_actions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-npq committed Jul 10, 2023
1 parent 52f20db commit 09ca92c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/update_application_statuses.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Schedule Update Application Statuses
name: Update Application Statuses
on:
schedule:
- cron: '0 0 * * *'

jobs:
sweep:
name: Schedule Update Application Statuses
name: Update Application Statuses

runs-on: ubuntu-20.04
steps:
Expand All @@ -17,7 +17,7 @@ jobs:
sudo apt-get update
sudo apt-get install cf7-cli
- name: Schedule Update Application Statuses for dev
- name: Update Application Statuses for dev
shell: bash
env:
PAAS_ORGANISATION: dfe
Expand All @@ -33,7 +33,7 @@ jobs:
cf target -o "${{ env.PAAS_ORGANISATION }}" -s "${{ env.PAAS_SPACE }}"
cf run-task "${{ env.APP_NAME }}"-"${{ env.ENV_STUB }}" --command "cd /app && /usr/local/bundle/bin/bundle exec rails runner 'ApplicationSynchronizationJob.perform_later'" --process worker --name update_application_statuses
- name: Schedule Update Application Statuses for staging
- name: Update Application Statuses for staging
shell: bash
env:
PAAS_ORGANISATION: dfe
Expand All @@ -49,7 +49,7 @@ jobs:
cf target -o "${{ env.PAAS_ORGANISATION }}" -s "${{ env.PAAS_SPACE }}"
cf run-task "${{ env.APP_NAME }}"-"${{ env.ENV_STUB }}" --command "cd /app && /usr/local/bundle/bin/bundle exec rails runner 'ApplicationSynchronizationJob.perform_later'" --process worker --name update_application_statuses
- name: Schedule Update Application Statuses for sandbox
- name: Update Application Statuses for sandbox
shell: bash
env:
PAAS_ORGANISATION: dfe
Expand All @@ -65,7 +65,7 @@ jobs:
cf target -o "${{ env.PAAS_ORGANISATION }}" -s "${{ env.PAAS_SPACE }}"
cf run-task "${{ env.APP_NAME }}"-"${{ env.ENV_STUB }}" --command "cd /app && /usr/local/bundle/bin/bundle exec rails runner 'ApplicationSynchronizationJob.perform_later'" --process worker --name update_application_statuses
- name: Schedule Update Application Statuses for prod
- name: Update Application Statuses for prod
shell: bash
env:
PAAS_ORGANISATION: dfe
Expand Down
8 changes: 2 additions & 6 deletions app/lib/services/ecf/ecf_application_synchronization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ def handle_response(response)
lead_provider_approval_status = record.lead_provider_approval_status
participant_outcome_state = record.participant_outcome_state

application = Application.find_by(ecf_id: id)
if application.present?
application.update!(lead_provider_approval_status:, participant_outcome_state:)
else
raise "Application not found for ecf_id: #{id}"
end
application = Application.find_by!(ecf_id: id)
application.update!(lead_provider_approval_status:, participant_outcome_state:)
end
else
raise "Failed to update application: #{response.message}"
Expand Down
4 changes: 4 additions & 0 deletions docs/github_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Runs once a day to delete stale sessions from the database.

Runs on demand to update course definitions in the database. Syncing them to match `Courses::DEFINITIONS`.

### Update Application Statuses ([update_application_statuses.yml](../.github/workflows/update_application_statuses.yml))

Runs once a day to update applications lead_provider_approval_status and participant_outcome_state retrieved from the ecf.

### Updating Schools

See [Importing schools](importing_data.md#importing-schools) for more information.
Expand Down

0 comments on commit 09ca92c

Please sign in to comment.